{"id":18162876,"url":"https://github.com/hidekuno/cidr-lite","last_synced_at":"2026-05-02T11:32:34.376Z","repository":{"id":49881796,"uuid":"215899997","full_name":"hidekuno/cidr-lite","owner":"hidekuno","description":"country search from IP address","archived":false,"fork":false,"pushed_at":"2024-11-02T09:05:17.000Z","size":84,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T09:39:01.331Z","etag":null,"topics":["docker","fastapi","mysql","python3","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hidekuno.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-10-17T23:01:10.000Z","updated_at":"2024-11-02T09:05:18.000Z","dependencies_parsed_at":"2024-02-22T04:24:45.551Z","dependency_job_id":"8851b9c3-6dd4-42b0-ba70-2f9bfa3f4d08","html_url":"https://github.com/hidekuno/cidr-lite","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidekuno%2Fcidr-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidekuno%2Fcidr-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidekuno%2Fcidr-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidekuno%2Fcidr-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hidekuno","download_url":"https://codeload.github.com/hidekuno/cidr-lite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247596705,"owners_count":20964161,"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":["docker","fastapi","mysql","python3","sqlite3"],"created_at":"2024-11-02T10:05:28.651Z","updated_at":"2026-05-02T11:32:34.353Z","avatar_url":"https://github.com/hidekuno.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"IP address search tool\n=================\n\n## Overview\n- Search the CIDR format network address and country code from the IPv4 address.\n\n## Build\n### Requirement\n- account of maxmind.com(https://www.maxmind.com/en/account/login)\n- python3 installed.\n- sqlite3 installed.\n\n```\ncd ${HOME}\ngit clone https://github.com/hidekuno/cidr-lite\ncd cidr-lite\npython3 cidr_create_geoip.py --token ${your_token}\nsqlite3 database.cidr '.read init.sql'\nsqlite3 database.cidr '.read city.sql'\n```\n\n## Test\n```\npython3 tests/test_cidr_search.py\n```\n\n## Run\n```\npython3 cidr_search.py\n```\n- type IP address\n\n![image](https://user-images.githubusercontent.com/22115777/200112280-da0396b6-d4ce-409e-af2d-d014faf19ab2.png)\n\n## Run on docker\n### Requirement\n- account of maxmind.com(https://www.maxmind.com/en/account/login)\n- docker is running.\n\n```\ncd ${HOME}\ngit clone https://github.com/hidekuno/cidr-lite\ncd cidr-lite/cli/docker\ndocker build -t ${yourid}/cidr-lite --file=Dockerfile --build-arg token=${YOUR_TOKEN_ID} .\ndocker run -it --name cidr-lite ${yourid}/cidr-lite python3 /root/cidr_search.py\n```\n\n## fastapi\n### Requirement\n- fastapi installed.\n- uvicorn installed.\n- databases installed.\n- aiosqlite installed.\n- SQLAlchemy installed.\n- pydantic installed.\n\n### Run\n```\ncd ${HOME}/cidr_lite\npip3 install \"fastapi[all]\"\npip3 install databases\npip3 install aiosqlite\n\npython3 -m uvicorn cidr_api:app --reload\n```\n\n### search country,ASN,city\n```\ncurl -v http://localhost:8000/search?ipv4=23.218.95.131\n```\n\n## fastapi with MySQL\n### Requirement\n- docker installed\n- fastapi(0.111.0) installed.\n- SQLAlchemy installed.\n- mysql-connector-python installed.\n\n### Build\n```\ndocker-compose up -d\n```\n\n### Test\n```\npytest -v tests/test_cidr_api2.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhidekuno%2Fcidr-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhidekuno%2Fcidr-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhidekuno%2Fcidr-lite/lists"}