
फ़ाइलों (PDF, Office, छवियाँ) से छिपे मेटाडेटा को हटाने के लिए Python SDK, स्वचालित सफाई वर्कफ़्लो के माध्यम से गोपनीयता की रक्षा और डेटा लीकेज को रोकने के लिए।
metashield_clean_up पैकेज को pip का उपयोग करके इंस्टॉल करें::
pip install metashield_clean_up
एक फ़ाइल को साफ करने का उदाहरण।
.. code-block:: python
import time
import base64
from metashield_clean_up.api import MetashieldCleanUp
api = MetashieldCleanUp("REPLACE_APP_ID_HERE", "REPLACE_SECRET_KEY_HERE")
with open("file.pdf", "rb") as f:
response = api.clean_file(f.read(), "file.pdf")
clean_id = response.data["cleanId"]
time.sleep(5) # wait until file is cleaned
response2 = api.get_clean_result(clean_id)
decoded = base64.b64decode(response2.data[clean_id])
with open("cleanFile.pdf", "w") as f:
f.write(decoded)
परीक्षण चलाने से पहले, tests/settings_default.py मॉड्यूल में कुछ सेटिंग्स बदलें।
परीक्षण Python Unittest के साथ बनाए गए हैं, निम्नलिखित कमांड चलाएँ::
python -m unittest discover tests