Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

API to access data from Sypex Geo IP database files from your Python code

Project Description

.. image::

.. image::

What's that

*pysyge is an API to access data from Sypex Geo IP database files from your Python code.*

For more information about Sypex Geo databases and their features please visit

Direct DB links that might became broken over time:

* Sypex Geo City DB -

* Sypex Geo City Max DB -


Python 2.7+, 3.2+


1. This version of pysyge works with **Sypex Geo DB version 2.2 or above**.

The structure of a dictionary returned by GeoLocator.get_location() was preserved in a backward compatible manner
as much as possible, yet it's advised to update your code to use data from `info` sub dictionary.

2. This version of pysyge works with **UTF-8** Sypex Geo Databases. Texts returned by pysyge are **UTF-8**.


Download Geo IP database file from (example below uses `SxGeoCityMax.dat` file).

Application sample::

# Import all we need from pysyge module.
from pysyge.pysyge import GeoLocator, MODE_BATCH, MODE_MEMORY

# Create GeoLocator object to access API from 'SxGeoCityMax.dat' using fast memory mode.
geodata = GeoLocator('SxGeoCityMax.dat', MODE_BATCH | MODE_MEMORY)

# Let's get some meta information.
print('DB version %s (%s)' % (geodata.get_db_version(), geodata.get_db_date()))

# Request geo information for IP address. Getting detailed information, including region info.
location = geodata.get_location('', detailed=True)

# Print out some lyrics. Most interesting data is under `info` in `city`, `country` and `region` dictionaries
print('%s (%s) calling. All the circuits are busy.' % (location['info]['city']['name_en'], location['info']['country']['iso']))
Release History

Release History

This version
History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pysyge-0.2.0.tar.gz (8.2 kB) Copy SHA256 Checksum SHA256 Source Jun 21, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting