compass.utilities.location.Jurisdiction#
- class Jurisdiction(subdivision_type, state, county=None, subdivision_name=None, code=None)[source]#
Bases:
objectModel 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
strconversions defer to the full display name generated byfull_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 (
intorstr, optional) – Optional jurisdiction code (typically FIPS or similar). By default,None.
Methods
Attributes
County phrase for the jurisdiction or empty str
Comma-separated jurisdiction display name
Full location name prefixed with
theas neededSubdivision phrase for the jurisdiction or empty str
Subdivision phrase prefixed with
theas needed- property full_subdivision_phrase[source]#
Subdivision phrase for the jurisdiction or empty str
- Type: