{"id":18841221,"url":"https://github.com/poogles/piiregex","last_synced_at":"2025-04-14T07:08:37.483Z","repository":{"id":40949505,"uuid":"140865148","full_name":"Poogles/piiregex","owner":"Poogles","description":"Search for PII in Python","archived":false,"fork":false,"pushed_at":"2024-01-29T15:33:39.000Z","size":10,"stargazers_count":28,"open_issues_count":1,"forks_count":10,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T07:08:32.666Z","etag":null,"topics":["personally-identifiable-information","pii","piiregex","python3"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Poogles.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-13T15:40:41.000Z","updated_at":"2025-03-20T06:12:27.000Z","dependencies_parsed_at":"2024-11-08T02:50:29.065Z","dependency_job_id":"36471db6-b58c-47b1-8cdd-d9b4d2d524b3","html_url":"https://github.com/Poogles/piiregex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poogles%2Fpiiregex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poogles%2Fpiiregex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poogles%2Fpiiregex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poogles%2Fpiiregex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Poogles","download_url":"https://codeload.github.com/Poogles/piiregex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837281,"owners_count":21169374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["personally-identifiable-information","pii","piiregex","python3"],"created_at":"2024-11-08T02:50:26.418Z","updated_at":"2025-04-14T07:08:37.474Z","avatar_url":"https://github.com/Poogles.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PiiRegex  [![Build Status](https://travis-ci.org/Poogles/piiregex.svg?branch=master)](https://travis-ci.org/Poogles/piiregex)\n\nThis wouldn't have been possible without [CommonRegex](https://github.com/madisonmay/CommonRegex).  Thanks!\n\nAttempt to find PII in regex either using a specific PII type, or search through\neverything available.\n\nPull requests welcome!\n\nInstall via pip.\n```sh\npip install piiregex\n```\n\n\nTests are available through pytest.\n\n```sh\npip install -r dev_requirements.text\npytest -vv\n```\n\n\nUsage\n------\n\n```python    \n\u003e\u003e\u003e from piiregex import PiiRegex\n\u003e\u003e\u003e parsed_text = PiiRegex(\"\"\"John, please get that article on www.linkedin.com to me by 5:00PM \n                               on Jan 9th 2012. 4:00 would be ideal, actually. If you have any \n                               questions, You can reach me at (519)-236-2723x341 or get in touch with\n                               my associate at harold.smith@gmail.com\"\"\")\n\u003e\u003e\u003e parsed_text.times\n['5:00PM', '4:00']\n\u003e\u003e\u003e parsed_text.dates\n['Jan 9th 2012']\n\u003e\u003e\u003e parsed_text.phones\n['(519)-236-2727']\n\u003e\u003e\u003e parsed_text.phones_with_exts\n['(519)-236-2723x341']\n\u003e\u003e\u003e parsed_text.emails\n['harold.smith@gmail.com']\n```\n    \nAlternatively, you can generate a single PiiRegex instance and use it to parse multiple segments of text.\n\n```python\n\u003e\u003e\u003e parser = PiiRegex()\n\u003e\u003e\u003e parser.times(\"When are you free?  Do you want to meet up for coffee at 4:00?\")\n['4:00']\n```\n    \nFinally, all regular expressions used are publicly exposed. \n\n```python\n\u003e\u003e\u003e from piiregex import email\n\u003e\u003e\u003e import re\n\u003e\u003e\u003e text = \"...get in touch with my associate at harold.smith@gmail.com\"\n\u003e\u003e\u003e re.sub(email, \"anon@example.com\", text)\n'...get in touch with my associate at anon@example.com'\n```\n\n```python\n\u003e\u003e\u003e from piiregex import time\n\u003e\u003e\u003e for m in time.finditer(\"Does 6:00 or 7:00 work better?\"):\n\u003e\u003e\u003e     print(m.start(), m.group())\n5 6:00 \n13 7:00 \n```\n\nMost importantly (for our use case) any_match iterates through all regexes to\nmatch anything.\n\n```python\n\u003e\u003e\u003e from piiregex import PiiRegex\n\u003e\u003e\u003e parsed_text = PiiRegex(\"07123 123123\") # should match a UK phone number. \n\u003e\u003e\u003e parsed_text.any_match()\nTrue\n```\n\nPlease note that this module is currently English/US and UK specific.  Due to\nthe European nature of GDPR though this is being expanded.  PRs are welcome.\n\n\nSupported Methods/Attributes\n-----------------------------\n\n  - `obj.dates`, `obj.dates()`\n  - `obj.times`, `obj.times()`\n  - `obj.phones`, `obj.phones()`\n  - `obj.phones_with_exts`, `obj.phones_with_exts()`\n  - `obj.emails`, `obj.emails()`\n  - `obj.ips`, `obj.ips()`\n  - `obj.ipv6s`, `obj.ipv6s()`\n  - `obj.credit_cards`, `obj.credit_cards()`\n  - `obj.btc_addresses`, `obj.btc_addresses()`\n  - `obj.street_addresses`, `obj.street_addresses()`\n  - `obj.postcodes`, `obj.postcodes()`\n  - `obj.ukphones`, `obj.ukphones()`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoogles%2Fpiiregex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoogles%2Fpiiregex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoogles%2Fpiiregex/lists"}