Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

datadesk/latimes-mappingla-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 

Repository files navigation


 /'\_/`\                            __                    /\ \     /\  _  \    
/\      \     __     _____   _____ /\_\    ___      __    \ \ \    \ \ \L\ \   
\ \ \__\ \  /'__`\  /\ '__`\/\ '__`\/\ \ /' _ `\  /'_ `\   \ \ \  __\ \  __ \  
 \ \ \_/\ \/\ \L\.\_\ \ \L\ \ \ \L\ \ \ \/\ \/\ \/\ \L\ \   \ \ \L\ \\ \ \/\ \ 
  \ \_\\ \_\ \__/.\_\\ \ ,__/\ \ ,__/\ \_\ \_\ \_\ \____ \   \ \____/ \ \_\ \_\
   \/_/ \/_/\/__/\/_/ \ \ \/  \ \ \/  \/_/\/_/\/_/\/___L\ \   \/___/   \/_/\/_/
                       \ \_\   \ \_\                /\____/                    
                        \/_/    \/_/                \_/__/                     

A python wrapper for accessing the Mapping L.A. API.

Mapping L.A. is the Los Angeles Times’ resource for boundaries, demographics, schools, and news in Los Angeles County. With this API, you can quickly retrieve the boundaries of neighborhoods and regions in KML, KMZ or GeoJSON format.

The code owes a lot to the fine work on python-sunlightapi and python-nytcongressapi.

A demonstration of the API in action can be found in latimes-mappingla-redirect.

Usage

Get it going

>> from mappingla import mappingla

Retrieve all neighborhoods or regions

>> hood_list = mappingla.neighborhoods.all()
>> print hood_list[0].name
Acton
>> region_list = mappingla.regions.all()

Retrieve a neighborhood or region using its slug

>> dtla = mappingla.neighborhoods.get(slug='downtown')
>> westside = mappingla.regions.get(slug='westside')

Find the neighborhood or region that contains a pair of coordinates

>> mappingla.neighborhoods.get(lat=34.053, lng=-118.245)
<Neighborhood: Downtown>
>> mappingla.regions.get(lat=34.053, lng=-118.245)
<Region: Central L.A.>

Retrieve the boundaries of a neighborhood or region in KML, GeoJSON or KMZ format

>> dtla.kml
...
>> dtla.json
...
>> dtla.kmz
...
>> westside.kml
...
>> westside.json
...
>> westside.kmz
...

About

A Python wrapper for accessing the Mapping L.A. Boundaries API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages