Skip to content

Commit

Permalink
Updated docs website and notebooks (#1086)
Browse files Browse the repository at this point in the history
  • Loading branch information
omri374 authored Jun 4, 2023
1 parent dda4444 commit 0e5c3b7
Show file tree
Hide file tree
Showing 20 changed files with 2,044 additions and 1,781 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ vendor/
.idea

#mkdocs
/mkdocs
mkdocs/
77 changes: 2 additions & 75 deletions docs/api/analyzer_python.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,6 @@
# Presidio Analyzer API Reference

## AnalyzerEngine

::: presidio_analyzer.AnalyzerEngine
handler: python
selection:
docstring_style: restructured-text

## RecognizerRegistry

::: presidio_analyzer.RecognizerRegistry
handler: python
selection:
docstring_style: restructured-text

## EntityRecognizer

::: presidio_analyzer.EntityRecognizer
handler: python
selection:
docstring_style: restructured-text

## RemoteRecognizer

::: presidio_analyzer.RemoteRecognizer
handler: python
selection:
docstring_style: restructured-text

## LocalRecognizer

::: presidio_analyzer.LocalRecognizer
handler: python
selection:
docstring_style: restructured-text

## PatternRecognizer

::: presidio_analyzer.PatternRecognizer
handler: python
selection:
docstring_style: restructured-text

## NlpArtifacts

::: presidio_analyzer.nlp_engine.NlpArtifacts
handler: python
selection:
docstring_style: restructured-text

::: presidio_analyzer.nlp_engine.NlpEngine
handler: python
selection:
docstring_style: restructured-text

::: presidio_analyzer.nlp_engine.SpacyNlpEngine
handler: python
selection:
docstring_style: restructured-text

::: presidio_analyzer.nlp_engine.NlpEngineProvider
handler: python
selection:
docstring_style: restructured-text

## RecognizerResult

::: presidio_analyzer.recognizer_result.RecognizerResult
handler: python
selection:
docstring_style: restructured-text

## Pattern

::: presidio_analyzer.Pattern
::: presidio_analyzer
handler: python
selection:
docstring_style: restructured-text
docstring_style: sphinx
2 changes: 1 addition & 1 deletion docs/api/anonymizer_python.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
::: presidio_anonymizer
handler: python
selection:
docstring_style: restructured-text
docstring_style: sphinx
4 changes: 2 additions & 2 deletions docs/api/image_redactor_python.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
::: presidio_image_redactor.ImageRedactorEngine
handler: python
selection:
docstring_style: restructured-text
docstring_style: sphinx

## ImageAnalyzerEngine class

::: presidio_image_redactor.ImageAnalyzerEngine
handler: python
selection:
docstring_style: restructured-text
docstring_style: sphinx
9 changes: 4 additions & 5 deletions docs/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
mkdocs
mkdocs-material
mkdocs-jupyter
pymdown-extensions<9.4
mknotebooks
pymdown-extensions
markdown
mkdocstrings[python-legacy]
mkdocstrings-python
presidio_analyzer
presidio_anonymizer
presidio_image_redactor
jupyter_contrib_nbextensions
pygments>=2.10,<2.12
pygments>=2.10
48 changes: 24 additions & 24 deletions docs/samples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@

| Topic | Type | Sample |
| :---------- |:--------------------------------------| :---------------------------------------------------------------------------------------------------------------------------------------------- |
| Usage | Python Notebook | [Presidio Basic Usage Notebook](python/presidio_notebook.ipynb) |
| Usage | Python Notebook | [Customizing Presidio Analyzer](python/customizing_presidio_analyzer.ipynb) |
| Usage | Python | [Remote Recognizer](python/example_remote_recognizer.py) |
| Usage | Python | [Text Analytics as a Remote Recognizer](python/text_analytics/index.md) |
| Usage | Python Notebook | [Integrating with external services](python/integrating_with_external_services.ipynb) |
| Usage | Python | [Passing a lambda as a Presidio anonymizer using Faker](python/example_custom_lambda_anonymizer.py) |
| Usage | Python Notebook | [Encrypting and Decrypting identified entities](python/encrypt_decrypt.ipynb) |
| Usage | Python Notebook | [Analyzing structured / semi-structured data in batch](python/batch_processing.ipynb) |
| Usage | Python | [Analyze and Anonymize CSV file](python/process_csv_file.py) |
| Usage | Python Notebook | [Getting the identified entity value using a custom Operator](python/getting_entity_values.ipynb) |
| Usage | Python | [Using Flair as an external PII model](python/flair_recognizer.py) |
| Usage | Python | [Using Transformers as an external PII model](python/transformers_recognizer/index.md) |
| Usage | Python Notebook | [Anonymizing known values](python/Anonymizing%20known%20values.ipynb)
| Usage | Python Notebook | [Redacting text PII from DICOM images](python/example_dicom_image_redactor.ipynb)
| Usage | Python Notebook | [Annotating PII in a PDF](python/example_pdf_annotation.ipynb)
| Usage | REST API (postman) | [Presidio as a REST endpoint](docker/index.md) |
| Deployment | App Service | [Presidio with App Service](deployments/app-service/index.md) |
| Deployment | Kubernetes | [Presidio with Kubernetes](deployments/k8s/index.md) |
| Deployment | Spark/Azure Databricks | [Presidio with Spark](deployments/spark/index.md) |
| Deployment | Azure Data Factory with App Service | [ETL for small dataset](deployments/data-factory/presidio-data-factory.md#option-1-presidio-as-an-http-rest-endpoint) |
| Deployment | Azure Data Factory with Databricks | [ETL for large datasets](deployments/data-factory/presidio-data-factory.md#option-2-presidio-on-azure-databricks) |
| ADF Pipeline | Azure Data Factory | [Add Presidio as an HTTP service to your Azure Data Factory](deployments/data-factory/presidio-data-factory-template-gallery-http.md) |
| ADF Pipeline | Azure Data Factory | [Add Presidio on Databricks to your Azure Data Factory](deployments/data-factory/presidio-data-factory-template-gallery-databricks.md) |
| Demo | Streamlit | [Create a simple demo app using Streamlit](python/streamlit/index.md)
| Usage | Python Notebook | [Presidio Basic Usage Notebook](python/presidio_notebook.ipynb) |
| Usage | Python Notebook | [Customizing Presidio Analyzer](python/customizing_presidio_analyzer.ipynb) |
| Usage | Python Notebook | [Analyzing structured / semi-structured data in batch](python/batch_processing.ipynb)|
| Usage | Python Notebook | [Encrypting and Decrypting identified entities](python/encrypt_decrypt.ipynb)|
| Usage | Python Notebook | [Getting the identified entity value using a custom Operator](python/getting_entity_values.ipynb)|
| Usage | Python Notebook | [Anonymizing known values](https://github.com/microsoft/presidio/blob/main/docs/samples/python/Anonymizing%20known%20values.ipynb)
| Usage | Python Notebook | [Redacting text PII from DICOM images](https://github.com/microsoft/presidio/blob/main/docs/samples/python/example_dicom_image_redactor.ipynb)
| Usage | Python Notebook | [Annotating PII in a PDF](https://github.com/microsoft/presidio/blob/main/docs/samples/python/example_pdf_annotation.ipynb)
| Usage | Python Notebook | [Integrating with external services](https://github.com/microsoft/presidio/blob/main/docs/samples/python/integrating_with_external_services.ipynb) |
| Usage | Python | [Remote Recognizer](https://github.com/microsoft/presidio/blob/main/docs/samples/python/example_remote_recognizer.py) |
| Usage | Python | [Text Analytics as a Remote Recognizer](https://github.com/microsoft/presidio/blob/main/docs/samples/python/text_analytics/index.md) |
| Usage | Python | [Analyze and Anonymize CSV file](https://github.com/microsoft/presidio/blob/main/docs/samples/python/process_csv_file.py) |
| Usage | Python | [Using Flair as an external PII model](https://github.com/microsoft/presidio/blob/main/docs/samples/python/flair_recognizer.py)|
| Usage | Python | [Using Transformers as an external PII model](python/transformers_recognizer/index.md)|
| Usage | Python | [Passing a lambda as a Presidio anonymizer using Faker](https://github.com/microsoft/presidio/blob/main/docs/samples/python/example_custom_lambda_anonymizer.py)|
| Usage | REST API (postman) | [Presidio as a REST endpoint](docker/index.md)|
| Deployment | App Service | [Presidio with App Service](deployments/app-service/index.md)|
| Deployment | Kubernetes | [Presidio with Kubernetes](deployments/k8s/index.md)|
| Deployment | Spark/Azure Databricks | [Presidio with Spark](deployments/spark/index.md)|
| Deployment | Azure Data Factory with App Service | [ETL for small dataset](deployments/data-factory/presidio-data-factory.md#option-1-presidio-as-an-http-rest-endpoint) |
| Deployment | Azure Data Factory with Databricks | [ETL for large datasets](deployments/data-factory/presidio-data-factory.md#option-2-presidio-on-azure-databricks) |
| ADF Pipeline | Azure Data Factory | [Add Presidio as an HTTP service to your Azure Data Factory](deployments/data-factory/presidio-data-factory-template-gallery-http.md) |
| ADF Pipeline | Azure Data Factory | [Add Presidio on Databricks to your Azure Data Factory](deployments/data-factory/presidio-data-factory-template-gallery-databricks.md) |
| Demo | Streamlit | [Create a simple demo app using Streamlit](python/streamlit/index.md)
57 changes: 43 additions & 14 deletions docs/samples/python/Anonymizing known values.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "bcddce7b",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"# download presidio\n",
"!pip install presidio_analyzer presidio_anonymizer"
]
},
{
"cell_type": "markdown",
"id": "3345f1c4",
"metadata": {},
"source": [
"Path to notebook: [https://www.github.com/microsoft/presidio/blob/main/docs/samples/python/Anonymizing%20known%20values.ipynb](https://www.github.com/microsoft/presidio/blob/main/docs/samples/python/Anonymizing%20known%20values.ipynb)"
]
},
{
"cell_type": "markdown",
"id": "a71c2409",
Expand All @@ -24,7 +45,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"id": "3d1e9cc1",
"metadata": {},
"outputs": [],
Expand All @@ -35,7 +56,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"id": "dc54fc31",
"metadata": {},
"outputs": [],
Expand All @@ -46,7 +67,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"id": "b926f0a0",
"metadata": {},
"outputs": [],
Expand All @@ -57,7 +78,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"id": "f5448009",
"metadata": {},
"outputs": [],
Expand All @@ -72,7 +93,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"id": "ec9e24e3",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -118,7 +139,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"id": "d57a02d6",
"metadata": {},
"outputs": [
Expand All @@ -136,7 +157,7 @@
" 'free_text': \"X1T2 is R2D2's special value\"}]"
]
},
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -166,7 +187,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"id": "b342fc25",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -211,7 +232,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"id": "bd347adf",
"metadata": {},
"outputs": [
Expand All @@ -232,7 +253,7 @@
" 'anonymized_free_text': \"<special_value> is <name>'s special value\"}]"
]
},
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -252,7 +273,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"id": "7abaea43",
"metadata": {},
"outputs": [],
Expand All @@ -271,7 +292,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"id": "5800fcc6",
"metadata": {},
"outputs": [
Expand All @@ -283,7 +304,7 @@
" type: LOCATION, start: 45, end: 62, score: 0.85]"
]
},
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -311,6 +332,14 @@
"- For more info on Presidio Anonymize, see [this documentation](https://microsoft.github.io/presidio/anonymizer/)\n",
"- To further customize the anonymization type, see [this tutorial](https://microsoft.github.io/presidio/tutorial/11_custom_anonymization/)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "51da9e15",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -329,7 +358,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.9.16"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 0e5c3b7

Please sign in to comment.