diff --git a/pyinaturalist/models/comment.py b/pyinaturalist/models/comment.py index 77e23e46..dc3a7887 100644 --- a/pyinaturalist/models/comment.py +++ b/pyinaturalist/models/comment.py @@ -6,7 +6,7 @@ @define_model class Comment(BaseModel): - """An observation comment, based on the schema of comments + """📝 An observation comment, based on the schema of comments from `GET /observations `_. """ diff --git a/pyinaturalist/models/controlled_term.py b/pyinaturalist/models/controlled_term.py index a7860ce0..51b3fe7a 100644 --- a/pyinaturalist/models/controlled_term.py +++ b/pyinaturalist/models/controlled_term.py @@ -6,7 +6,7 @@ @define_model class Annotation(BaseModel): - """An annotation, meaning a **controlled term value** applied by a **user** to an **observation**. + """📝 An annotation, meaning a **controlled term value** applied by a **user** to an **observation**. Based on the schema of annotations from `GET /observations `_. """ @@ -45,7 +45,7 @@ def __str__(self) -> str: @define_model class ControlledTermValue(BaseModel): - """A controlled term **value**, based on the schema of + """📋 A controlled term **value**, based on the schema of `GET /controlled_terms `_. """ @@ -62,7 +62,7 @@ def __str__(self): @define_model class ControlledTerm(BaseModel): - """A controlled term, based on the schema of + """📋 A controlled term, based on the schema of `GET /controlled_terms `_. """ diff --git a/pyinaturalist/models/identification.py b/pyinaturalist/models/identification.py index 9b281725..802071d0 100644 --- a/pyinaturalist/models/identification.py +++ b/pyinaturalist/models/identification.py @@ -14,7 +14,7 @@ @define_model class Identification(BaseModel): - """An observation identification, based on the schema of + """🔎 An observation identification, based on the schema of `GET /identifications `_. """ diff --git a/pyinaturalist/models/life_list.py b/pyinaturalist/models/life_list.py index 12f6fc2e..8eb31d48 100644 --- a/pyinaturalist/models/life_list.py +++ b/pyinaturalist/models/life_list.py @@ -14,7 +14,7 @@ @define_model class LifeListTaxon(TaxonCount): - """A single taxon in a user's life list""" + """🐦 A single :py:class:`.Taxon` in a user's :py:class:`.LifeList`""" descendant_obs_count: int = field(default=0, doc='Number of observations of taxon children') direct_obs_count: int = field( @@ -33,7 +33,7 @@ def __str__(self) -> str: @define_model_collection class LifeList(TaxonCounts): - """A user's life list, based on the schema of ``GET /observations/taxonomy``""" + """🐦✅📓 A user's life list, based on the schema of ``GET /observations/taxonomy``""" count_without_taxon: int = field(default=0) data: List[LifeListTaxon] = field(factory=list, converter=LifeListTaxon.from_json_list) # type: ignore diff --git a/pyinaturalist/models/observation.py b/pyinaturalist/models/observation.py index b97c7dcd..28fbe758 100644 --- a/pyinaturalist/models/observation.py +++ b/pyinaturalist/models/observation.py @@ -38,7 +38,7 @@ @define(auto_attribs=False, init=False, field_transformer=add_lazy_attrs) class Observation(BaseModel): - """An observation, based the schema of + """👤🔎🐦 An observation, based the schema of `GET /observations `_. """ @@ -224,7 +224,7 @@ def __str__(self) -> str: @define_model_collection class Observations(BaseModelCollection): - """A collection of observations""" + """👥🔍🐦 A collection of observations""" data: List[Observation] = field(factory=list, converter=Observation.from_json_list) diff --git a/pyinaturalist/models/observation_field.py b/pyinaturalist/models/observation_field.py index b203353f..46ba36fc 100644 --- a/pyinaturalist/models/observation_field.py +++ b/pyinaturalist/models/observation_field.py @@ -28,7 +28,7 @@ @define_model class ObservationField(BaseModel): - """An observation field **definition**, based on the schema of + """📋 An observation field **definition**, based on the schema of `GET /observation_fields `_. """ @@ -59,7 +59,7 @@ def __str__(self) -> str: @define_model class ObservationFieldValue(BaseModel): - """An observation field **value**, matching the schema of ``ofvs`` + """📝 An observation field **value**, based on the schema of ``Observation.ofvs`` from `GET /observations `_. """ diff --git a/pyinaturalist/models/photo.py b/pyinaturalist/models/photo.py index c502fc88..b2e49536 100644 --- a/pyinaturalist/models/photo.py +++ b/pyinaturalist/models/photo.py @@ -7,8 +7,10 @@ @define_model class Photo(BaseModel): - """An observation photo, based on the schema of photos from - `GET /observations `_. + """📷 An observation photo, based on the schema of photos from: + + * `GET /observations `_ + * `GET /taxa ` """ attribution: str = field(default=None, doc='License attribution') diff --git a/pyinaturalist/models/place.py b/pyinaturalist/models/place.py index 75c76b70..ab169e6f 100644 --- a/pyinaturalist/models/place.py +++ b/pyinaturalist/models/place.py @@ -20,7 +20,7 @@ def convert_optional_lat_long(obj: Union[Dict, List, None, str]): @define_model class Place(BaseModel): - """A curated or community-contributed place. Handles data from the following endpoints: + """📍 A curated or community-contributed place. Handles data from the following endpoints: * `GET /places/{id} `_ * `GET /places/nearby `_ diff --git a/pyinaturalist/models/project.py b/pyinaturalist/models/project.py index 5aa77d66..4342bfa3 100644 --- a/pyinaturalist/models/project.py +++ b/pyinaturalist/models/project.py @@ -24,7 +24,7 @@ @define_model class ProjectObservation(BaseModel): - """Metadata about an observation that has been added to a project""" + """👤🔎🐦 Metadata about an observation that has been added to a project""" preferences: Dict = field(factory=dict) # Example: {'allows_curator_coordinate_access': True} project: Dict = field(factory=dict) # Example: {'id': 24237} @@ -37,7 +37,7 @@ class ProjectObservation(BaseModel): @define_model class ProjectObservationField(ObservationField): - """An :py:class:`.ObservationField` with additional project-specific information""" + """📋 An :py:class:`.ObservationField` with additional project-specific information""" project_observation_field_id: int = field(default=None) position: int = field(default=None) @@ -55,7 +55,7 @@ def from_json(cls, value: JsonResponse, **kwargs) -> 'ProjectObservationField': @define_model class ProjectUser(User): - """A :py:class:`.User` with additional project-specific information""" + """👤 A :py:class:`.User` with additional project-specific information""" project_id: int = field(default=None) project_user_id: int = field(default=None) @@ -73,7 +73,7 @@ def from_json(cls, value: JsonResponse, **kwargs) -> 'ProjectUser': @define_model class Project(BaseModel): - """A dataclass containing information about a project, matching the schema of + """👥 An iNaturalist project, based on the schema of `GET /projects `_. """ diff --git a/pyinaturalist/models/search.py b/pyinaturalist/models/search.py index 1b286d40..22f8bc44 100644 --- a/pyinaturalist/models/search.py +++ b/pyinaturalist/models/search.py @@ -10,7 +10,7 @@ @define_model class SearchResult(BaseModel): - """A dataclass for search results, matching the schema of + """🔍 A search result of any type, based on the schema of `GET /search `_. """ diff --git a/pyinaturalist/models/taxon.py b/pyinaturalist/models/taxon.py index 1c406221..7bc2dda7 100644 --- a/pyinaturalist/models/taxon.py +++ b/pyinaturalist/models/taxon.py @@ -33,10 +33,10 @@ # TODO: Include codes from other sources? Currently only including IUCN codes. @define_model class ConservationStatus(BaseModel): - """The conservation status of a taxon in a given location, based on the schema of: + """‼️ The conservation status of a taxon in a given location, based on the schema of: - * Taxon.conservation_status from `GET /taxa `_ - * Observation.taxon.conservation_statused from `GET /observations `_ + * ``Taxon.conservation_status`` from `GET /taxa `_ + * ``Observation.taxon.conservation_statuses`` from `GET /observations `_ """ authority: str = field(default=None, doc='Data source for conservation status') @@ -74,7 +74,7 @@ class ConservationStatus(BaseModel): @define_model class EstablishmentMeans(BaseModel): - """The establishment means for a taxon in a given location""" + """‼️ The establishment means for a taxon in a given location""" establishment_means: str = field( default=None, options=ESTABLISTMENT_MEANS, doc='Establishment means description' @@ -89,7 +89,7 @@ def __str__(self) -> str: @define_model class Taxon(BaseModel): - """An iNaturalist taxon, based on the schema of + """🐦 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 @@ -268,7 +268,9 @@ def __str__(self) -> str: @define_model class TaxonCount(Taxon): - """A taxon with an associated count, used in a :py:class:`.TaxonCounts` collection""" + """🐦#️⃣ A :py:class:`.Taxon` with an associated count, used in a :py:class:`.TaxonCounts` + collection + """ count: int = field(default=0, doc='Number of observations of this taxon') @@ -296,7 +298,7 @@ def __str__(self) -> str: @define_model_collection class TaxonCounts(BaseModelCollection): - """A collection of taxa with an associated counts. Used with + """🐦#️⃣📓 A collection of taxa with an associated counts. Used with `GET /observations/species_counts `_. as well as :py:class:`.LifeList`. """ diff --git a/pyinaturalist/models/user.py b/pyinaturalist/models/user.py index 9e93d989..60e33d38 100644 --- a/pyinaturalist/models/user.py +++ b/pyinaturalist/models/user.py @@ -7,7 +7,7 @@ @define_model class User(BaseModel): - """A dataclass containing information about an user, matching the schema of + """👤 An iNaturalist user, based on the schema of `GET /users/{id} `_. """