{"id":47444099,"url":"https://github.com/JuliaWeb/GeoIP.jl","last_synced_at":"2026-04-06T13:00:57.365Z","repository":{"id":52196873,"uuid":"10908703","full_name":"JuliaWeb/GeoIP.jl","owner":"JuliaWeb","description":"A Julia package to estimate the geographic location of IP addresses","archived":false,"fork":false,"pushed_at":"2021-05-05T18:22:36.000Z","size":2725,"stargazers_count":25,"open_issues_count":3,"forks_count":12,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-03-10T18:10:06.961Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JuliaWeb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-24T13:19:45.000Z","updated_at":"2023-11-24T03:00:42.000Z","dependencies_parsed_at":"2022-09-06T05:40:26.505Z","dependency_job_id":null,"html_url":"https://github.com/JuliaWeb/GeoIP.jl","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/JuliaWeb/GeoIP.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaWeb%2FGeoIP.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaWeb%2FGeoIP.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaWeb%2FGeoIP.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaWeb%2FGeoIP.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuliaWeb","download_url":"https://codeload.github.com/JuliaWeb/GeoIP.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaWeb%2FGeoIP.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31473271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T08:36:52.050Z","status":"ssl_error","status_checked_at":"2026-04-06T08:36:51.267Z","response_time":112,"last_error":"SSL_read: 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":[],"created_at":"2026-03-23T06:00:59.902Z","updated_at":"2026-04-06T13:00:57.332Z","avatar_url":"https://github.com/JuliaWeb.png","language":"Julia","funding_links":[],"categories":["Network Security"],"sub_categories":["GeoIP and DNS"],"readme":"# GeoIP\n\nIP Geolocalization using the [Geolite2](https://dev.maxmind.com/geoip/geoip2/geolite2/) Database\n\n|                                                                                                **Documentation**                                                                                                |                                                                                                                                        **Build Status**                                                                                                                                        |\n|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|\n|   [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaWeb.github.io/GeoIP.jl/stable)[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaWeb.github.io/GeoIP.jl/dev)   |                       [![Build](https://github.com/JuliaWeb/GeoIP.jl/workflows/CI/badge.svg)](https://github.com/JuliaWeb/GeoIP.jl/actions)[![Coverage](https://codecov.io/gh/JuliaWeb/GeoIP.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaWeb/GeoIP.jl)                       |\n\n# Installation\n\nThe package is registered in the [General](https://github.com/JuliaRegistries/General) registry and so can be installed at the REPL with\n\n```julia\njulia\u003e using Pkg\njulia\u003e Pkg.add(\"GeoIP\")\n```\n\n# Usage\n\n## Data files\n\nYou can use [MaxMind geolite2](https://dev.maxmind.com/geoip/geoip2/geolite2/) csv files downloaded from the site. Due to the [MaxMind policy](https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/), `GeoLite.jl` does not distribute `GeoLite2` files and does not provide download utilities. For automated download it is recommended to use [MaxMind GeoIP Update](https://dev.maxmind.com/geoip/geoipupdate/) program. For proper functioning of `GeoIP.jl` you need to download `GeoLite2 City` datafile, usually it should have a name like `GeoLite2-City-CSV_20191224.zip`. \n\nFiles processing and loading provided with `load()` call. Directory where data is located should be located either in `ENV[\"GEOIP_DATADIR\"]` or it can be passed as an argument to `load` function. Zip file location can be passed as an argument or it can be stored in `ENV[\"GEOIP_ZIPFILE\"]`. For example\n\n```julia\nusing GeoIP\n\ngeodata = load(zipfile = \"GeoLite2-City-CSV_20191224.zip\", datadir = \"/data\")\n```\n\nIf `ENV[\"GEOIP_DATADIR\"]` is set to `\"/data\"` and `ENV[\"GEOIP_ZIPFILE\"]` is set to `\"GeoLite2-City-CSV_20191224.zip\"` then it is equivalent to\n```julia\nusing GeoIP\n\ngeodata = load()\n```\n\n## Example\n\nYou can get the ip data with the `geolocate` function or by using `[]`\n\n```julia\nusing GeoIP\n\ngeodata = load(zipfile = \"GeoLite2-City-CSV_20191224.zip\")\ngeolocate(geodata, ip\"1.2.3.4\")        # returns dictionary with all relevant information\n\n# Equivalent to\ngeodata[ip\"1.2.3.4\"]\n\n# Equivalent, but slower version\ngeodata[\"1.2.3.4\"]\n```\n\n`geolocate` form is useful for broadcasting\n\n```julia\ngeolocate.(geodata, [ip\"1.2.3.4\", ip\"8.8.8.8\"])  # returns vector of geo data.\n```\n\n## Localization\n\nIt is possible to use localized version of geo files. To load localized data, one can use `locales` argument of the `load` function. To switch between different locales is possible with the help of `setlocale` function.\n\n```julia\nusing GeoIP\n\ngeodata = load(zipfile = \"GeoLite2-City-CSV_20191224.zip\", locales = [:en, :fr])\n\ngeodata[ip\"201.186.185.1\"]\n# Dict{String, Any} with 21 entries:\n#   \"time_zone\"                     =\u003e \"America/Santiago\"\n#   \"subdivision_2_name\"            =\u003e missing\n#   \"accuracy_radius\"               =\u003e 100\n#   \"geoname_id\"                    =\u003e 3874960\n#   \"continent_code\"                =\u003e \"SA\"\n#   \"postal_code\"                   =\u003e missing\n#   \"continent_name\"                =\u003e \"South America\"\n#   \"locale_code\"                   =\u003e \"en\"\n#   \"subdivision_2_iso_code\"        =\u003e missing\n#   \"location\"                      =\u003e Location(-72.9436, -41.4709, 0.0, \"WGS84\")\n#   \"v4net\"                         =\u003e IPv4Net(\"201.186.185.0/24\")\n#   \"subdivision_1_name\"            =\u003e \"Los Lagos Region\"\n#   \"subdivision_1_iso_code\"        =\u003e \"LL\"\n#   \"city_name\"                     =\u003e \"Port Montt\"\n#   \"metro_code\"                    =\u003e missing\n#   \"registered_country_geoname_id\" =\u003e 3895114\n#   \"is_in_european_union\"          =\u003e 0\n#   \"is_satellite_provider\"         =\u003e 0\n#   \"is_anonymous_proxy\"            =\u003e 0\n#   \"country_name\"                  =\u003e \"Chile\"\n#   \"country_iso_code\"              =\u003e \"CL\"\n\ngeodata_fr = setlocale(geodata, :fr)\ngeodata_fr[ip\"201.186.185.1\"]\n# Dict{String, Any} with 21 entries:\n#   \"time_zone\"                     =\u003e \"America/Santiago\"\n#   \"subdivision_2_name\"            =\u003e missing\n#   \"accuracy_radius\"               =\u003e 100\n#   \"geoname_id\"                    =\u003e 3874960\n#   \"continent_code\"                =\u003e \"SA\"\n#   \"postal_code\"                   =\u003e missing\n#   \"continent_name\"                =\u003e \"Amérique du Sud\"\n#   \"locale_code\"                   =\u003e \"fr\"\n#   \"subdivision_2_iso_code\"        =\u003e missing\n#   \"location\"                      =\u003e Location(-72.9436, -41.4709, 0.0, \"WGS84\")\n#   \"v4net\"                         =\u003e IPv4Net(\"201.186.185.0/24\")\n#   \"subdivision_1_name\"            =\u003e missing\n#   \"subdivision_1_iso_code\"        =\u003e \"LL\"\n#   \"city_name\"                     =\u003e \"Puerto Montt\"\n#   \"metro_code\"                    =\u003e missing\n#   \"registered_country_geoname_id\" =\u003e 3895114\n#   \"is_in_european_union\"          =\u003e 0\n#   \"is_satellite_provider\"         =\u003e 0\n#   \"is_anonymous_proxy\"            =\u003e 0\n#   \"country_name\"                  =\u003e \"Chili\"\n#   \"country_iso_code\"              =\u003e \"CL\"\n```\n\nDuring `load` procedure, it is possible to use either `Symbol` notation, i.e. `locales = [:en, :fr]` or one can pass `Vector` of `Pair`, where first argument is the locale name and second argument is a regular expression, which defines the name of the CSV file, which contains necessary localization. For example `locales = [:en =\u003e r\"Locations-en.csv%\", :fr =\u003e r\"Locations-fr.csv\"]`. By default, following locales are supported `:en, :de, :ru, :ja, :es, :fr, :pt_br, :zh_cn`.\n\nDefault locale, which is used in `getlocale` response can be set with the help of `deflocale` argument of the `load` function. For example, to get `:fr` locale by default\n\n```julia\ngeodata = load(zipfile = \"GeoLite2-City-CSV_20191224.zip\", locales = [:en, :fr], deflocale = :fr)\n```\n\n# Acknowledgements\nThis product uses, but not include, GeoLite2 data created by MaxMind, available from\n[http://www.maxmind.com](http://www.maxmind.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJuliaWeb%2FGeoIP.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJuliaWeb%2FGeoIP.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJuliaWeb%2FGeoIP.jl/lists"}