{"id":19819082,"url":"https://github.com/dmitriiweb/ip-country","last_synced_at":"2025-02-28T15:31:33.397Z","repository":{"id":62571502,"uuid":"202861902","full_name":"dmitriiweb/ip-country","owner":"dmitriiweb","description":"An offline tool to get country by IP","archived":false,"fork":false,"pushed_at":"2025-01-31T15:19:51.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T16:33:50.532Z","etag":null,"topics":["ip","ipv4","python"],"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/dmitriiweb.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":"2019-08-17T09:36:44.000Z","updated_at":"2025-01-31T15:19:56.000Z","dependencies_parsed_at":"2022-11-03T18:26:27.470Z","dependency_job_id":null,"html_url":"https://github.com/dmitriiweb/ip-country","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/dmitriiweb%2Fip-country","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmitriiweb%2Fip-country/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmitriiweb%2Fip-country/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmitriiweb%2Fip-country/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmitriiweb","download_url":"https://codeload.github.com/dmitriiweb/ip-country/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241175298,"owners_count":19922478,"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":["ip","ipv4","python"],"created_at":"2024-11-12T10:17:45.593Z","updated_at":"2025-02-28T15:31:33.358Z","avatar_url":"https://github.com/dmitriiweb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ip-country\nAn offline tool to get country by IP\n\n\n## Requirements\n- Python \u003e= 3.6\n- IP2Location™ LITE IP-COUNTRY-REGION-CITY Database\n\n## Installation\n\n1. Download IP2Location database for IPv4 from [https://lite.ip2location.com/database/ip-country-region-city](here)\n\n2. Install library:\n\n   ```\n   pip install ip_country\n   ```\n\n   \n\n## Usage\n\n```\n\u003e\u003e\u003e from pprint import pprint\n\u003e\u003e\u003e from ip_country import IPCountry\n\u003e\u003e\u003e ip = IPCountry('/path/to/ipdb.csv')\n\u003e\u003e\u003e ip_data = ip.get_ip_data('13.73.96.0')\n\u003e\u003e\u003e pprint(ip_data)\n{'city_name': 'Melbourne',\n 'country_code': 'AU',\n 'country_name': 'Australia',\n 'error': None,\n 'ip': '13.73.96.0',\n 'region_name': 'Victoria'}\n\n\u003e\u003e\u003e ip_data = ip.get_ip_data('blah.73.96.0')\n\u003e\u003e\u003e pprint(ip_data)\n{'error': \"Only decimal digits permitted in 'blah' in 'blah.73.96.0'\",\n 'ip': 'blah.73.96.0'}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitriiweb%2Fip-country","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmitriiweb%2Fip-country","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitriiweb%2Fip-country/lists"}