LifeList¶
- class pyinaturalist.models.LifeList(id, uuid, data, count_without_taxon, user_id) None¶
Bases:
BaseModelCollectionA user’s life list, based on the schema of
GET /observations/taxonomyAttributes
Methods
- __init__(id, uuid, data, count_without_taxon, 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, **kwargs) LifeList¶
Initialize a single model object from an API response or response result.
Omits any invalid fields and
Nonevalues, so default factories are used instead (e.g. for empty dicts and lists).- Return type:
- classmethod from_json_file(value) list[T]¶
Initialize a collection of model objects from a JSON string, file path, or file-like object
- classmethod from_json_list(value, **kwargs) TC¶
For model collections, initializing from a list should return an instance of
clsinstead of a builtinlist- Return type:
TypeVar(TC, bound= BaseModelCollection)
- get_count(taxon_id, count_field) int¶
Get an observation count for the specified taxon and its descendants, and handle unlisted taxa. Note:
-1can 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)¶