compass.utilities.location.Jurisdiction#

class Jurisdiction(subdivision_type, state, county=None, subdivision_name=None, code=None)[source]#

Bases: object

Model a geographic jurisdiction used throughout COMPASS

The class normalizes casing for location components and provides convenience properties for rendering jurisdiction names with correct prefixes. It is designed to align with ordinance validation logic that expects consistent casing and phrasing across states, counties, and municipal subdivisions.

Notes

Instances compare case-insensitively for type and state, while the county and subdivision name comparisons preserve their stored casing. Hashing and str conversions defer to the full display name generated by full_name.

Parameters:
  • subdivision_type (str) – Type of subdivision that this jurisdiction represents. Typical values are “state”, “county”, “town”, “city”, “borough”, “parish”, “township”, etc.

  • state (str) – Name of the state containing the jurisdiction.

  • county (str, optional) –

    Name of the county containing the jurisdiction, if applicable. If the jurisdiction represents a state, leave this input unspecified. If the jurisdiction represents a county or a subdivision within a county, provide the county name here.

    Important

    Make sure this input is capitalized properly!

    By default, None.

  • subdivision_name (str, optional) –

    Name of the subdivision that the jurisdiction represents, if applicable. If the jurisdiction represents a state or county, leave this input unspecified. Otherwise, provide the jurisdiction name here.

    Important

    Make sure this input is capitalized properly!

    By default, None.

  • code (int or str, optional) – Optional jurisdiction code (typically FIPS or similar). By default, None.

Methods

Attributes

full_county_phrase

County phrase for the jurisdiction or empty str

full_name

Comma-separated jurisdiction display name

full_name_the_prefixed

Full location name prefixed with the as needed

full_subdivision_phrase

Subdivision phrase for the jurisdiction or empty str

full_subdivision_phrase_the_prefixed

Subdivision phrase prefixed with the as needed

property full_name[source]#

Comma-separated jurisdiction display name

Type:

str

property full_name_the_prefixed[source]#

Full location name prefixed with the as needed

Type:

str

property full_subdivision_phrase[source]#

Subdivision phrase for the jurisdiction or empty str

Type:

str

property full_subdivision_phrase_the_prefixed[source]#

Subdivision phrase prefixed with the as needed

Type:

str

property full_county_phrase[source]#

County phrase for the jurisdiction or empty str

Type:

str