GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ishiland/python-geoclient: Python wrapper for NYC's Geoclient REST API

BranchesTags
Open more actions menu

Latest commit

 

History

20 Commits
20 Commits

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
geoclient
geoclient
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE.txt
LICENSE.txt
 
 
MANIFEST.in
MANIFEST.in
 
 
README.md
README.md
 
 
requirements.txt
requirements.txt
 
 
setup.py
setup.py
 
 

Repository files navigation

Python-Geoclient

Call the RESTful NYC Geoclient API using python.

Python 2.7 | 3.4+ Build Status PyPI version

Introduction

This library provides a Python interface for using the NYC Geoclient API. It is an updated and maintained fork of nyc_geoclient.

In order to use the library, you must first register an application with the NYC Developer Portal to obtain an application key and ID.

Installing

you can install python-geoclient using:

$ pip install python-geoclient

or you can clone this directory and:

$ python setup.py install

Quickstart

Once your app has been registered with DoITT, using the API is simple:

from geoclient import Geoclient
g = Geoclient('my app ID', 'my app key')

You can use any of the available methods documented in the API:

g.address(100, 'Gold st', 'MN')

{u'uspsPreferredCityName': u'NEW YORK',
 u'fireCompanyType': u'E',
 u'fromLionNodeId': u'0015445',
 u'cooperativeIdNumber': u'0000',
 u'dotStreetLightContractorArea': u'1',
 u'lionBoroughCodeForVanityAddress': u'1',
 u'zipCode': u'10038',
 u'fireCompanyNumber': u'006',
 u'communityDistrict': u'101',
 u'firstStreetNameNormalized': u'GOLD STREET',
 u'boroughCode1In': u'1',
 u'latitude': 40.71035225065372,
 u'longitude': -74.00400739046181,
 ...
 }

Geocoding Errors

python-geoclient will raise a GeoclientError when the Geoclient API returns an error code. Sometimes there is more information returned, in which case the exception will have a result dictionary.

from geoclient import GeoclientError
try:
    g.address(125, 'wort st', 1)
except GeoclientError as e:
    print(e) # 'WORT STREET' NOT RECOGNIZED. THERE ARE 010 SIMILAR NAMES.
    print(e.result['streetName1']) # WORTH SQUARE

Documentation

The Python Geoclient documentation details using the library.

The API closely follows the DoITT documentation (requires account/login).

Running Tests

python setup.py test

Contributing

If you see an issue or would like to contribute, pull requests are welcome.

License

BSD.

About

Python wrapper for NYC's Geoclient REST API

Topics

geoclientgeocodergeocodingnycnyc-geoclientpython-geoclient

Resources

Readme
License
Activity

Stars

3 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.