Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 README.textile
Octocat-spinner-32 mappingla.py
README.textile

 /'\_/`\                            __                    /\ \     /\  _  \    
/\      \     __     _____   _____ /\_\    ___      __    \ \ \    \ \ \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
...
Something went wrong with that request. Please try again.