Package: places-geocode
Places API Geocoding!There are a many geocoding APIs out there to choose from. However,Places APItops them
all with the most accurate, affordable, and effective solution!Our package focuses on a pythonic and accessible way to geocode POIs (Places of Interest) in Python.SUPPORTWe have multiple support channels that you can contact us on:SlackNOTEPlacesis a commercial product created for the purpose of geocoding with simplicity and speed. Authorization
API tokens are necessary for using the API endpoints. Registering such API tokens is possible through
ourwebsitesubscription page.→ Check out our officialdocumentation!QUICK STARTThe places module:Theplaces(token: str)module allows you to register your access tokens into thePlaces APIwhich
provides the base functionality for geocoding, density, convex, and radius calls.→ Note: The Places API package undergoes constant development so consider that endpoint changes may occur.ToimportthePlaces APIpackage:fromplaces_geocodingimportplaces_apiaspaTABLE OF CONTENTSEndpointFunctionload_properties_apiload_radius()convex_searchconvex()density_searchdensity()reverse_geocodereverse()batch_reversebatch_reverse()geocodeforward()batch_geocodebatch_forward()API EXAMPLESTo use the Places API for free leave "token" argument blankNote: Free usage has a rate limit of 2 requests / secondAll example code to thePlaces APIpackage can be found below:load_radius()coordinate:required, indicatescenterof searchradius:required, indicatesradiusof searchreverse_param:option, (boolindicating theorderof the input coordinates)Example(1)pg=pa.Places(token)# pg = pa.Places() for free planresult=pg.load_properties(coordinates=[43.0961466,-77.6337776],radius=100,reverse_param=False)convex()coordinate_array:required,edgesof polygonreverse_param:optional, (boolindicating theorderof the input coordinates)Example(2)pg=pa.Places(token)# pg = pa.Places() for free planresult=pg.convex(coordinates=[[43.0961466,-77.6337776],[43.1018722,-77.6334654],[43.1010339,-77.6342459]],reverse_param=False)density()Radius Load Density:unit_input:required, stroptions: [km, mi, m, ft, yd]unit_output:required, stroptions: [km, mi, m, ft, yd]coordinates:optional,listreverse_param:optional, (boolindicating theorderof the input coordinates)Example(3)pg=pa.Places(token)# pg = pa.Places() for free planresult=pg.density(unit_in='ft',unit_out='ft',coordinates=[43.1010339,-77.6342459],radius=100)Custom Density:unit_input:required, stroptions: [km, mi, m, ft, yd]unit_output:required, stroptions: [km, mi, m, ft, yd]custom_option:optional, strcitypostcoderegion/statecustom_utility:optional, int/str,custom_utility specifies the input ofcustom_optionExample(4)pg=pa.Places(token)# pg = pa.Places() for free planresult=pg.density(unit_in='ft',unit_out='ft',custom_option='postcode',custom_utility=10980)reverse()coordinate:required, geographic location ofPOIradius:optional, radius oferrorDefault error radius is10 ftreverse_param:optional, (boolindicating the reversal of the input coordinates)Example(5)pg=pa.Places(token)# pg = pa.Places() for free planresult=pg.reverse(coordinate=[43.1017283,-77.6338936],radius=10,reverse_param=False)batch_reverse()coordinates:required, geographic location(s) ofPOIradius:optional, radius oferrorDefault error radius is10 ftreverse_param:optional, (boolindicating the reversal of the input coordinate)Example(6)pg=pa.Places(token)# pg = pa.Places() for free planresult=pg.batch_reverse(coordinates=[[43.1017283,-77.6338985],[43.0936914,-77.6349024],[43.0937299,-77.6350315],[43.0930091,-77.6354702],[43.09245,-77.6353749]],radius=10,reverse_param=False)forward()Full Address Geocodingfull address:optional, user-defined1address of the POIPlaces flex-formatting AI allows for multiple address formatsExample(7)pg=pa.Places(token)# pg = pa.Places() for free planresult=pg.forward(full_address="94 Crittenden Way, Brighton, NY, 14623",)Parsed Address Geocodingstreet:optional,streeton which the POI is locatednumber:optional,numberof the POI's streetpostcode:optional,zip codeormicroregionof the POIregion:optional,statein the USA1orregioninternationallycity:optional,citywhere the POI is locatedunit:optional,unitif the POI is non-singular (ex. apartment)If the POI is within USA borders, the region must be the state's 2-letter abbreviationExample (8.1)withoutunitpg=pa.Places(token)# pg = pa.Places() for free planresult=pg.forward(street="Crittenden Way",number=94,postcode=14623,region="NY",city="Brighton",)Example (8.2)withunitpg=pa.Places(token)# pg = pa.Places() for free planresult=pg.forward(street="Crittenden Way",number=88,postcode=14623,region="NY",city="Brighton",unit='Unit 2')batch_forward()addresses:optional, list offormatted addressesaddress_file:optional,JSONorXMLfile of formatted addresses1Note: Check ourdocumentationfor formatting detailsExample(9.1)arrayof addressespg=pa.Places(token)# pg = pa.Places() for free planresult=pg.batch_forward(addresses=["88 Crittenden Way, Brighton, NY, 14623, Unit 2","140 Centre Drive, Brighton, NY, 14623","94 Crittenden Way, Brighton, NY, 14623","104 Crittenden Way, Brighton, NY, 14623, Unit 6"])Example(9.2)fileof addressespg=pa.Places(token)# pg = pa.Places() for free planresult=pg.batch_forward(address_file=address_file.json)pg=pa.Places(token)# pg = pa.Places() for free planresult=pg.batch_forward(address_file=address_file.xml)→ Download theXMLorJSONfile as "address_file" to test the examplesINSTALLATIONInstall thePlaces APIonpip:$ pip install places_geocodingORInstall thePlaces APIonconda:$ conda install -c Martin Mashalov places_geocodingREQUIREMENTSPython3>= 3.6pymongo>= 3.7.0numpypandasBUSINESS CONTACTOur business email contact is:hello@places.place. Please feel free to reach out
regarding any product feedback or support.