Coder Social home page Coder Social logo

imago's Introduction

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.

imago's People

Contributors

dcloud avatar derekeder avatar jamesturk avatar mileswwatkins avatar paultag avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.