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:
GET /taxa (
establishment_means.place
)
Attributes
Name
Type
Description
id
Unique record ID
uuid
Unversally unique record ID
admin_level
Administrative level, if any
ancestor_place_ids
IDs of places that this place is contained within
bbox_area
Bounding box area
bounding_box_geojson
Bounding box polygon that fully encloses the place
category
Place category (only applies to /places/nearby)
display_name
Place name as displayed on place info page
geometry_geojson
Polygon representing place boundary
location
Location in
(latitude, longitude)
decimal degreesname
Place name
place_type
Place type ID
place_type_name
Place type name
slug
Place URL slug
ancestry (
property
)Handle slash-delimited ‘ancestry’ string from
establishment_means.place
url (
property
)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:
- 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:
- classmethod from_json_file(value)¶
Initialize a collection of model objects from a JSON string, file path, or file-like object
- classmethod from_json_list(value, **kwargs)¶
Optionally use results from /places/nearby to set Place.category