The Wayback Machine - https://web.archive.org/web/20201203203503/https://github.com/datamade/imago
Skip to content
master
Go to file
Code
This branch is 26 commits ahead, 3 commits behind opencivicdata:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

imago

This is the django app that powers api.opencivicdata.org

Python 3.3 or newer required, Python 2 compatibility is not guaranteed.

Getting Started

Imago's loadmappings management command loads mappings between divisions managed by opencivicdata-django and boundaries managed by Represent Boundaries. If mappings are not loaded, then the lat and lon filters on the /people/ and /divisions/ endpoints will not work, and geometries will not appear on the /divisions/ endpoint. For the command to succeed, you must set the IMAGO_COUNTRY and IMAGO_BOUNDARY_MAPPINGS settings:

  • Set IMAGO_COUNTRY to a two-letter, lowercase country code like 'us' in settings.py, to select which country's Open Civic Data Division Identifiers to use.
  • Set IMAGO_BOUNDARY_MAPPINGS in settings.py, a dictionary in which each key is the slug of a boundary set and each value is a dictionary, which has as keys:
    • key: The property of a division identifier that will be used for matching.
    • boundary_key: Optional. Defaults to external_id. The property of a boundary that will be used for matching, or a lambda that takes a boundary as an argument and returns a string that will be used for matching.
    • prefix: Imago will prepend this prefix to the property of the boundary, identified by boundary_key, and will look for the division identifier whose property, identified by key, matches.
    • ignore: Optional. A regular expression string. If no match is found, and if either ignore is missing or the boundary name doesn't match the regular expression, a warning will be issued about the unmatched boundary.

See api.opencivicdata.org's settings.py for an example.

About

Open Civic Data API

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.