Place

class pyinaturalist.models.Place(id=None, admin_level=None, ancestor_place_ids=NOTHING, bbox_area=None, bounding_box_geojson=NOTHING, category=None, display_name=None, geometry_geojson=NOTHING, location=None, name=None, place_type=None, place_type_name=None, slug=None)

Bases: pyinaturalist.models.base.BaseModel

A curated or community-contributed place. Handles data from the following endpoints:

Attributes

Name

Type

Description

id

int

Unique record ID

admin_level

int

Administrative level, if any

ancestor_place_ids

List[str]

IDs of places that this place is contained within

bbox_area

float

Bounding box area

bounding_box_geojson

Dict[str, Any]

Bounding box polygon that fully encloses the place

category

str

Place category (only applies to /places/nearby)

display_name

str

Place name as displayed on place info page

geometry_geojson

Dict[str, Any]

Polygon representing place boundary

location

Tuple[float, float]

Location in (latitude, logitude) decimal degrees

name

str

Place name

place_type

int

Place type ID

place_type_name

str

Place type name

slug

str

Place URL slug

ancestry (property)

str

Handle slash-delimited ‘ancestry’ string from establishment_means.place

url (property)

str

Place info URL on iNaturalist.org

Methods

__init__(id=None, admin_level=None, ancestor_place_ids=NOTHING, bbox_area=None, bounding_box_geojson=NOTHING, category=None, display_name=None, geometry_geojson=NOTHING, location=None, name=None, place_type=None, place_type_name=None, slug=None)

Method generated by attrs for class Place.

classmethod from_json(value, category=None, **kwargs)

Initialize a single model object from an API response or response result.

Omits any invalid fields and None values, so default factories are used instead (e.g. for empty dicts and lists).

Return type

Place

classmethod from_json_file(value)

Initialize a collection of model objects from a JSON string, file path, or file-like object

Return type

List[TypeVar(T, bound= BaseModel)]

classmethod from_json_list(value, **kwargs)

Optionally use results from /places/nearby to set Place.category

Return type

List[Place]

to_json()

Convert this object back to JSON (dict) format

Return type

Dict[str, Any]