Filters¶
Filters is a simple dataclass whose fields correspond to filterable attributes
of the CNE station catalog. Every field defaults to None, meaning no constraint
is applied for that dimension. When multiple fields are set, all constraints are
combined with AND logic. Pass a Filters instance to Client.filter_stations(),
Client.fetch_stations(), Client.fetch_bbox(), or Client.fetch_region().
colombia_hydrodata.filters.Filters
dataclass
¶
Represents a set of optional filters for querying hydrological data.
Each field corresponds to a filterable dimension of the dataset. Fields
left as None are excluded from the query and treated as "no filter
applied" for that dimension.
Attributes:
| Name | Type | Description |
|---|---|---|
category |
str | None
|
The category of the hydrological station or record
(e.g. |
department |
str | None
|
The Colombian department where the station is located
(e.g. |
municipality |
str | None
|
The municipality within the department where the
station is located (e.g. |
status |
str | None
|
The operational status of the station
(e.g. |
owner |
str | None
|
The entity that owns or operates the station
(e.g. |
hydrographic_area |
str | None
|
The broad hydrographic area that encompasses the
station (e.g. |
hydrographic_zone |
str | None
|
The hydrographic zone within the hydrographic area
(e.g. |
hydrographic_subzone |
str | None
|
The hydrographic subzone within the hydrographic
zone (e.g. |
to_dict()
¶
Converts the filters to a dictionary, omitting unset fields.
Only fields whose value is not None are included in the result,
making the output suitable for passing directly to query or API
functions that interpret missing keys as "no filter applied".
Returns:
| Type | Description |
|---|---|
dict
|
A dictionary mapping filter field names to their values for all |
dict
|
fields that have been explicitly set (i.e. are not |
options: show_source: false show_root_heading: true show_symbol_type_heading: true show_symbol_type_toc: true members_order: source