{"id":15844976,"url":"https://github.com/samuelmeuli/anonymize-ip","last_synced_at":"2025-03-15T19:32:13.086Z","repository":{"id":57410488,"uuid":"146041912","full_name":"samuelmeuli/anonymize-ip","owner":"samuelmeuli","description":"👤 Python library for anonymizing IP addresses","archived":false,"fork":false,"pushed_at":"2019-11-08T19:58:57.000Z","size":21,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T04:08:55.848Z","etag":null,"topics":["anonymization","ip-address","privacy"],"latest_commit_sha":null,"homepage":"","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/samuelmeuli.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}},"created_at":"2018-08-24T21:33:22.000Z","updated_at":"2024-10-22T23:52:02.000Z","dependencies_parsed_at":"2022-08-28T01:14:05.291Z","dependency_job_id":null,"html_url":"https://github.com/samuelmeuli/anonymize-ip","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelmeuli%2Fanonymize-ip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelmeuli%2Fanonymize-ip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelmeuli%2Fanonymize-ip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelmeuli%2Fanonymize-ip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samuelmeuli","download_url":"https://codeload.github.com/samuelmeuli/anonymize-ip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243781696,"owners_count":20347130,"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":["anonymization","ip-address","privacy"],"created_at":"2024-10-05T17:41:30.554Z","updated_at":"2025-03-15T19:32:12.750Z","avatar_url":"https://github.com/samuelmeuli.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# anonymize_ip\n\nThis is a simple Python library for anonymizing IP addresses. Both IPv4 and IPv6 addresses are supported.\n\nExamples:\n\n* IPv4: `95.239.169.11` → `95.239.169.0`\n* IPv6: `5219:3a94:fdc5:19e1:70a3:b2c4:40ef:ae03` → `5219:3a94:fdc5:19e1::`\n\n\n## Usage\n\n```\npip install anonymizeip\n```\n\n```py\nfrom anonymizeip import anonymize_ip\n\naddress = \"fe80::0202:b3ff:fe1e:8329\"\nanonymized = anonymize_ip(address)\nprint(anonymized)\n\n# Prints \"fe80::\"\n```\n\n\n## Settings\n\nThe number of address blocks that are set to 0 can be customized.\n\nBesides the IP address, the function `anonymize_ip` takes two optional parameters:\n\n```py\nanonymize_ip(\n  address,\n  ipv4_mask=\"...\",\n  ipv6_mask=\"...\"\n)\n```\n\n* `ipv4_mask`: Defaults to `255.255.255.0`, i.e. the last octet will be anonymized (set to 0)\n* `ipv6_mask`: Defaults to `ffff:ffff:ffff:ffff::` (same as `ffff:ffff:ffff:ffff:0:0:0:0`), i.e. the last four blocks will be anonymized (set to 0)\n\n\n## Development\n\n1. `git clone`\n2. `pipenv install --dev`\n3. Make your code modifications\n4. `pipenv run test`\n5. `pipenv run lint`\n\nContributions are always welcome. Please first discuss changes via issue before submitting a pull request.\n\n\n## Credits\n\nThe implementation of this library was strongly inspired by [php-ip-anonymizer](https://github.com/geertw/php-ip-anonymizer) by Geert Wirken.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelmeuli%2Fanonymize-ip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamuelmeuli%2Fanonymize-ip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelmeuli%2Fanonymize-ip/lists"}