{"id":21740877,"url":"https://github.com/whois-api-llc/flask-simple-geoip","last_synced_at":"2025-04-13T03:41:46.007Z","repository":{"id":57430732,"uuid":"135971504","full_name":"whois-api-llc/flask-simple-geoip","owner":"whois-api-llc","description":"The simplest GeoIP lookup library for Flask.","archived":false,"fork":false,"pushed_at":"2022-09-21T08:05:24.000Z","size":24,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-26T20:51:27.489Z","etag":null,"topics":["flask","geolocation","geolocation-api","ip-geolocation","python","whoisxmlapi"],"latest_commit_sha":null,"homepage":"https://ip-geolocation.whoisxmlapi.com/api","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/whois-api-llc.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2018-06-04T04:42:23.000Z","updated_at":"2023-06-23T10:33:08.000Z","dependencies_parsed_at":"2022-09-13T15:23:24.671Z","dependency_job_id":null,"html_url":"https://github.com/whois-api-llc/flask-simple-geoip","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/whois-api-llc%2Fflask-simple-geoip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whois-api-llc%2Fflask-simple-geoip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whois-api-llc%2Fflask-simple-geoip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whois-api-llc%2Fflask-simple-geoip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whois-api-llc","download_url":"https://codeload.github.com/whois-api-llc/flask-simple-geoip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248660922,"owners_count":21141369,"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":["flask","geolocation","geolocation-api","ip-geolocation","python","whoisxmlapi"],"created_at":"2024-11-26T06:15:45.207Z","updated_at":"2025-04-13T03:41:45.985Z","avatar_url":"https://github.com/whois-api-llc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"flask-simple-geoip\n==================\n\nThe simplest IP Geolocation lookup library for Flask.\n\n.. image:: https://raw.githubusercontent.com/whois-api-llc/flask-simple-geoip/master/images/geoip.png\n\n.. image:: https://img.shields.io/pypi/v/flask-simple-geoip.svg\n    :alt: flask-simple-geoip Release\n    :target: https://pypi.python.org/pypi/flask-simple-geoip\n\n.. image:: https://img.shields.io/travis/whois-api-llc/flask-simple-geoip.svg\n    :alt: flask-simple-geoip Build\n    :target: https://travis-ci.org/whois-api-llc/flask-simple-geoip\n\n\nMeta\n----\n- Author: Randall Degges\n- Email: r@rdegges.com\n- Twitter: https://twitter.com/rdegges\n- Site: http://www.rdegges.com\n- Status: production ready\n\n\nPrerequisites\n-------------\n\nTo use this library, you'll need to create a free IP Geolocation account:\nhttps://ip-geolocation.whoisxmlapi.com/api\n\nIf you haven't done this yet, please do so now; you will obtain an API\nkey that will be needed to use the library.\n\n\n\nInstallation\n------------\n\nTo install ``flask-simple-geoip`` using `pypi \u003chttps://pypi.org/\u003e`_, simply run:\n\n.. code-block:: console\n\n    $ pip install flask-simple-geoip\n\nIn the root of your project directory.\n\n\nUsage\n-----\n\nOnce you have `flask-simple-geoip` installed, you can use it to easily find the\nphysical location of a given IP address.\n\nThis library gives you access to all sorts of geographical location data that\nyou can use in your application in any number of ways.\n\nHere's a simple Flask app that makes use of the geolocation lookups:\n\n.. code-block:: python\n\n    from flask import Flask, jsonify\n    from flask_simple_geoip import SimpleGeoIP\n\n\n    app = Flask(__name__)\n\n    # The API key is obtained from the IP_GEOLOCATION_API_KEY environment variable.\n    # Alternatively it can be set as follows:\n    # app.config.update(IP_GEOLOCATION_API_KEY='YOUR_API_KEY')\n    \n    # Initialize the extension\n    simple_ip = SimpleGeoIP(app)\n\n\n    @app.route('/')\n    def test():\n        # Retrieve IP Geolocation data for the given requester\n        ip_data = simple_ip.get_geoip_data()\n\n        return jsonify(data=ip_data)\n\nHere's the sort of data you might get back when performing a IP Geolocation lookup\nrequest:\n\n.. code-block:: json\n\n    {\n      \"ip\": \"8.8.8.8\",\n      \"location\": {\n        \"country\": \"US\",\n        \"region\": \"California\",\n        \"city\": \"Mountain View\",\n        \"lat\": 37.40599,\n        \"lng\": -122.078514,\n        \"postalCode\": \"94043\",\n        \"timezone\": \"-08:00\"\n      }\n    }\n\nBy default, this library handles retrying failed HTTP requests for you. For\ninstance: if the IP Geolocation API service is currently down or having issues,\nyour request will be retried up to three consecutive times before failing.\n\nIn the event a IP Geolocation lookup still can't return successfully, the data returned\nwill be `None`. This library will *never* throw an exception. This decision was\nmade strategically: not having IP Geolocation data should never be the cause of a failed\nrequest. =)\n\n\nChangelog\n---------\n\nAll library changes in descending order.\n\nVersion 0.2.4\n*************\n\n**Released October 27, 2020.**\n\n- Described in the readme how to supply the API key.\n\n\nVersion 0.2.3\n*************\n\n**Released August 26, 2020.**\n\n- Fixed pypy support.\n\nVersion 0.2.2\n*************\n\n**Released August 24, 2020.**\n\n- Added X_FORWARDED_FOR headers support.\n\nVersion 0.1.1\n*************\n\n**Released June 18, 2018.**\n\n- Fixing readme so it shows properly on PyPI :(\n\n\nVersion 0.1.0\n*************\n\n**Released June 18, 2018.**\n\n- First release!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhois-api-llc%2Fflask-simple-geoip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhois-api-llc%2Fflask-simple-geoip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhois-api-llc%2Fflask-simple-geoip/lists"}