Models¶
models
¶
Typed representations of MERMAID API resources.
Models are frozen dataclasses. Every field is optional and every unrecognised key from
the API lands in APIModel.extra, so a server-side
addition can never break parsing. Subclasses only need to declare fields; parsing and
conversion are inherited from APIModel.
Classes:
| Name | Description |
|---|---|
APIModel |
Base class providing lossless construction using API keys as field names. |
ProjectMembership |
A project a profile belongs to, as returned by |
Me |
The profile owning the credentials in use ( |
Project |
A MERMAID project ( |
Site |
A reef site ( |
Management |
A management regime ( |
ProjectTag |
An organisation tag projects can be labelled with ( |
FishSize |
One bin of a fish size bin set ( |
FishFamily |
A fish family ( |
FishGenus |
A fish genus ( |
FishSpecies |
A fish species ( |
BenthicAttribute |
A benthic attribute ( |
InvertAttribute |
A macroinvertebrate attribute ( |
InvertSpecies |
A macroinvertebrate species ( |
SummarySampleEvent |
A public summary of one sample event ( |
LabelMapping |
A provider label mapped onto a MERMAID benthic attribute. |
SampleEvent |
A site visited on a date under a management regime. |
Observer |
A profile credited with one sample unit method. |
ProjectProfile |
A profile's membership of one project. |
SampleUnit |
What every transect and quadrat collection has in common. |
Transect |
A numbered transect of a surveyed length. |
FishBeltTransect |
A fish belt transect ( |
BenthicTransect |
A benthic transect ( |
InvertBeltTransect |
A macroinvertebrate belt transect, as nested in a method payload. |
QuadratTransect |
A benthic photo quadrat transect, as nested in a method payload. |
QuadratCollection |
A bleaching quadrat collection, as nested in a method payload. |
SampleUnitMethod |
One protocol recorded on one sample unit. |
BeltFishMethod |
A fish belt survey ( |
BenthicLITMethod |
A benthic LIT survey ( |
BenthicPITMethod |
A benthic PIT survey ( |
HabitatComplexityMethod |
A habitat complexity survey. |
BenthicPhotoQuadratTransectMethod |
A benthic photo quadrat survey. |
BleachingQuadratCollectionMethod |
A bleaching quadrat collection survey. |
BeltInvertMethod |
A macroinvertebrate belt survey. |
AggregatedRecord |
One row from an aggregated view, kept deliberately thin. |
ZonalStatsResult |
Statistics for one area of interest against one raster or vector source. |
Functions:
| Name | Description |
|---|---|
parse_datetime |
Parse an ISO 8601 timestamp as returned by the API. |
parse_date |
Parse a calendar date ( |
APIModel
dataclass
¶
Base class providing lossless construction using API keys as field names.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
extra |
Mapping[str, Any]
|
|
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
ProjectMembership
dataclass
¶
ProjectMembership(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
name: str | None = None,
role: int | None = None,
num_active_sample_units: int | None = None,
)
Bases: APIModel
A project a profile belongs to, as returned by GET /me/.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
name |
str | None
|
|
role |
int | None
|
|
num_active_sample_units |
int | None
|
|
extra |
Mapping[str, Any]
|
|
num_active_sample_units
class-attribute
instance-attribute
¶
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
Me
dataclass
¶
Me(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
first_name: str | None = None,
last_name: str | None = None,
full_name: str | None = None,
email: str | None = None,
picture: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
projects: tuple[ProjectMembership, ...] = (),
)
Bases: APIModel
The profile owning the credentials in use (GET /me/).
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
first_name |
str | None
|
|
last_name |
str | None
|
|
full_name |
str | None
|
|
email |
str | None
|
|
picture |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
projects |
tuple[ProjectMembership, ...]
|
|
extra |
Mapping[str, Any]
|
|
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
projects
class-attribute
instance-attribute
¶
projects: tuple[ProjectMembership, ...] = field(
default=(),
metadata=_api_meta(
converter=_model_tuple(ProjectMembership)
),
)
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
Project
dataclass
¶
Project(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
name: str | None = None,
notes: str | None = None,
status: int | None = None,
countries: tuple[str, ...] = (),
tags: tuple[str, ...] = (),
members: tuple[str, ...] = (),
project_admins: tuple[Mapping[str, Any], ...] = (),
num_sites: int | None = None,
num_sample_units: float | None = None,
num_active_sample_units: int | None = None,
is_demo: bool | None = None,
includes_gfcr: bool | None = None,
suggested_citation: str | None = None,
bbox: Any = None,
data_policy_beltfish: int | None = None,
data_policy_benthiclit: int | None = None,
data_policy_benthicpit: int | None = None,
data_policy_benthicpqt: int | None = None,
data_policy_bleachingqc: int | None = None,
data_policy_habitatcomplexity: int | None = None,
data_policy_macroinvertebrate: int | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
)
Bases: APIModel
A MERMAID project (GET /projects/).
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
name |
str | None
|
|
notes |
str | None
|
|
status |
int | None
|
|
countries |
tuple[str, ...]
|
|
tags |
tuple[str, ...]
|
|
members |
tuple[str, ...]
|
|
project_admins |
tuple[Mapping[str, Any], ...]
|
|
num_sites |
int | None
|
|
num_sample_units |
float | None
|
|
num_active_sample_units |
int | None
|
|
is_demo |
bool | None
|
|
includes_gfcr |
bool | None
|
|
suggested_citation |
str | None
|
|
bbox |
Any
|
|
data_policy_beltfish |
int | None
|
|
data_policy_benthiclit |
int | None
|
|
data_policy_benthicpit |
int | None
|
|
data_policy_benthicpqt |
int | None
|
|
data_policy_bleachingqc |
int | None
|
|
data_policy_habitatcomplexity |
int | None
|
|
data_policy_macroinvertebrate |
int | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
data_policies |
dict[str, int | None]
|
The per-protocol data sharing policies, keyed by protocol name. |
extra |
Mapping[str, Any]
|
|
countries
class-attribute
instance-attribute
¶
tags
class-attribute
instance-attribute
¶
members
class-attribute
instance-attribute
¶
project_admins
class-attribute
instance-attribute
¶
project_admins: tuple[Mapping[str, Any], ...] = field(
default=(), metadata=_api_meta(converter=_mapping_tuple)
)
num_active_sample_units
class-attribute
instance-attribute
¶
data_policy_benthiclit
class-attribute
instance-attribute
¶
data_policy_benthicpit
class-attribute
instance-attribute
¶
data_policy_benthicpqt
class-attribute
instance-attribute
¶
data_policy_bleachingqc
class-attribute
instance-attribute
¶
data_policy_habitatcomplexity
class-attribute
instance-attribute
¶
data_policy_macroinvertebrate
class-attribute
instance-attribute
¶
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
data_policies
property
¶
The per-protocol data sharing policies, keyed by protocol name.
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
Site
dataclass
¶
Site(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
name: str | None = None,
project: str | None = None,
project_name: str | None = None,
country: str | None = None,
country_name: str | None = None,
reef_type: str | None = None,
reef_type_name: str | None = None,
reef_zone: str | None = None,
reef_zone_name: str | None = None,
exposure: str | None = None,
exposure_name: str | None = None,
location: Any = None,
notes: str | None = None,
predecessor: str | None = None,
validations: Any = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
)
Bases: APIModel
A reef site (GET /sites/).
The choice fields (country, reef_type, reef_zone, exposure)
hold ids; their *_name companions are only returned when the request
asks for them with include_fields.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
name |
str | None
|
|
project |
str | None
|
|
project_name |
str | None
|
|
country |
str | None
|
|
country_name |
str | None
|
|
reef_type |
str | None
|
|
reef_type_name |
str | None
|
|
reef_zone |
str | None
|
|
reef_zone_name |
str | None
|
|
exposure |
str | None
|
|
exposure_name |
str | None
|
|
location |
Any
|
|
notes |
str | None
|
|
predecessor |
str | None
|
|
validations |
Any
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
extra |
Mapping[str, Any]
|
|
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
Management
dataclass
¶
Management(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
name: str | None = None,
name_secondary: str | None = None,
project: str | None = None,
project_name: str | None = None,
parties: tuple[str, ...] = (),
compliance: str | None = None,
est_year: int | None = None,
predecessor: str | None = None,
notes: str | None = None,
boundary: Any = None,
size: float | None = None,
rules: str | None = None,
no_take: bool | None = None,
periodic_closure: bool | None = None,
open_access: bool | None = None,
size_limits: bool | None = None,
gear_restriction: bool | None = None,
species_restriction: bool | None = None,
access_restriction: bool | None = None,
validations: Any = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
)
Bases: APIModel
A management regime (GET /managements/).
rules is the API's comma-separated summary of the seven rule flags below it;
rule_flags turns those flags back into
a mapping.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
name |
str | None
|
|
name_secondary |
str | None
|
|
project |
str | None
|
|
project_name |
str | None
|
|
parties |
tuple[str, ...]
|
|
compliance |
str | None
|
|
est_year |
int | None
|
|
predecessor |
str | None
|
|
notes |
str | None
|
|
boundary |
Any
|
|
size |
float | None
|
|
rules |
str | None
|
|
no_take |
bool | None
|
|
periodic_closure |
bool | None
|
|
open_access |
bool | None
|
|
size_limits |
bool | None
|
|
gear_restriction |
bool | None
|
|
species_restriction |
bool | None
|
|
access_restriction |
bool | None
|
|
validations |
Any
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
RULE_FIELDS |
|
|
rule_flags |
dict[str, bool | None]
|
The individual management rules, keyed by name. |
extra |
Mapping[str, Any]
|
|
parties
class-attribute
instance-attribute
¶
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
RULE_FIELDS
class-attribute
instance-attribute
¶
RULE_FIELDS = (
"no_take",
"periodic_closure",
"open_access",
"size_limits",
"gear_restriction",
"species_restriction",
"access_restriction",
)
rule_flags
property
¶
The individual management rules, keyed by name.
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
ProjectTag
dataclass
¶
ProjectTag(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
name: str | None = None,
slug: str | None = None,
description: str | None = None,
status: int | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
)
Bases: APIModel
An organisation tag projects can be labelled with (GET /projecttags/).
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
name |
str | None
|
|
slug |
str | None
|
|
description |
str | None
|
|
status |
int | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
extra |
Mapping[str, Any]
|
|
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
FishSize
dataclass
¶
FishSize(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
name: str | None = None,
val: float | None = None,
min_val: float | None = None,
max_val: float | None = None,
fish_bin_size: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
)
Bases: APIModel
One bin of a fish size bin set (GET /fishsizes/).
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
name |
str | None
|
|
val |
float | None
|
|
min_val |
float | None
|
|
max_val |
float | None
|
|
fish_bin_size |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
extra |
Mapping[str, Any]
|
|
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
FishFamily
dataclass
¶
FishFamily(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
name: str | None = None,
status: int | None = None,
biomass_constant_a: float | None = None,
biomass_constant_b: float | None = None,
biomass_constant_c: float | None = None,
regions: tuple[str, ...] = (),
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
)
Bases: APIModel
A fish family (GET /fishfamilies/).
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
name |
str | None
|
|
status |
int | None
|
|
biomass_constant_a |
float | None
|
|
biomass_constant_b |
float | None
|
|
biomass_constant_c |
float | None
|
|
regions |
tuple[str, ...]
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
extra |
Mapping[str, Any]
|
|
regions
class-attribute
instance-attribute
¶
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
FishGenus
dataclass
¶
FishGenus(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
name: str | None = None,
status: int | None = None,
family: str | None = None,
biomass_constant_a: float | None = None,
biomass_constant_b: float | None = None,
biomass_constant_c: float | None = None,
regions: tuple[str, ...] = (),
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
)
Bases: APIModel
A fish genus (GET /fishgenera/).
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
name |
str | None
|
|
status |
int | None
|
|
family |
str | None
|
|
biomass_constant_a |
float | None
|
|
biomass_constant_b |
float | None
|
|
biomass_constant_c |
float | None
|
|
regions |
tuple[str, ...]
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
extra |
Mapping[str, Any]
|
|
regions
class-attribute
instance-attribute
¶
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
FishSpecies
dataclass
¶
FishSpecies(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
name: str | None = None,
display_name: str | None = None,
status: int | None = None,
genus: str | None = None,
biomass_constant_a: float | None = None,
biomass_constant_b: float | None = None,
biomass_constant_c: float | None = None,
vulnerability: float | None = None,
max_length: float | None = None,
max_length_type: str | None = None,
trophic_level: float | None = None,
climate_score: float | None = None,
group_size: str | None = None,
trophic_group: str | None = None,
functional_group: str | None = None,
regions: tuple[str, ...] = (),
notes: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
)
Bases: APIModel
A fish species (GET /fishspecies/).
name is the specific epithet only; display_name is the binomial the
API composes from the genus.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
name |
str | None
|
|
display_name |
str | None
|
|
status |
int | None
|
|
genus |
str | None
|
|
biomass_constant_a |
float | None
|
|
biomass_constant_b |
float | None
|
|
biomass_constant_c |
float | None
|
|
vulnerability |
float | None
|
|
max_length |
float | None
|
|
max_length_type |
str | None
|
|
trophic_level |
float | None
|
|
climate_score |
float | None
|
|
group_size |
str | None
|
|
trophic_group |
str | None
|
|
functional_group |
str | None
|
|
regions |
tuple[str, ...]
|
|
notes |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
extra |
Mapping[str, Any]
|
|
regions
class-attribute
instance-attribute
¶
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
BenthicAttribute
dataclass
¶
BenthicAttribute(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
name: str | None = None,
status: int | None = None,
parent: str | None = None,
top_level_category: str | None = None,
regions: tuple[str, ...] = (),
life_histories: tuple[str, ...] = (),
growth_form_life_histories: tuple[
Mapping[str, Any], ...
] = (),
notes: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
)
Bases: APIModel
A benthic attribute (GET /benthicattributes/).
Attributes form a tree: parent points at the enclosing attribute and
top_level_category at the root of that tree.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
name |
str | None
|
|
status |
int | None
|
|
parent |
str | None
|
|
top_level_category |
str | None
|
|
regions |
tuple[str, ...]
|
|
life_histories |
tuple[str, ...]
|
|
growth_form_life_histories |
tuple[Mapping[str, Any], ...]
|
|
notes |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
extra |
Mapping[str, Any]
|
|
regions
class-attribute
instance-attribute
¶
life_histories
class-attribute
instance-attribute
¶
growth_form_life_histories
class-attribute
instance-attribute
¶
growth_form_life_histories: tuple[
Mapping[str, Any], ...
] = field(
default=(), metadata=_api_meta(converter=_mapping_tuple)
)
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
InvertAttribute
dataclass
¶
InvertAttribute(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
name: str | None = None,
status: int | None = None,
taxonomic_rank: str | None = None,
parent: str | None = None,
group_of_interest: str | None = None,
max_length: float | None = None,
max_length_type: str | None = None,
max_length_source: str | None = None,
max_length_url: str | None = None,
notes: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
)
Bases: APIModel
A macroinvertebrate attribute (GET /invertattributes/).
One row per taxon at any rank, flattened: taxonomic_rank says which
rank this is, and the fields that only exist further down the tree (a
species' max_length_source, say) are null for the ranks above it.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
name |
str | None
|
|
status |
int | None
|
|
taxonomic_rank |
str | None
|
|
parent |
str | None
|
|
group_of_interest |
str | None
|
|
max_length |
float | None
|
|
max_length_type |
str | None
|
|
max_length_source |
str | None
|
|
max_length_url |
str | None
|
|
notes |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
extra |
Mapping[str, Any]
|
|
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
InvertSpecies
dataclass
¶
InvertSpecies(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
name: str | None = None,
display_name: str | None = None,
status: int | None = None,
genus: str | None = None,
max_length: float | None = None,
max_length_type: str | None = None,
max_length_source: str | None = None,
max_length_url: str | None = None,
notes: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
)
Bases: APIModel
A macroinvertebrate species (GET /invertspecies/).
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
name |
str | None
|
|
display_name |
str | None
|
|
status |
int | None
|
|
genus |
str | None
|
|
max_length |
float | None
|
|
max_length_type |
str | None
|
|
max_length_source |
str | None
|
|
max_length_url |
str | None
|
|
notes |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
extra |
Mapping[str, Any]
|
|
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
SummarySampleEvent
dataclass
¶
SummarySampleEvent(
extra: Mapping[str, Any] = dict(),
sample_event_id: str | None = None,
sample_date: date | None = None,
site_id: str | None = None,
site_name: str | None = None,
site_notes: str | None = None,
latitude: float | None = None,
longitude: float | None = None,
country_id: str | None = None,
country_name: str | None = None,
reef_type: str | None = None,
reef_zone: str | None = None,
reef_exposure: str | None = None,
depth_avg: float | None = None,
depth_sd: float | None = None,
project_id: str | None = None,
project_name: str | None = None,
project_notes: str | None = None,
project_includes_gfcr: bool | None = None,
project_admins: tuple[Mapping[str, Any], ...] = (),
tags: tuple[Mapping[str, Any], ...] = (),
observers: tuple[Mapping[str, Any], ...] = (),
management_id: str | None = None,
management_name: str | None = None,
management_est_year: int | None = None,
management_size: float | None = None,
management_parties: tuple[str, ...] = (),
management_compliance: str | None = None,
management_rules: tuple[str, ...] = (),
management_notes: str | None = None,
protocols: Mapping[str, Any] = dict(),
contact_link: str | None = None,
suggested_citation: str | None = None,
data_policy_beltfish: str | None = None,
data_policy_benthiclit: str | None = None,
data_policy_benthicpit: str | None = None,
data_policy_benthicpqt: str | None = None,
data_policy_bleachingqc: str | None = None,
data_policy_habitatcomplexity: str | None = None,
data_policy_macroinvertebrate: str | None = None,
)
Bases: APIModel
A public summary of one sample event (GET /summarysampleevents/).
The per-protocol aggregates stay in protocols, a mapping of protocol
name (beltfish, benthicpit, ...) to that protocol's summary statistics, which
vary by protocol and grow over time.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
sample_event_id |
str | None
|
|
sample_date |
date | None
|
|
site_id |
str | None
|
|
site_name |
str | None
|
|
site_notes |
str | None
|
|
latitude |
float | None
|
|
longitude |
float | None
|
|
country_id |
str | None
|
|
country_name |
str | None
|
|
reef_type |
str | None
|
|
reef_zone |
str | None
|
|
reef_exposure |
str | None
|
|
depth_avg |
float | None
|
|
depth_sd |
float | None
|
|
project_id |
str | None
|
|
project_name |
str | None
|
|
project_notes |
str | None
|
|
project_includes_gfcr |
bool | None
|
|
project_admins |
tuple[Mapping[str, Any], ...]
|
|
tags |
tuple[Mapping[str, Any], ...]
|
|
observers |
tuple[Mapping[str, Any], ...]
|
|
management_id |
str | None
|
|
management_name |
str | None
|
|
management_est_year |
int | None
|
|
management_size |
float | None
|
|
management_parties |
tuple[str, ...]
|
|
management_compliance |
str | None
|
|
management_rules |
tuple[str, ...]
|
|
management_notes |
str | None
|
|
protocols |
Mapping[str, Any]
|
|
contact_link |
str | None
|
|
suggested_citation |
str | None
|
|
data_policy_beltfish |
str | None
|
|
data_policy_benthiclit |
str | None
|
|
data_policy_benthicpit |
str | None
|
|
data_policy_benthicpqt |
str | None
|
|
data_policy_bleachingqc |
str | None
|
|
data_policy_habitatcomplexity |
str | None
|
|
data_policy_macroinvertebrate |
str | None
|
|
data_policies |
dict[str, str | None]
|
The per-protocol data sharing policies, keyed by protocol name. |
extra |
Mapping[str, Any]
|
|
sample_date
class-attribute
instance-attribute
¶
sample_date: date | None = field(
default=None, metadata=_api_meta(converter=parse_date)
)
project_includes_gfcr
class-attribute
instance-attribute
¶
project_admins
class-attribute
instance-attribute
¶
project_admins: tuple[Mapping[str, Any], ...] = field(
default=(), metadata=_api_meta(converter=_mapping_tuple)
)
tags
class-attribute
instance-attribute
¶
tags: tuple[Mapping[str, Any], ...] = field(
default=(), metadata=_api_meta(converter=_mapping_tuple)
)
observers
class-attribute
instance-attribute
¶
observers: tuple[Mapping[str, Any], ...] = field(
default=(), metadata=_api_meta(converter=_mapping_tuple)
)
management_parties
class-attribute
instance-attribute
¶
management_parties: tuple[str, ...] = field(
default=(), metadata=_api_meta(converter=_string_tuple)
)
management_rules
class-attribute
instance-attribute
¶
management_rules: tuple[str, ...] = field(
default=(), metadata=_api_meta(converter=_string_tuple)
)
protocols
class-attribute
instance-attribute
¶
protocols: Mapping[str, Any] = field(
default_factory=dict,
metadata=_api_meta(converter=_mapping),
)
data_policy_benthiclit
class-attribute
instance-attribute
¶
data_policy_benthicpit
class-attribute
instance-attribute
¶
data_policy_benthicpqt
class-attribute
instance-attribute
¶
data_policy_bleachingqc
class-attribute
instance-attribute
¶
data_policy_habitatcomplexity
class-attribute
instance-attribute
¶
data_policy_macroinvertebrate
class-attribute
instance-attribute
¶
data_policies
property
¶
The per-protocol data sharing policies, keyed by protocol name.
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
LabelMapping
dataclass
¶
LabelMapping(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
benthic_attribute_id: str | None = None,
benthic_attribute_name: str | None = None,
growth_form_id: str | None = None,
growth_form_name: str | None = None,
provider: str | None = None,
provider_id: str | None = None,
provider_label: str | None = None,
)
Bases: APIModel
A provider label mapped onto a MERMAID benthic attribute.
GET /classification/labelmappings/: how an image classification
provider's own label lines up with a MERMAID attribute and growth form.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
benthic_attribute_id |
str | None
|
|
benthic_attribute_name |
str | None
|
|
growth_form_id |
str | None
|
|
growth_form_name |
str | None
|
|
provider |
str | None
|
|
provider_id |
str | None
|
|
provider_label |
str | None
|
|
extra |
Mapping[str, Any]
|
|
benthic_attribute_name
class-attribute
instance-attribute
¶
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
SampleEvent
dataclass
¶
SampleEvent(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
site: str | None = None,
management: str | None = None,
sample_date: date | None = None,
notes: str | None = None,
validations: Any = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
)
Bases: APIModel
A site visited on a date under a management regime.
GET /projects/{project_id}/sampleevents/. Every sample unit belongs to
one of these; site and management hold ids of records listed by
the project's ProjectContext.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
site |
str | None
|
|
management |
str | None
|
|
sample_date |
date | None
|
|
notes |
str | None
|
|
validations |
Any
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
extra |
Mapping[str, Any]
|
|
sample_date
class-attribute
instance-attribute
¶
sample_date: date | None = field(
default=None, metadata=_api_meta(converter=parse_date)
)
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
Observer
dataclass
¶
Observer(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
transectmethod: str | None = None,
profile: str | None = None,
profile_name: str | None = None,
rank: int | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
)
Bases: APIModel
A profile credited with one sample unit method.
GET /projects/{project_id}/observers/. transectmethod is the id of
the method record the observer worked on.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
transectmethod |
str | None
|
|
profile |
str | None
|
|
profile_name |
str | None
|
|
rank |
int | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
extra |
Mapping[str, Any]
|
|
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
ProjectProfile
dataclass
¶
ProjectProfile(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
project: str | None = None,
profile: str | None = None,
profile_name: str | None = None,
email: str | None = None,
role: int | None = None,
is_admin: bool | None = None,
is_collector: bool | None = None,
picture: str | None = None,
num_active_sample_units: int | None = None,
num_account_connections: int | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
)
Bases: APIModel
A profile's membership of one project.
GET /projects/{project_id}/project_profiles/. role is the numeric role (90
admin, 50 collector, 10 read-only), summarised by
is_admin and
is_collector.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
project |
str | None
|
|
profile |
str | None
|
|
profile_name |
str | None
|
|
email |
str | None
|
|
role |
int | None
|
|
is_admin |
bool | None
|
|
is_collector |
bool | None
|
|
picture |
str | None
|
|
num_active_sample_units |
int | None
|
|
num_account_connections |
int | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
extra |
Mapping[str, Any]
|
|
num_active_sample_units
class-attribute
instance-attribute
¶
num_account_connections
class-attribute
instance-attribute
¶
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
SampleUnit
dataclass
¶
SampleUnit(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
sample_event: str | None = None,
label: str | None = None,
depth: float | None = None,
sample_time: str | None = None,
visibility: str | None = None,
current: str | None = None,
relative_depth: str | None = None,
tide: str | None = None,
notes: str | None = None,
collect_record_id: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
)
Bases: APIModel
What every transect and quadrat collection has in common.
The choice fields (visibility, current, relative_depth,
tide) hold ids from /choices/; sample_event holds the id of the
SampleEvent the unit was recorded under.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
sample_event |
str | None
|
|
label |
str | None
|
|
depth |
float | None
|
|
sample_time |
str | None
|
|
visibility |
str | None
|
|
current |
str | None
|
|
relative_depth |
str | None
|
|
tide |
str | None
|
|
notes |
str | None
|
|
collect_record_id |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
extra |
Mapping[str, Any]
|
|
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
Transect
dataclass
¶
Transect(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
sample_event: str | None = None,
label: str | None = None,
depth: float | None = None,
sample_time: str | None = None,
visibility: str | None = None,
current: str | None = None,
relative_depth: str | None = None,
tide: str | None = None,
notes: str | None = None,
collect_record_id: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
number: int | None = None,
len_surveyed: float | None = None,
reef_slope: str | None = None,
)
Bases: SampleUnit
A numbered transect of a surveyed length.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
number |
int | None
|
|
len_surveyed |
float | None
|
|
reef_slope |
str | None
|
|
extra |
Mapping[str, Any]
|
|
id |
str | None
|
|
sample_event |
str | None
|
|
label |
str | None
|
|
depth |
float | None
|
|
sample_time |
str | None
|
|
visibility |
str | None
|
|
current |
str | None
|
|
relative_depth |
str | None
|
|
tide |
str | None
|
|
notes |
str | None
|
|
collect_record_id |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
extra
class-attribute
instance-attribute
¶
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
FishBeltTransect
dataclass
¶
FishBeltTransect(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
sample_event: str | None = None,
label: str | None = None,
depth: float | None = None,
sample_time: str | None = None,
visibility: str | None = None,
current: str | None = None,
relative_depth: str | None = None,
tide: str | None = None,
notes: str | None = None,
collect_record_id: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
number: int | None = None,
len_surveyed: float | None = None,
reef_slope: str | None = None,
width: str | None = None,
size_bin: str | None = None,
)
Bases: Transect
A fish belt transect (/projects/{project_id}/fishbelttransects/).
width and size_bin hold ids of the belt width and fish size bin the
transect was surveyed with.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
width |
str | None
|
|
size_bin |
str | None
|
|
extra |
Mapping[str, Any]
|
|
id |
str | None
|
|
sample_event |
str | None
|
|
label |
str | None
|
|
depth |
float | None
|
|
sample_time |
str | None
|
|
visibility |
str | None
|
|
current |
str | None
|
|
relative_depth |
str | None
|
|
tide |
str | None
|
|
notes |
str | None
|
|
collect_record_id |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
number |
int | None
|
|
len_surveyed |
float | None
|
|
reef_slope |
str | None
|
|
extra
class-attribute
instance-attribute
¶
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
BenthicTransect
dataclass
¶
BenthicTransect(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
sample_event: str | None = None,
label: str | None = None,
depth: float | None = None,
sample_time: str | None = None,
visibility: str | None = None,
current: str | None = None,
relative_depth: str | None = None,
tide: str | None = None,
notes: str | None = None,
collect_record_id: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
number: int | None = None,
len_surveyed: float | None = None,
reef_slope: str | None = None,
)
Bases: Transect
A benthic transect (/projects/{project_id}/benthictransects/).
Shared by the benthic LIT, benthic PIT and habitat complexity protocols.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
extra |
Mapping[str, Any]
|
|
id |
str | None
|
|
sample_event |
str | None
|
|
label |
str | None
|
|
depth |
float | None
|
|
sample_time |
str | None
|
|
visibility |
str | None
|
|
current |
str | None
|
|
relative_depth |
str | None
|
|
tide |
str | None
|
|
notes |
str | None
|
|
collect_record_id |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
number |
int | None
|
|
len_surveyed |
float | None
|
|
reef_slope |
str | None
|
|
extra
class-attribute
instance-attribute
¶
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
InvertBeltTransect
dataclass
¶
InvertBeltTransect(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
sample_event: str | None = None,
label: str | None = None,
depth: float | None = None,
sample_time: str | None = None,
visibility: str | None = None,
current: str | None = None,
relative_depth: str | None = None,
tide: str | None = None,
notes: str | None = None,
collect_record_id: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
number: int | None = None,
len_surveyed: float | None = None,
reef_slope: str | None = None,
width: str | None = None,
size_bin: str | None = None,
)
Bases: Transect
A macroinvertebrate belt transect, as nested in a method payload.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
width |
str | None
|
|
size_bin |
str | None
|
|
extra |
Mapping[str, Any]
|
|
id |
str | None
|
|
sample_event |
str | None
|
|
label |
str | None
|
|
depth |
float | None
|
|
sample_time |
str | None
|
|
visibility |
str | None
|
|
current |
str | None
|
|
relative_depth |
str | None
|
|
tide |
str | None
|
|
notes |
str | None
|
|
collect_record_id |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
number |
int | None
|
|
len_surveyed |
float | None
|
|
reef_slope |
str | None
|
|
extra
class-attribute
instance-attribute
¶
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
QuadratTransect
dataclass
¶
QuadratTransect(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
sample_event: str | None = None,
label: str | None = None,
depth: float | None = None,
sample_time: str | None = None,
visibility: str | None = None,
current: str | None = None,
relative_depth: str | None = None,
tide: str | None = None,
notes: str | None = None,
collect_record_id: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
number: int | None = None,
len_surveyed: float | None = None,
reef_slope: str | None = None,
quadrat_size: float | None = None,
num_quadrats: int | None = None,
num_points_per_quadrat: int | None = None,
quadrat_number_start: int | None = None,
)
Bases: Transect
A benthic photo quadrat transect, as nested in a method payload.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
quadrat_size |
float | None
|
|
num_quadrats |
int | None
|
|
num_points_per_quadrat |
int | None
|
|
quadrat_number_start |
int | None
|
|
extra |
Mapping[str, Any]
|
|
id |
str | None
|
|
sample_event |
str | None
|
|
label |
str | None
|
|
depth |
float | None
|
|
sample_time |
str | None
|
|
visibility |
str | None
|
|
current |
str | None
|
|
relative_depth |
str | None
|
|
tide |
str | None
|
|
notes |
str | None
|
|
collect_record_id |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
number |
int | None
|
|
len_surveyed |
float | None
|
|
reef_slope |
str | None
|
|
num_points_per_quadrat
class-attribute
instance-attribute
¶
extra
class-attribute
instance-attribute
¶
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
QuadratCollection
dataclass
¶
QuadratCollection(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
sample_event: str | None = None,
label: str | None = None,
depth: float | None = None,
sample_time: str | None = None,
visibility: str | None = None,
current: str | None = None,
relative_depth: str | None = None,
tide: str | None = None,
notes: str | None = None,
collect_record_id: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
quadrat_size: float | None = None,
)
Bases: SampleUnit
A bleaching quadrat collection, as nested in a method payload.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
quadrat_size |
float | None
|
|
extra |
Mapping[str, Any]
|
|
id |
str | None
|
|
sample_event |
str | None
|
|
label |
str | None
|
|
depth |
float | None
|
|
sample_time |
str | None
|
|
visibility |
str | None
|
|
current |
str | None
|
|
relative_depth |
str | None
|
|
tide |
str | None
|
|
notes |
str | None
|
|
collect_record_id |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
extra
class-attribute
instance-attribute
¶
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
SampleUnitMethod
dataclass
¶
SampleUnitMethod(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
sample_event: SampleEvent | None = None,
observers: tuple[Observer, ...] = (),
collect_record_id: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
)
Bases: APIModel
One protocol recorded on one sample unit.
Subclasses name the protocol's sample unit and its observation lists; the
observations themselves stay as plain dictionaries, since they carry a row per fish,
point or colony and their columns differ by protocol.
sample_unit and observations reach both without
knowing which protocol is in hand.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
sample_event |
SampleEvent | None
|
|
observers |
tuple[Observer, ...]
|
|
collect_record_id |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
SAMPLE_UNIT_FIELD |
str
|
|
sample_unit |
SampleUnit | None
|
The transect or quadrat collection the protocol was recorded on. |
observations |
dict[str, tuple[Mapping[str, Any], ...]]
|
The protocol's observation lists, keyed by their |
extra |
Mapping[str, Any]
|
|
sample_event
class-attribute
instance-attribute
¶
sample_event: SampleEvent | None = field(
default=None,
metadata=_api_meta(converter=_model(SampleEvent)),
)
observers
class-attribute
instance-attribute
¶
observers: tuple[Observer, ...] = field(
default=(),
metadata=_api_meta(converter=_model_tuple(Observer)),
)
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
sample_unit
property
¶
sample_unit: SampleUnit | None
The transect or quadrat collection the protocol was recorded on.
observations
property
¶
The protocol's observation lists, keyed by their obs_* field name.
Lists the API adds later are picked up too, since they land in
extra.
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
BeltFishMethod
dataclass
¶
BeltFishMethod(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
sample_event: SampleEvent | None = None,
observers: tuple[Observer, ...] = (),
collect_record_id: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
fishbelt_transect: FishBeltTransect | None = None,
obs_belt_fishes: tuple[Mapping[str, Any], ...] = (),
)
Bases: SampleUnitMethod
A fish belt survey (/projects/{project_id}/beltfishtransectmethods/).
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
fishbelt_transect |
FishBeltTransect | None
|
|
obs_belt_fishes |
tuple[Mapping[str, Any], ...]
|
|
SAMPLE_UNIT_FIELD |
|
|
extra |
Mapping[str, Any]
|
|
id |
str | None
|
|
sample_event |
SampleEvent | None
|
|
observers |
tuple[Observer, ...]
|
|
collect_record_id |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
sample_unit |
SampleUnit | None
|
The transect or quadrat collection the protocol was recorded on. |
observations |
dict[str, tuple[Mapping[str, Any], ...]]
|
The protocol's observation lists, keyed by their |
fishbelt_transect
class-attribute
instance-attribute
¶
fishbelt_transect: FishBeltTransect | None = field(
default=None,
metadata=_api_meta(converter=_model(FishBeltTransect)),
)
obs_belt_fishes
class-attribute
instance-attribute
¶
obs_belt_fishes: tuple[Mapping[str, Any], ...] = field(
default=(), metadata=_api_meta(converter=_mapping_tuple)
)
extra
class-attribute
instance-attribute
¶
sample_event
class-attribute
instance-attribute
¶
sample_event: SampleEvent | None = field(
default=None,
metadata=_api_meta(converter=_model(SampleEvent)),
)
observers
class-attribute
instance-attribute
¶
observers: tuple[Observer, ...] = field(
default=(),
metadata=_api_meta(converter=_model_tuple(Observer)),
)
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
sample_unit
property
¶
sample_unit: SampleUnit | None
The transect or quadrat collection the protocol was recorded on.
observations
property
¶
The protocol's observation lists, keyed by their obs_* field name.
Lists the API adds later are picked up too, since they land in
extra.
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
BenthicLITMethod
dataclass
¶
BenthicLITMethod(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
sample_event: SampleEvent | None = None,
observers: tuple[Observer, ...] = (),
collect_record_id: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
benthic_transect: BenthicTransect | None = None,
obs_benthic_lits: tuple[Mapping[str, Any], ...] = (),
)
Bases: SampleUnitMethod
A benthic LIT survey (/projects/{project_id}/benthiclittransectmethods/).
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
benthic_transect |
BenthicTransect | None
|
|
obs_benthic_lits |
tuple[Mapping[str, Any], ...]
|
|
SAMPLE_UNIT_FIELD |
|
|
extra |
Mapping[str, Any]
|
|
id |
str | None
|
|
sample_event |
SampleEvent | None
|
|
observers |
tuple[Observer, ...]
|
|
collect_record_id |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
sample_unit |
SampleUnit | None
|
The transect or quadrat collection the protocol was recorded on. |
observations |
dict[str, tuple[Mapping[str, Any], ...]]
|
The protocol's observation lists, keyed by their |
benthic_transect
class-attribute
instance-attribute
¶
benthic_transect: BenthicTransect | None = field(
default=None,
metadata=_api_meta(converter=_model(BenthicTransect)),
)
obs_benthic_lits
class-attribute
instance-attribute
¶
obs_benthic_lits: tuple[Mapping[str, Any], ...] = field(
default=(), metadata=_api_meta(converter=_mapping_tuple)
)
extra
class-attribute
instance-attribute
¶
sample_event
class-attribute
instance-attribute
¶
sample_event: SampleEvent | None = field(
default=None,
metadata=_api_meta(converter=_model(SampleEvent)),
)
observers
class-attribute
instance-attribute
¶
observers: tuple[Observer, ...] = field(
default=(),
metadata=_api_meta(converter=_model_tuple(Observer)),
)
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
sample_unit
property
¶
sample_unit: SampleUnit | None
The transect or quadrat collection the protocol was recorded on.
observations
property
¶
The protocol's observation lists, keyed by their obs_* field name.
Lists the API adds later are picked up too, since they land in
extra.
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
BenthicPITMethod
dataclass
¶
BenthicPITMethod(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
sample_event: SampleEvent | None = None,
observers: tuple[Observer, ...] = (),
collect_record_id: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
benthic_transect: BenthicTransect | None = None,
interval_size: float | None = None,
interval_start: float | None = None,
obs_benthic_pits: tuple[Mapping[str, Any], ...] = (),
)
Bases: SampleUnitMethod
A benthic PIT survey (/projects/{project_id}/benthicpittransectmethods/).
interval_size and interval_start are in metres along the transect.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
benthic_transect |
BenthicTransect | None
|
|
interval_size |
float | None
|
|
interval_start |
float | None
|
|
obs_benthic_pits |
tuple[Mapping[str, Any], ...]
|
|
SAMPLE_UNIT_FIELD |
|
|
extra |
Mapping[str, Any]
|
|
id |
str | None
|
|
sample_event |
SampleEvent | None
|
|
observers |
tuple[Observer, ...]
|
|
collect_record_id |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
sample_unit |
SampleUnit | None
|
The transect or quadrat collection the protocol was recorded on. |
observations |
dict[str, tuple[Mapping[str, Any], ...]]
|
The protocol's observation lists, keyed by their |
benthic_transect
class-attribute
instance-attribute
¶
benthic_transect: BenthicTransect | None = field(
default=None,
metadata=_api_meta(converter=_model(BenthicTransect)),
)
obs_benthic_pits
class-attribute
instance-attribute
¶
obs_benthic_pits: tuple[Mapping[str, Any], ...] = field(
default=(), metadata=_api_meta(converter=_mapping_tuple)
)
extra
class-attribute
instance-attribute
¶
sample_event
class-attribute
instance-attribute
¶
sample_event: SampleEvent | None = field(
default=None,
metadata=_api_meta(converter=_model(SampleEvent)),
)
observers
class-attribute
instance-attribute
¶
observers: tuple[Observer, ...] = field(
default=(),
metadata=_api_meta(converter=_model_tuple(Observer)),
)
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
sample_unit
property
¶
sample_unit: SampleUnit | None
The transect or quadrat collection the protocol was recorded on.
observations
property
¶
The protocol's observation lists, keyed by their obs_* field name.
Lists the API adds later are picked up too, since they land in
extra.
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
HabitatComplexityMethod
dataclass
¶
HabitatComplexityMethod(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
sample_event: SampleEvent | None = None,
observers: tuple[Observer, ...] = (),
collect_record_id: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
benthic_transect: BenthicTransect | None = None,
interval_size: float | None = None,
interval_start: float | None = None,
obs_habitat_complexities: tuple[
Mapping[str, Any], ...
] = (),
)
Bases: SampleUnitMethod
A habitat complexity survey.
/projects/{project_id}/habitatcomplexitytransectmethods/.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
benthic_transect |
BenthicTransect | None
|
|
interval_size |
float | None
|
|
interval_start |
float | None
|
|
obs_habitat_complexities |
tuple[Mapping[str, Any], ...]
|
|
SAMPLE_UNIT_FIELD |
|
|
extra |
Mapping[str, Any]
|
|
id |
str | None
|
|
sample_event |
SampleEvent | None
|
|
observers |
tuple[Observer, ...]
|
|
collect_record_id |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
sample_unit |
SampleUnit | None
|
The transect or quadrat collection the protocol was recorded on. |
observations |
dict[str, tuple[Mapping[str, Any], ...]]
|
The protocol's observation lists, keyed by their |
benthic_transect
class-attribute
instance-attribute
¶
benthic_transect: BenthicTransect | None = field(
default=None,
metadata=_api_meta(converter=_model(BenthicTransect)),
)
obs_habitat_complexities
class-attribute
instance-attribute
¶
obs_habitat_complexities: tuple[Mapping[str, Any], ...] = (
field(
default=(),
metadata=_api_meta(converter=_mapping_tuple),
)
)
extra
class-attribute
instance-attribute
¶
sample_event
class-attribute
instance-attribute
¶
sample_event: SampleEvent | None = field(
default=None,
metadata=_api_meta(converter=_model(SampleEvent)),
)
observers
class-attribute
instance-attribute
¶
observers: tuple[Observer, ...] = field(
default=(),
metadata=_api_meta(converter=_model_tuple(Observer)),
)
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
sample_unit
property
¶
sample_unit: SampleUnit | None
The transect or quadrat collection the protocol was recorded on.
observations
property
¶
The protocol's observation lists, keyed by their obs_* field name.
Lists the API adds later are picked up too, since they land in
extra.
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
BenthicPhotoQuadratTransectMethod
dataclass
¶
BenthicPhotoQuadratTransectMethod(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
sample_event: SampleEvent | None = None,
observers: tuple[Observer, ...] = (),
collect_record_id: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
quadrat_transect: QuadratTransect | None = None,
image_classification: bool | None = None,
images: tuple[Mapping[str, Any], ...] = (),
obs_benthic_photo_quadrats: tuple[
Mapping[str, Any], ...
] = (),
)
Bases: SampleUnitMethod
A benthic photo quadrat survey.
/projects/{project_id}/benthicphotoquadrattransectmethods/. When the
observations came from an image classifier, image_classification is
true and images describes the classified photos.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
quadrat_transect |
QuadratTransect | None
|
|
image_classification |
bool | None
|
|
images |
tuple[Mapping[str, Any], ...]
|
|
obs_benthic_photo_quadrats |
tuple[Mapping[str, Any], ...]
|
|
SAMPLE_UNIT_FIELD |
|
|
extra |
Mapping[str, Any]
|
|
id |
str | None
|
|
sample_event |
SampleEvent | None
|
|
observers |
tuple[Observer, ...]
|
|
collect_record_id |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
sample_unit |
SampleUnit | None
|
The transect or quadrat collection the protocol was recorded on. |
observations |
dict[str, tuple[Mapping[str, Any], ...]]
|
The protocol's observation lists, keyed by their |
quadrat_transect
class-attribute
instance-attribute
¶
quadrat_transect: QuadratTransect | None = field(
default=None,
metadata=_api_meta(converter=_model(QuadratTransect)),
)
images
class-attribute
instance-attribute
¶
images: tuple[Mapping[str, Any], ...] = field(
default=(), metadata=_api_meta(converter=_mapping_tuple)
)
obs_benthic_photo_quadrats
class-attribute
instance-attribute
¶
obs_benthic_photo_quadrats: tuple[
Mapping[str, Any], ...
] = field(
default=(), metadata=_api_meta(converter=_mapping_tuple)
)
extra
class-attribute
instance-attribute
¶
sample_event
class-attribute
instance-attribute
¶
sample_event: SampleEvent | None = field(
default=None,
metadata=_api_meta(converter=_model(SampleEvent)),
)
observers
class-attribute
instance-attribute
¶
observers: tuple[Observer, ...] = field(
default=(),
metadata=_api_meta(converter=_model_tuple(Observer)),
)
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
sample_unit
property
¶
sample_unit: SampleUnit | None
The transect or quadrat collection the protocol was recorded on.
observations
property
¶
The protocol's observation lists, keyed by their obs_* field name.
Lists the API adds later are picked up too, since they land in
extra.
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
BleachingQuadratCollectionMethod
dataclass
¶
BleachingQuadratCollectionMethod(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
sample_event: SampleEvent | None = None,
observers: tuple[Observer, ...] = (),
collect_record_id: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
quadrat_collection: QuadratCollection | None = None,
obs_colonies_bleached: tuple[
Mapping[str, Any], ...
] = (),
obs_quadrat_benthic_percent: tuple[
Mapping[str, Any], ...
] = (),
)
Bases: SampleUnitMethod
A bleaching quadrat collection survey.
/projects/{project_id}/bleachingquadratcollectionmethods/. This is the
one protocol with two observation lists: the bleached colony counts and the
per-quadrat benthic percentages.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
quadrat_collection |
QuadratCollection | None
|
|
obs_colonies_bleached |
tuple[Mapping[str, Any], ...]
|
|
obs_quadrat_benthic_percent |
tuple[Mapping[str, Any], ...]
|
|
SAMPLE_UNIT_FIELD |
|
|
extra |
Mapping[str, Any]
|
|
id |
str | None
|
|
sample_event |
SampleEvent | None
|
|
observers |
tuple[Observer, ...]
|
|
collect_record_id |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
sample_unit |
SampleUnit | None
|
The transect or quadrat collection the protocol was recorded on. |
observations |
dict[str, tuple[Mapping[str, Any], ...]]
|
The protocol's observation lists, keyed by their |
quadrat_collection
class-attribute
instance-attribute
¶
quadrat_collection: QuadratCollection | None = field(
default=None,
metadata=_api_meta(converter=_model(QuadratCollection)),
)
obs_colonies_bleached
class-attribute
instance-attribute
¶
obs_colonies_bleached: tuple[Mapping[str, Any], ...] = (
field(
default=(),
metadata=_api_meta(converter=_mapping_tuple),
)
)
obs_quadrat_benthic_percent
class-attribute
instance-attribute
¶
obs_quadrat_benthic_percent: tuple[
Mapping[str, Any], ...
] = field(
default=(), metadata=_api_meta(converter=_mapping_tuple)
)
extra
class-attribute
instance-attribute
¶
sample_event
class-attribute
instance-attribute
¶
sample_event: SampleEvent | None = field(
default=None,
metadata=_api_meta(converter=_model(SampleEvent)),
)
observers
class-attribute
instance-attribute
¶
observers: tuple[Observer, ...] = field(
default=(),
metadata=_api_meta(converter=_model_tuple(Observer)),
)
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
sample_unit
property
¶
sample_unit: SampleUnit | None
The transect or quadrat collection the protocol was recorded on.
observations
property
¶
The protocol's observation lists, keyed by their obs_* field name.
Lists the API adds later are picked up too, since they land in
extra.
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
BeltInvertMethod
dataclass
¶
BeltInvertMethod(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
sample_event: SampleEvent | None = None,
observers: tuple[Observer, ...] = (),
collect_record_id: str | None = None,
created_on: datetime | None = None,
updated_on: datetime | None = None,
created_by: str | None = None,
updated_by: str | None = None,
beltinvert_transect: InvertBeltTransect | None = None,
obs_belt_inverts: tuple[Mapping[str, Any], ...] = (),
)
Bases: SampleUnitMethod
A macroinvertebrate belt survey.
/projects/{project_id}/beltinverttransectmethods/.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
beltinvert_transect |
InvertBeltTransect | None
|
|
obs_belt_inverts |
tuple[Mapping[str, Any], ...]
|
|
SAMPLE_UNIT_FIELD |
|
|
extra |
Mapping[str, Any]
|
|
id |
str | None
|
|
sample_event |
SampleEvent | None
|
|
observers |
tuple[Observer, ...]
|
|
collect_record_id |
str | None
|
|
created_on |
datetime | None
|
|
updated_on |
datetime | None
|
|
created_by |
str | None
|
|
updated_by |
str | None
|
|
sample_unit |
SampleUnit | None
|
The transect or quadrat collection the protocol was recorded on. |
observations |
dict[str, tuple[Mapping[str, Any], ...]]
|
The protocol's observation lists, keyed by their |
beltinvert_transect
class-attribute
instance-attribute
¶
beltinvert_transect: InvertBeltTransect | None = field(
default=None,
metadata=_api_meta(
converter=_model(InvertBeltTransect)
),
)
obs_belt_inverts
class-attribute
instance-attribute
¶
obs_belt_inverts: tuple[Mapping[str, Any], ...] = field(
default=(), metadata=_api_meta(converter=_mapping_tuple)
)
extra
class-attribute
instance-attribute
¶
sample_event
class-attribute
instance-attribute
¶
sample_event: SampleEvent | None = field(
default=None,
metadata=_api_meta(converter=_model(SampleEvent)),
)
observers
class-attribute
instance-attribute
¶
observers: tuple[Observer, ...] = field(
default=(),
metadata=_api_meta(converter=_model_tuple(Observer)),
)
created_on
class-attribute
instance-attribute
¶
created_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
updated_on
class-attribute
instance-attribute
¶
updated_on: datetime | None = field(
default=None,
metadata=_api_meta(converter=parse_datetime),
)
sample_unit
property
¶
sample_unit: SampleUnit | None
The transect or quadrat collection the protocol was recorded on.
observations
property
¶
The protocol's observation lists, keyed by their obs_* field name.
Lists the API adds later are picked up too, since they land in
extra.
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
AggregatedRecord
dataclass
¶
AggregatedRecord(
extra: Mapping[str, Any] = dict(),
id: str | None = None,
project_id: str | None = None,
project_name: str | None = None,
site_id: str | None = None,
site_name: str | None = None,
sample_date: date | None = None,
management_id: str | None = None,
sample_event_id: str | None = None,
)
Bases: APIModel
One row from an aggregated view, kept deliberately thin.
The observation, sample unit and sample event views under
/projects/{project_id}/beltfishes/, /benthicpits/ and their siblings return
wide, flat records: one row per observation (or per sample unit, or per sample
event) with every site, management and protocol column already joined in. The
columns differ per protocol, per view and per API release, so only the handful
shared by all of them is declared here; the rest arrives in
APIModel.extra and
APIModel.to_dict flattens it back out,
which is what to_df() turns into one DataFrame column per field.
The sample unit views have no id (they carry sample_unit_ids in
extra instead), so
id is None on those rows.
Methods:
| Name | Description |
|---|---|
from_api |
Build an instance from a decoded JSON object. |
to_dict |
Flatten the model into a plain dict, suitable for a DataFrame row. |
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
|
project_id |
str | None
|
|
project_name |
str | None
|
|
site_id |
str | None
|
|
site_name |
str | None
|
|
sample_date |
date | None
|
|
management_id |
str | None
|
|
sample_event_id |
str | None
|
|
extra |
Mapping[str, Any]
|
|
sample_date
class-attribute
instance-attribute
¶
sample_date: date | None = field(
default=None, metadata=_api_meta(converter=parse_date)
)
extra
class-attribute
instance-attribute
¶
from_api
classmethod
¶
Build an instance from a decoded JSON object.
Keys the model does not declare are preserved in
extra. A value that fails conversion is
left in extra under its original key and
the declared field keeps its default, so nothing is silently dropped. Converters
also run for explicit JSON nulls, so a null collection becomes an empty tuple
rather than None.
to_dict
¶
Flatten the model into a plain dict, suitable for a DataFrame row.
With include_extra, a field whose value failed conversion exports
the raw value from_api kept in extra, not the
field's default, so the export loses nothing the model holds.
ZonalStatsResult
dataclass
¶
ZonalStatsResult(
stats: Mapping[str, Mapping[str, Any]],
aoi: Mapping[str, Any],
source: str,
label: Any = None,
stac: Mapping[str, Any] | None = None,
)
Statistics for one area of interest against one raster or vector source.
The Zonal Stats API answers with an object keyed by band (band_1) or, for
vector sources, by column name, each holding the requested statistics:
Those keys are dynamic, so this is a plain frozen dataclass rather than an
APIModel: stats holds the response
as sent, and the result reads like a mapping (result["band_1"]["mean"]).
aoi and source record what was asked for, and
label is whatever identifier the caller attached, so a batch of
results can be told apart once flattened.
to_dict gives one wide row (band_1_mean, band_1_count,
...) so to_dataframe works on a list of
results, and to_records gives long (label, source, band, stat, value)
rows for reshaping.
Methods:
| Name | Description |
|---|---|
from_api |
Build a result from a decoded response body. |
keys |
The band or column names in the response, in order. |
items |
|
to_dict |
Flatten into one wide row: |
to_records |
One long |
Attributes:
| Name | Type | Description |
|---|---|---|
stats |
Mapping[str, Mapping[str, Any]]
|
|
aoi |
Mapping[str, Any]
|
|
source |
str
|
|
label |
Any
|
|
stac |
Mapping[str, Any] | None
|
|
from_api
classmethod
¶
from_api(
data: Mapping[str, Any],
*,
aoi: Mapping[str, Any],
source: str,
label: Any = None,
) -> ZonalStatsResult
Build a result from a decoded response body.
Every top-level value must itself be an object of statistics; anything else means the body is not a zonal stats response.
items
¶
(band, statistics) pairs, in response order.
to_dict
¶
Flatten into one wide row: label, source, then <band>_<stat>.
label is always present (None when the caller gave none) so a
DataFrame built from many results has a stable set of columns.
to_records
¶
One long {label, source, band, stat, value} row per statistic.
parse_datetime
¶
Parse an ISO 8601 timestamp as returned by the API.
None passes straight through, so an explicit JSON null yields a null
timestamp instead of an unparseable value.
parse_date
¶
Parse a calendar date (YYYY-MM-DD) as returned by the API.