{"id":28512209,"url":"https://github.com/danielcba/geolocation_to_csv_kml","last_synced_at":"2026-05-18T14:02:12.057Z","repository":{"id":270047156,"uuid":"876917886","full_name":"danielcba/geolocation_to_csv_kml","owner":"danielcba","description":"This Python script performs IP geolocation using the ipinfo service and exports the results to a CSV file and a KML file. The KML file can be opened in software such as Google Earth to visualize the geographical locations of the IP addresses.","archived":false,"fork":false,"pushed_at":"2025-05-05T16:35:36.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-29T09:39:49.419Z","etag":null,"topics":["csv","ipinfo","kml","pandas","pandas-dataframe","simple-kml"],"latest_commit_sha":null,"homepage":"https://ipinfo.io","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/danielcba.png","metadata":{"files":{"readme":"README-EN.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,"zenodo":null}},"created_at":"2024-10-22T19:11:11.000Z","updated_at":"2025-05-05T16:35:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f03ae54-8fa2-4e43-949e-409348943fa8","html_url":"https://github.com/danielcba/geolocation_to_csv_kml","commit_stats":null,"previous_names":["danielcba/geolocation-to-csv-kml","danielcba/geolocation_to_csv_kml"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danielcba/geolocation_to_csv_kml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielcba%2Fgeolocation_to_csv_kml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielcba%2Fgeolocation_to_csv_kml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielcba%2Fgeolocation_to_csv_kml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielcba%2Fgeolocation_to_csv_kml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielcba","download_url":"https://codeload.github.com/danielcba/geolocation_to_csv_kml/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielcba%2Fgeolocation_to_csv_kml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33180310,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["csv","ipinfo","kml","pandas","pandas-dataframe","simple-kml"],"created_at":"2025-06-09T00:31:05.499Z","updated_at":"2026-05-18T14:02:11.774Z","avatar_url":"https://github.com/danielcba.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IP Geolocation with ipinfo and KML Export\n\nThis Python script performs IP geolocation using the `ipinfo` service and exports the results to a CSV file and a KML file. The KML file can be opened in software such as Google Earth to visualize the geographical locations of the IP addresses.\n\n## Features\n\n- Uses the `ipinfo` API to retrieve geolocation information (city, region, country, latitude, longitude, ASN, and IP address) for a list of IP addresses.\n- The results are saved into a CSV file for easy analysis.\n- The geolocation points are also saved into a KML file for visualization in mapping tools like Google Earth.\n- Handles multiple IP addresses from a CSV input file.\n\n## Requirements\n\nBefore running the script, ensure you have the following Python packages installed:\n\n- `pandas`\n- `ipinfo`\n- `simplekml`\n\nYou can install these packages using pip:\n\n```bash\npip install pandas ipinfo simplekml\n```\n\n## Files\n\n- `geo.csv`: The input CSV file containing a list of IP addresses to be geolocated. It should have a column named `direcciones` where each row contains one IP address.\n- `ipinfo_resultados.csv`: The output CSV file with the geolocation results, including city, region, country, latitude, longitude, ASN, and IP address.\n- `resultados.kml`: The output KML file that contains the geographical points for each IP address, which can be opened with Google Earth or other mapping software.\n\n## How to Use\n\n1. **Prepare the Input File**:\n   - Create a CSV file named `geo.csv` with a column titled `direcciones` that contains the IP addresses you want to geolocate.\n\n   Example `geo.csv` file:\n   ```csv\n   direcciones\n   8.8.8.8\n   1.1.1.1\n   ```\n\n2. **Run the Script**:\n   - Replace the placeholder `access_token` in the script with your `ipinfo` access token. If you don't have one, you can obtain it by creating an account on [ipinfo.io](https://ipinfo.io/).\n   - Execute the Python script:\n   ```bash\n   python geolocation_to_csv_kml.py\n   ```\n\n3. **Outputs**:\n   - After running the script, you'll get two files:\n     - `ipinfo_resultados.csv`: This file will contain the geolocation information (city, region, country, latitude, longitude, ASN, and IP address) for each IP address.\n     - `resultados.kml`: This KML file can be loaded into Google Earth to visualize the locations of the IP addresses.\n\n## Example Output\n\nThe resulting CSV file (`ipinfo_resultados.csv`) will look like:\n\n```csv\nCiudad,Región,País,Latitud,Longitud,ASN,Direccion_ip\nMountain View,California,US,37.386,-122.084,AS15169 Google LLC,8.8.8.8\nSydney,New South Wales,AU,-33.494,151.051,AS13335 Cloudflare Inc,1.1.1.1\n```\n\nThe KML file (`resultados.kml`) will include placemarks for each IP's geographical location, viewable in Google Earth.\n\n## Notes\n\n- The `ipinfo` API has rate limits depending on the type of account you have (free or paid). Make sure to check these limits before running the script on a large list of IP addresses (for free accounts the limit is 50,000 IPs per month).\n- If an IP address cannot be geolocated, the script will still continue processing the other addresses.\n\n## License\n\nThis project is open-source and available under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielcba%2Fgeolocation_to_csv_kml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielcba%2Fgeolocation_to_csv_kml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielcba%2Fgeolocation_to_csv_kml/lists"}