Observation#

class pyinaturalist.models.Observation(**kwargs)#

Bases: BaseModel

An observation, based the schema of GET /observations

__init__(**kwargs)#

Method generated by attrs for class Observation.

Attributes

Name

Type

Description

id

int

Unique record ID

created_at

datetime

Date and time the observation was created

captive

bool

Indicates if the organism is non-wild (captive or cultivated)

community_taxon_id

int

The current community identification taxon

context_geoprivacy

str

context_taxon_geoprivacy

str

context_user_geoprivacy

str

description

str

Observation description

geoprivacy

str

Location privacy level

Options: obscured, obscured_private, open, private

identifications_count

int

Total number of identifications

identifications_most_agree

bool

Indicates if most identifications agree with the community ID

identifications_most_disagree

bool

Indicates if most identifications disagree with the community ID

identifications_some_agree

bool

Indicates if some identifications agree with the community ID

license_code

str

Creative Commons license code

Options: CC-BY, CC-BY-NC, CC-BY-ND, CC-BY-SA, CC-BY-NC-ND, CC-BY-NC-SA, CC0, ALL RIGHTS RESERVED

location

Tuple[float, float]

Location in (latitude, longitude) decimal degrees

mappable

bool

Indicates if the observation can be shown on a map

num_identification_agreements

int

Total identifications that agree with the community ID

num_identification_disagreements

int

Total identifications that disagree with the community ID

oauth_application_id

str

ID of the OAuth application used to create the observation, if any

obscured

bool

Indicates if coordinates are obscured (showing a broad approximate location on the map)

observed_on

datetime

Date and time the organism was observed

outlinks

List[Dict]

Linked observation pages on other sites (e.g., GBIF)

out_of_range

bool

Indicates if the taxon is observed outside of its known range

owners_identification_from_vision

bool

Indicates if the owner’s ID was selected from computer vision results

place_guess

str

Place name determined from observation coordinates

place_ids

List[int]

Place IDs associated with the observation coordinates

positional_accuracy

int

GPS accuracy in meters (real accuracy, if obscured)

preferences

Dict[str, Any]

Any user observation preferences (related to community IDs, coordinate access, etc.)

private_location

Tuple[float, float]

Private location in (latitude, longitude) decimal degrees

private_place_ids

List[int]

Place IDs associated with the private observation coordinates

private_place_guess

str

Place name determined from private observation coordinates

project_ids

List[int]

All associated project IDs

project_ids_with_curator_id

List[int]

Project IDs with a curator identification for this observation

project_ids_without_curator_id

List[int]

Project IDs without curator identification for this observation

public_positional_accuracy

int

GPS accuracy in meters (not accurate if obscured)

quality_grade

str

Quality grade

Options: casual, needs_id, research

reviewed_by

List[int]

IDs of users who have reviewed the observation

site_id

int

Site ID for iNaturalist network members, or 1 for inaturalist.org

species_guess

str

Taxon name from observer’s initial identification

tags

List[str]

Arbitrary user tags added to the observation

taxon_geoprivacy

str

updated_at

datetime

Date and time the observation was last updated

uri

str

Link to observation details page

uuid

str

Universally unique ID; generally preferred over id where possible

viewer_trusted_by_observer

bool

Observer trusts the authenticated user with access to hidden coordinates

cumulative_ids (property)

Tuple[int, int]

Calculate the cumulative community ID score (agreements/total), as shown on the observation UI

default_photo (property)

Photo

Get the default observation photo if any; otherwise use taxon default photo or icon

ident_taxon_ids (property)

List[int]

Get all taxon IDs (including ancestors) from identifications

username (property)

str

annotations (LazyProperty)

List[Annotation]

Observation annotations

application (LazyProperty)

Application

Application that created the observation

comments (LazyProperty)

List[Comment]

Observation comments

faves (LazyProperty)

List[Fave]

Users who have favorited the observation

flags (LazyProperty)

List[Flag]

Observation flags

identifications (LazyProperty)

List[Identification]

Observation identifications

ofvs (LazyProperty)

List[ObservationFieldValue]

Observation field values

photos (LazyProperty)

List[Photo]

Observation photos

project_observations (LazyProperty)

List[ProjectObservation]

Details on any projects that the observation has been added to

quality_metrics (LazyProperty)

List[QualityMetric]

Data quality assessment metrics

sounds (LazyProperty)

List[Sound]

Observation sound files

taxon (LazyProperty)

Taxon

Observation taxon

user (LazyProperty)

User

Observer

votes (LazyProperty)

List[Vote]

Votes on data quality assessment metrics

Methods

__init__(**kwargs)#

Method generated by attrs for class Observation.

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, **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:

TypeVar(T, bound= BaseModel)

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)#

Initialize a collection of model objects from an API response or response results

Return type:

List[TypeVar(T, bound= BaseModel)]

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]