Skip to main content

pysyge

http://github.com/idlesign/pysyge

release lic coverage

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 http://sypexgeo.net.

Direct DB link that might became broken over time:

Requirements

  • Python 3.6+

Attention

  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.

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

Quickstart

Download Geo IP database file from http://sypexgeo.net/ (example below uses SxGeoCityMax.dat file).

Application sample

# Import all we need from pysyge module.
from 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 77.88.21.3 IP address.
# Getting detailed information, including region info.
location = geodata.get_location('77.88.21.3', 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']))

Metadata

Release files for pysyge 1.2.1

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

Source distribution (sdist)

Source distribution for pysyge 1.2.1
File Size Uploaded Provenance Actions
pysyge-1.2.1.tar.gz 23.5 MB Without provenance Details for pysyge-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pysyge 1.2.1
File Interpreter ABI Platform Actions
pysyge-1.2.1-py3-none-any.whl Python 3 none any Details for pysyge-1.2.1-py3-none-any.whl

Total release size: 23.5 MB

Release files / pysyge-1.2.1.tar.gz

Download URL pysyge-1.2.1.tar.gz
Size 23.5 MB
Tags Source
SHA-256 checksum
How to use checksums
3f35a5f92dc1136c15543076bdc1305f3314f237d5f9b780c26d788d5cb83f89
BLAKE2b-256 checksum
How to use checksums
2f38bb54dd298e11bdfadafce4d5cb1f82e72df91283d1ad7b7ee37759d66308
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / pysyge-1.2.1-py3-none-any.whl

Download URL pysyge-1.2.1-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3254ad2171aaad5417ba7d71d843923a1d32671af35dc9fd973cdb41b2d50f5a
BLAKE2b-256 checksum
How to use checksums
e7a3dbfe36ee212574b730d8c5b3b22b012b66bcf1a46063984ac08b91b91619
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Security for pysyge 1.2.1

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