Close httplib2 connections.
queryDivisionByAddress(address=None, x__xgafv=None)
Lookup OCDIDs and names for divisions related to an address.
search(query=None, x__xgafv=None)
Searches for political divisions by their natural name or OCD ID.
close()
Close httplib2 connections.
queryDivisionByAddress(address=None, x__xgafv=None)
Lookup OCDIDs and names for divisions related to an address. Args: address: string, A parameter x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { "divisions": { "a_key": { # Describes a political geography. "alsoKnownAs": [ # Any other valid OCD IDs that refer to the same division.\n\nBecause OCD IDs are meant to be human-readable and at least somewhat predictable, there are occasionally several identifiers for a single division. These identifiers are defined to be equivalent to one another, and one is always indicated as the primary identifier. The primary identifier will be returned in ocd_id above, and any other equivalent valid identifiers will be returned in this list.\n\nFor example, if this division's OCD ID is ocd-division/country:us/district:dc, this will contain ocd-division/country:us/state:dc. "A String", ], "name": "A String", # The name of the division. "officeIndices": [ # List of indices in the offices array, one for each office elected from this division. Will only be present if includeOffices was true (or absent) in the request. 42, ], }, }, "normalizedInput": { # A simple representation of an address. # The normalized version of the requested address. "city": "A String", # The city or town for the address. "line1": "A String", # The street name and number of this address. "line2": "A String", # The second line the address, if needed. "line3": "A String", # The third line of the address, if needed. "locationName": "A String", # The name of the location. "state": "A String", # The US two letter state abbreviation of the address. "zip": "A String", # The US Postal Zip Code of the address. }, }
search(query=None, x__xgafv=None)
Searches for political divisions by their natural name or OCD ID. Args: query: string, The search query. Queries can cover any parts of a OCD ID or a human readable division name. All words given in the query are treated as required patterns. In addition to that, most query operators of the Apache Lucene library are supported. See http://lucene.apache.org/core/2_9_4/queryparsersyntax.html x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { # The result of a division search query. "kind": "civicinfo#divisionSearchResponse", # Identifies what kind of resource this is. Value: the fixed string "civicinfo#divisionSearchResponse". "results": [ { # Represents a political geographic division that matches the requested query. "aliases": [ # Other Open Civic Data identifiers that refer to the same division -- for example, those that refer to other political divisions whose boundaries are defined to be coterminous with this one. For example, ocd-division/country:us/state:wy will include an alias of ocd-division/country:us/state:wy/cd:1, since Wyoming has only one Congressional district. "A String", ], "name": "A String", # The name of the division. "ocdId": "A String", # The unique Open Civic Data identifier for this division }, ], }