LifeList¶
- class pyinaturalist.models.LifeList(id=None, uuid=None, data=_Nothing.NOTHING, count_without_taxon=0, user_id=None)¶
Bases:
BaseModelCollection
A user’s life list, based on the schema of
GET /observations/taxonomy
Attributes
Name
Type
Description
id
Unique record ID
uuid
Unversally unique record ID
data
count_without_taxon
Number of observations without a taxon
user_id
Methods
- __init__(id=None, uuid=None, data=_Nothing.NOTHING, count_without_taxon=0, user_id=None)¶
Method generated by attrs for class LifeList.
- append(item)¶
S.append(value) – append value to the end of the sequence
- clear() None -- remove all items from S ¶
- classmethod copy(obj)¶
Copy a model collection
- count(value) integer -- return number of occurrences of value ¶
- deduplicate()¶
Remove any duplicates from this collection based on ID
- extend(other)¶
S.extend(iterable) – extend sequence by appending elements from the iterable
- classmethod from_json(value, user_id=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)¶
For model collections, initializing from a list should return an instance of
cls
instead of a builtinlist
- Return type:
TypeVar
(TC
, bound= BaseModelCollection)
- get_count(taxon_id, count_field='descendant_obs_count')¶
Get an observation count for the specified taxon and its descendants, and handle unlisted taxa. Note:
-1
can be used an alias forcount_without_taxon
.- Return type:
- index(value[, start[, stop]]) integer -- return first index of value. ¶
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- insert(i, item)¶
S.insert(index, value) – insert value before index
- pop([index]) item -- remove and return item at index (default last). ¶
Raise IndexError if list is empty or index is out of range.
- remove(item)¶
S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.
- reverse()¶
S.reverse() – reverse IN PLACE
- sort(*args, **kwds)¶