Place#

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

Bases: BaseModel

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

Attributes

Name

Type

Description

id

int

Unique record ID

uuid

str

Unversally 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, longitude) 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, uuid=None, admin_level=None, ancestor_place_ids=_Nothing.NOTHING, bbox_area=None, bounding_box_geojson=_Nothing.NOTHING, category=None, display_name=None, geometry_geojson=_Nothing.NOTHING, location=None, name=None, place_type=None, place_type_name=None, slug=None)#

Method generated by attrs for class Place.

classmethod copy(obj)#

Copy a model object. This is defined as a classmethod to easily initialize a subclass from a parent class instance. For copying an instance to the same type, copy.deepcopy() can be used.

Return type:

BaseModel

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_dict(keys=None, recurse=True)#

Convert this object back to dict format

Parameters:
  • keys (Optional[List[str]]) – Only keep the specified keys (attribute names)

  • recurse (bool) – Recurse into nested model objects

Return type:

Dict[str, Any]