{"id":27594,"library":"argus-redact","title":"Argus Redact","description":"A Python library for local PII redaction that encrypts personally identifiable information in text while preserving contextual meaning. The current version is 0.6.5, updated as of late 2024. Release cadence is irregular, with occasional dependency updates.","status":"active","version":"0.6.5","language":"python","source_language":"en","source_url":"https://github.com/wan9yu/argus-redact","tags":["pii","redaction","encryption","privacy","nlp"],"install":[{"cmd":"pip install argus-redact","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"Encryption primitives for PII redaction","package":"cryptography","optional":false},{"reason":"Named entity recognition for PII detection","package":"spacy","optional":false}],"imports":[{"note":"Old name before v0.4.0","wrong":"from argus_redact import ArgusRedactor","symbol":"Redactor","correct":"from argus_redact import Redactor"}],"quickstart":{"code":"import os\nfrom argus_redact import Redactor\n\n# Initialize redactor with an encryption key\nredactor = Redactor(key=os.environ.get('ARGUS_KEY', 'my-secret-key-32chars'))\n\n# Redact PII in text\ntext = \"My email is john.doe@example.com and phone is 555-1234.\"\nredacted = redactor.redact(text)\nprint(redacted)\n# Example output: \"My email is <EMAIL> and phone is <PHONE>.\"","lang":"python","description":"Create a Redactor instance with an encryption key, then call .redact() on text to replace PII with placeholders."},"warnings":[{"fix":"Set the encryption algorithm explicitly when initializing: Redactor(algorithm='AES-128') to maintain backward compatibility.","message":"In v0.6.0, the default encryption algorithm changed from AES-128 to AES-256. Redacted data from earlier versions cannot be decrypted using the new default.","severity":"breaking","affected_versions":">=0.6.0"},{"fix":"Ensure the key is exactly 32 bytes for default AES-256. Use key.encode('utf-8') or generate a proper key.","message":"The Redactor key must be exactly 32 bytes for AES-256 (or 16 bytes for AES-128). Passing a string of incorrect length raises a cryptic cryptography error.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace all calls to `redact_pii` with `redact`.","message":"The method `redact_pii` is deprecated since v0.5.0. Use `redact` instead.","severity":"deprecated","affected_versions":"<0.5.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Install via pip: pip install argus-redact. Ensure no typo in module name (use underscore).","cause":"Python environment does not have argus-redact installed, or import path is incorrect.","error":"ModuleNotFoundError: No module named 'argus_redact'"},{"fix":"Use the same key for both redaction and decryption. Keys are case-sensitive and must be identical.","cause":"The encryption key used for decryption does not match the key used during redaction.","error":"InvalidToken: The token is invalid"},{"fix":"Use: from argus_redact import Redactor","cause":"Wrong import path, possibly confusing with older API versions.","error":"AttributeError: module 'argus_redact' has no attribute 'Redactor'"},{"fix":"Generate a key of appropriate length, e.g., key = b'abcdefghijklmnop' for AES-128 or 32 bytes for AES-256.","cause":"The provided key length is not 16 (AES-128) or 32 (AES-256) bytes.","error":"ValueError: key must be 16 or 32 bytes long"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}