Pyinaturalist

Latest version: v0.19.0

Safety actively analyzes 618874 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 5

0.19.0

New Endpoints
* Added new **User** endpoint: `get_current_user()`
* Added new **Taxon** endpoint: `get_life_list_metadata()`

Modified Endpoints
Add support for searching observations by observation fields, using a new `observation_fields` param for the following functions:
* `get_observations()`
* `get_observation_histogram()`
* `get_observation_identifiers()`
* `get_observation_observers()`
* `get_observation_popular_field_values()`
* `get_observation_species_counts()`

Models
**Observation:**
* Add `Observation.ident_taxon_ids` dynamic property to get all identification taxon IDs (with ancestors)
* Add `Observation.cumulative_ids` dynamic property to calculate agreements/total community identifications
* Add `Application` model for `Observation.application` (for v2 API)
* Add `Fave` model for `Observation.faves`
* Add `Flag` model for `Observation.flags`
* Add `QualityMetric` model for `Observation.quality_metrics`
* Add `Sound` model for `Observation.sounds`
* Add `Vote` model for `Observation.votes`

**Project:**
* Add `Project.last_post_at` datetime attribute
* Add `Project.observation_requirements_updated_at` datetime attribute

**Taxon:**
* Add `make_tree()` function to build a tree from `Taxon` objects or a `LifeList`
* Add `pprint_tree()` function to print a taxon tree on the console
* Add `Taxon.flatten()` method to return a taxon and its descendants as a flat list
* Fix initialization of `ListedTaxon.place`

Other changes
* Added support for python 3.12

0.18.0

New Endpoints
* Added new **Observation** endpoint:
* `get_observations_by_id()`
* Replaces `get_observation`
* Accepts multiple IDs
* Uses a different endpoint (`GET /observations/{id}` instead of `GET /observations?id={id}`)
* returns full term and value details for annotations

Modified Endpoints
* Add some undocumented request params to `get_taxa_by_id()`:
* `locale`
* `preferred_place_id`
* `all_names`

Deprecated Endpoints
* `get_observation()` is now deprecated, and will be removed in a future release
* Please use `get_observations()` or `get_observations_by_id()` instead

Models
* Add full mapping of conservation status codes for IUCN, NatureServe, Norma Oficial Mexicana, and other generic codes
* Translate `ConservationStatus.status_name` based on status code and authority for more consistent results
* Add `ConservationStatus.display_name` property
* Add `Observation.default_photo` property
* Use taxon icon as placeholder for `Observation.default_photo` if observation has no photos
* Update `Annotation` model to include controlled term and value details from updated `GET /observations/{id}` response format
* Add `Annotation.term` and `value` properties and init arguments for simpler initialization from term and value labels
* Remove redundant `Annotation.controlled_attribute_id` and `controlled_value_id` attributes (These can still be used as init arguments)

Sessions
* Add `cache_control` option to `ClientSession` to disable using Cache-Control headers for cache
expiration (enabled by default)
* Add `urls_expire_after` option to `ClientSession` to update default cache expiration URL patterns

Bugfixes
* Fix error `413: Payload too large` when using `add_project_users()` or `delete_project_users()` with a project with a large number of rules
* Fix JWT caching
* Fix `ObservationFieldValue` conversions for `date` and `datetime` fields
* Fix printing `Annotation` objects with `rich`
* Fix printing `Observation` tables when taxon is missing

Other Changes
* Added support for python 3.11
* All API functions that accept taxonomic rank parameters (`rank`, `lrank`, `observation_hrank`,etc.) now accept all rank variations that iNaturalist accepts (`var`, `spp` `sub-species`, etc.)
* Optionally use `ultrajson` instead of stdlib `json`, if installed
* Add `loop` argument to iNatClient and Paginator classes to allow passing an async event loop to be used for async iteration
* Add `Paginator.async_all()` method (async, non-blocking version of `.all()`)

0.17.4

* Use a single data directory instead of separate 'cache' and 'user data' dirs
* Platform-dependent; on Linux, for example, this will be `~/.local/share/pyinaturalist`

0.17.3

* Add retries for requests that return invalid (truncated) JSON
* `max_retries` and `backoff_factor` arguments for `ClientSession` will apply to these retries (in
addition to other request errors)

0.17.2

* Handle nested 'photo' dictionaries when loading `Taxon.taxon_photos`
* Add model for `ListedTaxon.list`, and handle differences in format between `/taxa` and `/observations/{id}/taxon_summary`
* Minor fixes and improvements for creating and converting `Observation`, `Taxon`, and other model objects

0.17.1

* Fix pagination bug causing only the first two pages of results to be returned
* Add Photo.uuid, observation_id, and user_id fields (for compatibility with inaturalist-open-data)
* Handle errors in ObservationField type conversions
* Improve terminal output for nested model objects (like `Observation.taxon`, `Taxon.ancestors`, etc.)
* If `Taxon.ancestor_ids` is missing, populate from either `ancestry` string or `ancestor` objects, if possible

Page 1 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.