[Bug 910235] New: Review Request: python-pygeoip - Pure Python GeoIP API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Product: Fedora
https://bugzilla.redhat.com/show_bug.cgi?id=910235

            Bug ID: 910235
           Summary: Review Request: python-pygeoip - Pure Python GeoIP API
           Product: Fedora
           Version: rawhide
         Component: Package Review
          Severity: unspecified
          Priority: unspecified
          Reporter: rbean@xxxxxxxxxx


Spec URL: http://ralph.fedorapeople.org//python-pygeoip.spec
SRPM URL: http://ralph.fedorapeople.org//python-pygeoip-0.2.5-1.fc18.src.rpm

Description:
Pure Python GeoIP API based on MaxMind's C-based Python API
but the code itself is ported from the Pure PHP GeoIP API.

Create your GeoIP instance with appropriate access flag. `STANDARD` reads
data from disk when needed, `MEMORY_CACHE` loads database into memory on
instantiation and `MMAP_CACHE` loads database into memory using mmap.

    import pygeoip
    gi = pygeoip.GeoIP('/usr/share/geoip/GeoIP.dat', pygeoip.MEMORY_CACHE)

Country lookup

    >>> gi.country_code_by_name('google.com')
    'US'
    >>> gi.country_code_by_addr('64.233.161.99')
    'US'
    >>> gi.country_name_by_addr('64.233.161.99')
    'United States'

City lookup

    >>> gi = pygeoip.GeoIP('/usr/share/geoip/GeoLiteCity.dat')
    >>> gi.record_by_addr('64.233.161.99')
    {
        'city': 'Mountain View',
        'region_name': 'CA',
        'area_code': 650,
        'longitude': -122.0574,
        'country_code3': 'USA',
        'latitude': 37.419199999999989,
        'postal_code': '94043',
        'dma_code': 807,
        'country_code': 'US',
        'country_name': 'United States'
    }
    >>> gi.time_zone_by_addr('64.233.161.99')
    'America/Los_Angeles'

For more information, check out the full API documentation at
http://packages.python.org/pygeoip.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=UxQSgX67VO&a=cc_unsubscribe
_______________________________________________
package-review mailing list
package-review@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/package-review



[Index of Archives]     [Fedora Legacy]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]