Skip to main content

OMGeo - Python Edition

python-omgeo is a geocoding abstraction layer written in python. Currently supported geocoders:

Installation:

sudo pip install python-omgeo

Documentation

Docs are available in HTML or PDF format.

Usage Example

Make a new geocoder and geocode and address:

>>> from omgeo import Geocoder
>>> g = Geocoder()
>>> result = g.geocode('340 12th St, Philadelphia PA')

Take a look at the result:

>>> result
{'candidates': [
  <340 S 12th St, Philadelphia, PA, 19107 (-75.161461, 39.94532) EsriWGS>,
  <340 N 12th St, Philadelphia, PA, 19107 (-75.158434, 39.958728) EsriWGS>
 ],
 'upstream_response_info': [<EsriWGS 1054ms>]}

Take a closer look at the information in our address Candidate objects:

>>> [c.__dict__ for c in result["candidates"]]
    [{'geoservice': 'EsriWGS',
      'locator': u'USA.AddressPoint',
      'locator_type': u'PointAddress',
      'match_addr': u'340 S 12th St, Philadelphia, PA, 19107',
      'score': 90.87,
      'wkid': 4326,
      'x': -75.161461,
      'y': 39.94532},
     {'geoservice': 'EsriWGS',
      'locator': 'interpolation',
      'locator_type': u'StreetAddress',
      'match_addr': u'340 N 12th St, Philadelphia, PA, 19107',
      'score': 90.87,
      'wkid': 4326,
      'x': -75.158434,
      'y': 39.958728}]

Some geocoders (EsriWGS and US Census) can return address components in addition to the full address:

>>> [{'geoservice': 'EsriWGS',
    'locator': 'interpolation',
    'locator_type': u'StreetAddress',
    'match_addr': u'340 N 12th St, Phila, Pennsylvania, 19107',
    'match_city': u'Phila',
    'match_country': u'USA',
    'match_postal': u'19107',
    'match_region': u'Pennsylvania',
    'match_streetaddr': u'340 N 12th St',
    'match_subregion': u'',
    'score': 90.1,
    'wkid': 4326,
    'x': -75.158384,
    'y': 39.958774}]

These are optional; their existence may change depending on the response from the geocoder.

Testing

There is a shell script in the root of the repository called test.dummy.sh. Copy it using cp test.dummy.sh test.sh. Edit test.sh to include the API keys that you obtained from the given geocoding service providers. Then, run the tests using ./test.sh.

Release files for python-omgeo 6.2.2

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

Source distribution (sdist)

Source distribution for python-omgeo 6.2.2
File Size Uploaded
python_omgeo-6.2.2.tar.gz 37.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-omgeo 6.2.2
File Interpreter ABI Platform
python_omgeo-6.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 78.8 kB

Release files / python_omgeo-6.2.2.tar.gz

Download URL python_omgeo-6.2.2.tar.gz
Size 37.9 kB
Tags Source
SHA-256 checksum
How to use checksums
534771c50dca56a9eb5d1865846d62829022789a096a683935ff6ef0d96044af
BLAKE2b-256 checksum
How to use checksums
6761d0cd7e019a66176c45c6a25874666359fdca0924aae364790c98c28754cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / python_omgeo-6.2.2-py3-none-any.whl

Download URL python_omgeo-6.2.2-py3-none-any.whl
Size 40.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ade831111b12ac7c865b6510d895ac0c3c384abfed705b5727db357c7879d22
BLAKE2b-256 checksum
How to use checksums
21b828c90f066f6d2e32d2b3be06aff212a3633a53e2810d8f00200590b0157a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

6.2.2 This release

2 release files

6.1.0

2 release files

6.0.4

2 release files

6.0.3

1 release file

6.0.2

1 release file

6.0.1

1 release file

6.0.0

1 release file

5.1.0

1 release file

5.0.0

1 release file

4.1.0

1 release file

4.0.0

1 release file

3.0.0

1 release file

2.0.1

1 release file

2.0.0

2 release files

1.9.3

1 release file

1.9.2

1 release file

1.9.1

1 release file

1.9.0

1 release file

1.7.2

1 release file

1.7.1

1 release file

1.7.0

1 release file

1.6.0

1 release file

1.5.5

1 release file

1.5.4

1 release file

1.5.3

1 release file

1.5.2

1 release file

1.5.1

1 release file

1.5.0

1 release file

1.4.4

1 release file

1.4.3

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.7

1 release file

1.3.6

1 release file

1.3.5

1 release file

1.3.4

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

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