Taxon¶
- class pyinaturalist.models.Taxon(id=None, ancestor_ids=NOTHING, complete_rank=None, complete_species_count=None, created_at=None, current_synonymous_taxon_ids=NOTHING, extinct=None, gbif_id=None, iconic_taxon_id=0, iconic_taxon_name='unknown', is_active=None, listed_places=None, listed_taxa_count=None, matched_term=None, name=None, names=NOTHING, observations_count=None, parent_id=None, preferred_common_name='', preferred_establishment_means=None, rank_level=None, ranges=None, rank=None, taxon_changes_count=None, taxon_schemes_count=None, vision=None, wikipedia_summary=None, wikipedia_url=None, ancestors=NOTHING, children=NOTHING, conservation_status=None, conservation_statuses=NOTHING, default_photo=None, establishment_means=None, listed_taxa=NOTHING, taxon_photos=NOTHING)¶
Bases:
pyinaturalist.models.base.BaseModel
An iNaturalist taxon, based on the schema of GET /taxa.
Can be constructed from either a full or partial JSON record. Examples of partial records include nested
ancestors
,children
, and results fromget_taxa_autocomplete()
.Attributes
Name
Type
Description
id
Unique record ID
ancestor_ids
Taxon IDs of ancestors, from highest rank to lowest
complete_rank
Complete or “leaf taxon” rank, e.g. species or subspecies
complete_species_count
Total number of species descended from this taxon
created_at
Date and time the taxon was added to iNaturalist
current_synonymous_taxon_ids
Taxon IDs of taxa that are accepted synonyms
extinct
Indicates if the taxon is extinct
gbif_id
GBIF taxon ID
iconic_taxon_id
ID of the iconic taxon (e.g., general taxon “category”)
iconic_taxon_name
Name of the iconic taxon (e.g., general taxon “category”)
is_active
Indicates if the taxon is active (and not renamed, moved, etc.)
listed_places
Indicates if there are listed places for this taxon
listed_taxa_count
Number of listed taxa from this taxon + descendants
matched_term
Matched search term, from autocomplete results
name
Taxon name; contains full scientific name at species level and below
names
All regional common names; only returned if
all_names
is specifiedobservations_count
Total number of observations of this taxon and its descendants
parent_id
Taxon ID of immediate ancestor
preferred_common_name
Common name for the preferred place, if any
preferred_establishment_means
Establishment means for this taxon in the given preferred place (if any)
rank_level
Number indicating rank level, for easier comparison between ranks (kingdom=higest)
ranges
Indicates if there is range data for this taxon
rank
Taxon rank
Options:
form
,variety
,subspecies
,hybrid
,species
,genushybrid
,subgenus
,genus
,subtribe
,tribe
,supertribe
,subfamily
,family
,epifamily
,superfamily
,infraorder
,suborder
,order
,superorder
,infraclass
,subclass
,class
,superclass
,subphylum
,phylum
,kingdom
taxon_changes_count
Number of curator changes to this taxon
taxon_schemes_count
Taxon schemes that include this taxon
vision
Indicates if this taxon is included in the computer vision model
wikipedia_summary
Taxon summary from Wikipedia article
wikipedia_url
URL to Wikipedia article for the taxon
ancestry (
property
)String containing either ancestor names (if available) or IDs
child_ids (
property
)Taxon IDs of direct children, sorted by rank then name
emoji (
property
)Get an emoji representing the taxon
full_name (
property
)Taxon rank, scientific name, common name (if available), and emoji
icon_url (
property
)URL for the iconic taxon’s icon
gbif_url (
property
)URL for the GBIF info page for this taxon
parent (
property
)Immediate parent, if any
url (
property
)Info URL on iNaturalist.org
ancestors (
LazyProperty
)Ancestor taxa, from highest rank to lowest
children (
LazyProperty
)Child taxa, sorted by rank then name
conservation_status (
LazyProperty
)Conservation status of the taxon in a given location
conservation_statuses (
LazyProperty
)Conservation statuses of the taxon in different locations
default_photo (
LazyProperty
)Taxon default photo
establishment_means (
LazyProperty
)Establishment means for a taxon in a given location
listed_taxa (
LazyProperty
)Details about this taxon associated with a list
taxon_photos (
LazyProperty
)All taxon photos shown on taxon info page
Methods
- __init__(id=None, ancestor_ids=NOTHING, complete_rank=None, complete_species_count=None, created_at=None, current_synonymous_taxon_ids=NOTHING, extinct=None, gbif_id=None, iconic_taxon_id=0, iconic_taxon_name='unknown', is_active=None, listed_places=None, listed_taxa_count=None, matched_term=None, name=None, names=NOTHING, observations_count=None, parent_id=None, preferred_common_name='', preferred_establishment_means=None, rank_level=None, ranges=None, rank=None, taxon_changes_count=None, taxon_schemes_count=None, vision=None, wikipedia_summary=None, wikipedia_url=None, ancestors=NOTHING, children=NOTHING, conservation_status=None, conservation_statuses=NOTHING, default_photo=None, establishment_means=None, listed_taxa=NOTHING, taxon_photos=NOTHING)¶
Method generated by attrs for class Taxon.
- 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).
- 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)¶
Initialize a collection of model objects from an API response or response results
- classmethod from_sorted_json_list(value)¶
Sort Taxon objects by rank then by name
- load_full_record()¶
Update this Taxon with full taxon info, including ancestors + children