TaxonController#
- class pyinaturalist.controllers.TaxonController(client)#
Bases:
BaseController
Controller for Taxon requests
Methods
- __init__(client)#
- autocomplete(**params)#
Given a query string, return taxa with names starting with the search term
Notes
API reference: GET /taxa/autocomplete
There appears to currently be a bug in the API that causes
per_page
to not have any effect.
- Parameters:
q – Name must begin with this value
is_active – Taxon is active
taxon_id – Only show taxa with this ID, or its descendants
rank – Taxon must have this exact rank
min_rank – Taxon must have this rank or higher; overrides
rank
max_rank – Taxon must have this rank or lower; overrides
rank
rank_level – Taxon must have this rank level. Some example values are 70 (kingdom), 60 (phylum), 50 (class), 40 (order), 30 (family), 20 (genus), 10 (species), 5 (subspecies)
locale – Locale preference for taxon common names
preferred_place_id – Place preference for regional taxon common names
all_names – Include all taxon names in the response
- Return type:
- from_ids(*taxon_ids, **params)#
Get taxa by ID
- populate(taxon, **params)#
Update a partial Taxon record with full taxonomy info, including ancestors + children
- search(**params)#
Search taxa
Notes
API reference: GET /taxa
- Parameters:
q – Name must begin with this value
is_active – Taxon is active
taxon_id – Only show taxa with this ID, or its descendants
rank – Taxon must have this exact rank
min_rank – Taxon must have this rank or higher; overrides
rank
max_rank – Taxon must have this rank or lower; overrides
rank
rank_level – Taxon must have this rank level. Some example values are 70 (kingdom), 60 (phylum), 50 (class), 40 (order), 30 (family), 20 (genus), 10 (species), 5 (subspecies)
locale – Locale preference for taxon common names
preferred_place_id – Place preference for regional taxon common names
all_names – Include all taxon names in the response
id_above – Must have an ID above this value
id_below – Must have an ID below this value
only_id – Return only the record IDs
parent_id – Taxon’s parent must have this ID unless otherwise noted
order_by – Field to sort on
reverse – Reverse the order of results; alias for
order='descending'
- Return type: