{ "info": { "author": "Aaron Burgess", "author_email": "geoburge@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Clean Pandas\nPandas accessor for replacing, removing, or encrypting a DataFrame or Series that contains Personally Identifiable Information (PII) or Protected Health Information (PHI)\n\n## Dependencies\n\n* [Faker](https://github.com/joke2k/faker)\n* [Scrubadub](https://github.com/datascopeanalytics/scrubadub)\n* [cryptography](https://github.com/pyca/cryptography)\n\n## Installation\n\n```python\npip install clean_pandas\n```\n\n## Clean Type Options\n\n* ```encrypt``` (default) - Utilizes the [cryptography](https://github.com/pyca/cryptography) library and uses Fernet (symmetric encryption)\n * **NOTE**: You must use the ```serialize_encryption_key``` before ending your REPL or program in order to decrypt\n* ```faker``` - Utilizes the [Faker](https://github.com/joke2k/faker) library and requires user denote the Faker \"fake\" to use\n* ```scrubadub``` - Utilizes the [Scrubadub](https://github.com/datascopeanalytics/scrubadub) library to detect and replace PII\n* ```truncate``` - Truncates the data by casting to a string, if possible, and recast to original type if possible. Returns ```None``` if truncation is longer than the value length. Returns the string value if cannot be cast back to original type\n\n\n## Basic Usage\n\n```python\n>>> from clean_pandas import CleanPandas\n>>> import pandas as pd\n\n>>> test_df = pd.DataFrame({\"first_name\": [\"Charles\", \"Stephen\"], \n \"last_name\": [\"Darwin\", \"Hawking\"], \n \"ssn\": [\"555-55-5555\", \"123-45-6789\"]})\n\n>>> result_df, encryption_key, dtype_dict = test_df.clean_pandas.encrypt('ssn')\n>>> result_df['ssn']\n0 b'gAAAAABbextrtJcQfOt37HK7pEISBokuh9ndWwGhvZpv...\n1 b'gAAAAABbextrHo7qFr6DIZ0FlvVyO73HOmOYujKsv6vS...\nName: ssn, dtype: object\n\n>>> test_df.clean_pandas.fake_it('last_name', faker_type='first_name')['last_name']\n0 Joshua\n1 Michael\nName: last_name, dtype: object\n\n>>> test_df.clean_pandas.scrub_it('ssn')['ssn']\n0 {{SSN}}\n1 {{SSN}}\nName: ssn, dtype: object\n\n>>> test_df.clean_pandas.truncate('ssn', trunc_length=7, trunc_from_end=False)['ssn']\n0 5555\n1 6789\nName: ssn, dtype: object\n\n\n# Decrypt a series\n>>> result_df, encryption_key, dtype_dict = test_df.clean_pandas.encrypt('ssn') # encrypt\n>>> test_df.some_id\n0 b'gAAAAABblA1SIGqKbTC97RjEibmB4FBHnXqKVocvFMg4...\n1 b'gAAAAABblA1Sc_StggFPj0zmQLUVo0ADqHQtljUEGcr0...\nName: some_id, dtype: object\n\n# Automatically casts back to original dtype with optional dtype argument\n>>> result_df.clean_pandas.decrypt('some_id', encryption_key, dtype_dict)['some_id']\n0 1\n1 2\nName: some_id, dtype: int64\n\n```\n\n## License\n\nMIT License\n\nCopyright (c) 2018 Aaron Burgess\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/awburgess/clean_pandas", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "clean-pandas", "package_url": "https://pypi.org/project/clean-pandas/", "platform": "", "project_url": "https://pypi.org/project/clean-pandas/", "project_urls": { "Homepage": "https://github.com/awburgess/clean_pandas" }, "release_url": "https://pypi.org/project/clean-pandas/1.0.0/", "requires_dist": [ "Faker", "cryptography", "scrubadub" ], "requires_python": "", "summary": "Pandas accessor for replacing, removing, or encrypting a DataFrame or Series that contains Personally Identifiable Information (PII) or Protected Health Information (PHI)", "version": "1.0.0" }, "last_serial": 4361237, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "f520cb3591cda1733ed3644710a9b941", "sha256": "a8457bb664a0233a8f238f6a2cf69f5758be64d45dea9fa65352cc7b66d6dc39" }, "downloads": -1, "filename": "clean_pandas-0.1.1-py3.6.egg", "has_sig": false, "md5_digest": "f520cb3591cda1733ed3644710a9b941", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 13730, "upload_time": "2018-08-22T16:54:15", "url": "https://files.pythonhosted.org/packages/ec/30/b7b196bbb6164398a9bd361af9bdeac95a8a52d1e11266c768a60f28721c/clean_pandas-0.1.1-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "6655e536f85d1e42f268c2eaeb33ce8a", "sha256": "ae49204f7d5237673c8a8793b01da525ae1805519e4e061961166b938914c3ec" }, "downloads": -1, "filename": "clean_pandas-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6655e536f85d1e42f268c2eaeb33ce8a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7228, "upload_time": "2018-08-22T16:54:14", "url": "https://files.pythonhosted.org/packages/69/cc/322e42a8b418c55d91a4783c2b6613ccd59e7eb093cbd774c7c4a9811e69/clean_pandas-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "74b3503a1a1cd70f889029119721a4bd", "sha256": "b3f6f254a2329f98d9cc3dfe8e1d43b3a5932e233c3d07892a47f50261d2a38a" }, "downloads": -1, "filename": "clean_pandas-0.1.1.tar.gz", "has_sig": false, "md5_digest": "74b3503a1a1cd70f889029119721a4bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6592, "upload_time": "2018-08-22T16:54:16", "url": "https://files.pythonhosted.org/packages/ed/ed/7bd5495f4a42c378733009e7ce652e243d7c5e14f6867119a3fe95396ee9/clean_pandas-0.1.1.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "82ebb37e78d722aa79b8c13148b2da1f", "sha256": "3443d26f1bd93640ab78c43d34717b6f55ceb799d23df4e964bb815f018d819e" }, "downloads": -1, "filename": "clean_pandas-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "82ebb37e78d722aa79b8c13148b2da1f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8123, "upload_time": "2018-10-10T19:12:10", "url": "https://files.pythonhosted.org/packages/05/25/ef2a686f5beb8d1fa83e24beafcc6e77a26b8d94d6ead172c306b672650c/clean_pandas-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cba7c4fd9bc64ceb144c8f3074cfea09", "sha256": "fbb0d120f1a2c110eadbbdfa0a45b49a2e68992cf5d34327bfe1af38b9277fb2" }, "downloads": -1, "filename": "clean_pandas-1.0.0.tar.gz", "has_sig": false, "md5_digest": "cba7c4fd9bc64ceb144c8f3074cfea09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6744, "upload_time": "2018-10-10T19:12:12", "url": "https://files.pythonhosted.org/packages/0f/03/2263e62fa5088d215c6078b53667c0496e4671925bffa4d806204b432ac0/clean_pandas-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "82ebb37e78d722aa79b8c13148b2da1f", "sha256": "3443d26f1bd93640ab78c43d34717b6f55ceb799d23df4e964bb815f018d819e" }, "downloads": -1, "filename": "clean_pandas-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "82ebb37e78d722aa79b8c13148b2da1f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8123, "upload_time": "2018-10-10T19:12:10", "url": "https://files.pythonhosted.org/packages/05/25/ef2a686f5beb8d1fa83e24beafcc6e77a26b8d94d6ead172c306b672650c/clean_pandas-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cba7c4fd9bc64ceb144c8f3074cfea09", "sha256": "fbb0d120f1a2c110eadbbdfa0a45b49a2e68992cf5d34327bfe1af38b9277fb2" }, "downloads": -1, "filename": "clean_pandas-1.0.0.tar.gz", "has_sig": false, "md5_digest": "cba7c4fd9bc64ceb144c8f3074cfea09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6744, "upload_time": "2018-10-10T19:12:12", "url": "https://files.pythonhosted.org/packages/0f/03/2263e62fa5088d215c6078b53667c0496e4671925bffa4d806204b432ac0/clean_pandas-1.0.0.tar.gz" } ] }