datafog 2.3.2__tar.gz → 2.3.2b2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {datafog-2.3.2/src/datafog.egg-info → datafog-2.3.2b2}/PKG-INFO +1 -1
- {datafog-2.3.2 → datafog-2.3.2b2}/setup.py +1 -5
- {datafog-2.3.2 → datafog-2.3.2b2}/src/datafog/__about__.py +1 -1
- {datafog-2.3.2 → datafog-2.3.2b2}/src/datafog/pii_tools/PresidioEngine/__init__.py +21 -0
- {datafog-2.3.2 → datafog-2.3.2b2/src/datafog.egg-info}/PKG-INFO +1 -1
- {datafog-2.3.2 → datafog-2.3.2b2}/LICENSE +0 -0
- {datafog-2.3.2 → datafog-2.3.2b2}/README.md +0 -0
- {datafog-2.3.2 → datafog-2.3.2b2}/setup.cfg +0 -0
- {datafog-2.3.2 → datafog-2.3.2b2}/src/datafog/__init__.py +0 -0
- {datafog-2.3.2 → datafog-2.3.2b2}/src/datafog/pii_tools/PresidioEngine/analyzer.py +0 -0
- {datafog-2.3.2 → datafog-2.3.2b2}/src/datafog.egg-info/SOURCES.txt +0 -0
- {datafog-2.3.2 → datafog-2.3.2b2}/src/datafog.egg-info/dependency_links.txt +0 -0
- {datafog-2.3.2 → datafog-2.3.2b2}/src/datafog.egg-info/requires.txt +0 -0
- {datafog-2.3.2 → datafog-2.3.2b2}/src/datafog.egg-info/top_level.txt +0 -0
- {datafog-2.3.2 → datafog-2.3.2b2}/tests/test_datafog.py +0 -0
- {datafog-2.3.2 → datafog-2.3.2b2}/tests/test_presidio.py +0 -0
|
@@ -5,10 +5,6 @@ with open("README.md", "r") as f:
|
|
|
5
5
|
long_description = f.read()
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
def __version__():
|
|
9
|
-
return "2.3.2"
|
|
10
|
-
|
|
11
|
-
|
|
12
8
|
project_urls = {
|
|
13
9
|
"Homepage": "https://datafog.ai",
|
|
14
10
|
"Documentation": "https://docs.datafog.ai",
|
|
@@ -20,7 +16,7 @@ project_urls = {
|
|
|
20
16
|
|
|
21
17
|
setup(
|
|
22
18
|
name="datafog",
|
|
23
|
-
version=
|
|
19
|
+
version="2.3.2b2",
|
|
24
20
|
author="DataFog",
|
|
25
21
|
author_email="hi@datafog.ai",
|
|
26
22
|
description="Scan, redact, and manage PII in your documents before they get uploaded to a Retrieval Augmented Generation (RAG) system.",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# SSOT for the package version
|
|
2
|
-
__version__ = "2.3.
|
|
2
|
+
__version__ = "2.3.2b2"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import json
|
|
1
2
|
import logging
|
|
2
3
|
from typing import List, Optional
|
|
3
4
|
|
|
@@ -161,6 +162,26 @@ def scan(text, **kwargs):
|
|
|
161
162
|
Returns:
|
|
162
163
|
List[AnalysisResult]: The list of analysis results.
|
|
163
164
|
"""
|
|
165
|
+
# handling for input 'text'
|
|
166
|
+
if isinstance(text, str):
|
|
167
|
+
|
|
168
|
+
if text.endswith(".json"):
|
|
169
|
+
print("Reading JSON from local path")
|
|
170
|
+
with open(text, "r") as file:
|
|
171
|
+
data = json.load(file)
|
|
172
|
+
text = json.dumps(data)
|
|
173
|
+
else:
|
|
174
|
+
text = text
|
|
175
|
+
else:
|
|
176
|
+
raise ValueError("Unsupported input source type: {}".format(type(text)))
|
|
177
|
+
|
|
178
|
+
# set default values for keyword arguments
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
164
185
|
kwargs.setdefault("language", "en")
|
|
165
186
|
kwargs.setdefault("score_threshold", 0.35)
|
|
166
187
|
kwargs.setdefault("nlp_artifacts", None)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|