Skip to main content
GeoIp info for your visitors
============================

This simple plugin connects to the `infoip <https://www.infoip.io>`__
API and retrieves the geoip information for the current request/visitor.
It works based on view decorators and not middleware to prevent slowing
down your application with unnecessary data.

The plugin uses an external API which is battle-tested and
enterprise-ready to satisfy any number of requests. Our database is
refreshed every single day in order to respond with up-to-date
information. The API offers ``1000`` free requests every day with a
rate-limiter set at ``1rps`` (one request per second). If you find that
to be too restrictive please consider subscribing to a `premium
plan <https://www.infoip.io/pricing>`__

Supported frameworks
~~~~~~~~~~~~~~~~~~~~

1. Django

Quick start Django
------------------

1. Install the package from pip

``pip install infoip``

2. Import the view decorator and use it to decorate the view where you
need geoip info

.. code:: python

# django test view that simply prints the geoip data regarding the visitor

from infoip.django import infoip
from django.http import JsonResponse

@infoip
def index(request):
# will respond to the request with user info
# you can also use the geoip data in your views for custom processing:
# - request.infoip.country_long
# - request.infoip.country_short
# - ...
return JsonResponse(request.infoip)

3. Tweak the settings

1. (optional) Add your api key to your settings if you are a premium
subscriber of `infoip <https://www.infoip.io>`__

.. code:: python

INFOIP_API_KEY = "your-api-key"

2. (optional) Use ``https`` for communicating with our API (it uses
``http`` by default)

.. code:: python

INFOIP_USE_HTTPS = True

You want to help and contribute? Perfect!
=========================================

These are some contribution examples
------------------------------------

- Reporting issues to the bugtracker.

- Submitting pull requests from a forked infoip repo.

- Extending the documentation.


For pull requests, keep this in mind
------------------------------------

- Add a test which proves your fix and make it pass.

- Describe your change in CHANGES.rst

- Add yourself to the docs/credits.rst





Metadata

Release files for infoip 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for infoip 0.1.8
File Size Uploaded Provenance Actions
infoip-0.1.8.tar.gz 3.5 kB Without provenance Details for infoip-0.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for infoip 0.1.8
File Interpreter ABI Platform Actions
infoip-0.1.8-py2-none-any.whl Python 2 none any Details for infoip-0.1.8-py2-none-any.whl

Total release size: 10.0 kB

Release files / infoip-0.1.8.tar.gz

Download URL infoip-0.1.8.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9cafcf60db11c73735c6548e86963b1d85894ff72b2c8551c085db8f5eb29b25
BLAKE2b-256 checksum
How to use checksums
46f6773cbab73efa49241484cb751741b76abb0fa23d06df13b3ab5bf526ca04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / infoip-0.1.8-py2-none-any.whl

Download URL infoip-0.1.8-py2-none-any.whl
Size 6.5 kB
Tags Python 2
SHA-256 checksum
How to use checksums
7da5f2e42d77346e80e313936b8c6c6d89524f958c80986604a7393f06f64907
BLAKE2b-256 checksum
How to use checksums
7ed4cc34f5af010ace02dfc29dfb9a398afb9876c4e78de96b591e7177649d64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for infoip 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page