hydroserverpy 1.4.0b4__tar.gz → 1.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of hydroserverpy might be problematic. Click here for more details.
- hydroserverpy-1.5.0/PKG-INFO +66 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/README.md +2 -2
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/setup.cfg +6 -3
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/etl_configuration.py +10 -10
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/schedule.py +1 -1
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/status.py +1 -1
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/sta/datastream.py +4 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/sta/observation.py +3 -1
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/sta/datastream.py +4 -1
- hydroserverpy-1.5.0/src/hydroserverpy.egg-info/PKG-INFO +66 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy.egg-info/requires.txt +2 -2
- hydroserverpy-1.4.0b4/PKG-INFO +0 -19
- hydroserverpy-1.4.0b4/src/hydroserverpy.egg-info/PKG-INFO +0 -19
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/LICENSE +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/pyproject.toml +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/setup.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/__init__.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/__init__.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/client.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/__init__.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/base.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/__init__.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/data_archive.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/data_source.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/extractors/__init__.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/extractors/base.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/extractors/ftp_extractor.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/extractors/http_extractor.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/extractors/local_file_extractor.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/factories.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/loaders/__init__.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/loaders/base.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/loaders/hydroserver_loader.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/orchestration_configuration.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/orchestration_system.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/timestamp_parser.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/transformers/__init__.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/transformers/base.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/transformers/csv_transformer.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/transformers/json_transformer.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/types.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/iam/__init__.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/iam/account.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/iam/apikey.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/iam/collaborator.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/iam/role.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/iam/workspace.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/sta/__init__.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/sta/observed_property.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/sta/processing_level.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/sta/result_qualifier.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/sta/sensor.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/sta/thing.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/sta/unit.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/__init__.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/base.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/etl/__init__.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/etl/data_archive.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/etl/data_source.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/etl/orchestration_system.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/iam/__init__.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/iam/role.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/iam/workspace.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/sta/__init__.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/sta/observed_property.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/sta/processing_level.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/sta/result_qualifier.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/sta/sensor.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/sta/thing.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/sta/unit.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/utils.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/quality/__init__.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/quality/service.py +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy.egg-info/SOURCES.txt +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy.egg-info/dependency_links.txt +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy.egg-info/top_level.txt +0 -0
- {hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy.egg-info/zip-safe +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hydroserverpy
|
|
3
|
+
Version: 1.5.0
|
|
4
|
+
Summary: A Python client for managing HydroServer data
|
|
5
|
+
Requires-Python: <4,>=3.9
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: requests>=2
|
|
9
|
+
Requires-Dist: pydantic>=2.6
|
|
10
|
+
Requires-Dist: pydantic[email]>=2.6
|
|
11
|
+
Requires-Dist: pandas>=2.1
|
|
12
|
+
Requires-Dist: numpy>=1.22.4
|
|
13
|
+
Requires-Dist: pyyaml>=5
|
|
14
|
+
Requires-Dist: simplejson>=3
|
|
15
|
+
Requires-Dist: crontab>=1
|
|
16
|
+
Requires-Dist: python-dateutil>=2.8.2
|
|
17
|
+
Requires-Dist: croniter>=2.0.1
|
|
18
|
+
Requires-Dist: jmespath>=1.0.1
|
|
19
|
+
Provides-Extra: docs
|
|
20
|
+
Requires-Dist: sphinx_autodoc_typehints; extra == "docs"
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# HydroServer Python Client
|
|
24
|
+
|
|
25
|
+
The hydroserverpy Python package provides an interface for managing HydroServer data and metadata, loading observations, and performing data quality control. This guide will go over how to install the package and connect to a HydroServer instance. Full hydroserverpy documentation and examples can be found [here](https://hydroserver2.github.io/hydroserver/how-to/hydroserverpy/hydroserverpy-examples.html).
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
You can install the package via pip:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install hydroserverpy
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Connecting to HydroServer
|
|
36
|
+
|
|
37
|
+
To connect to HydroServer, you need to initialize the client with the instance of HydroServer you're using and your user credentials if you want to access and modify your own data. If you don't provide authentication credentials you can read public data, but you will not be able to create or modify any data.
|
|
38
|
+
|
|
39
|
+
### Example: Anonymous User
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from hydroserverpy import HydroServer
|
|
43
|
+
|
|
44
|
+
# Initialize HydroServer connection.
|
|
45
|
+
hs_api = HydroServer(
|
|
46
|
+
host='https://playground.hydroserver.org'
|
|
47
|
+
)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Example: Basic Authentication
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from hydroserverpy import HydroServer
|
|
54
|
+
|
|
55
|
+
# Initialize HydroServer connection with credentials.
|
|
56
|
+
hs_api = HydroServer(
|
|
57
|
+
host='https://playground.hydroserver.org',
|
|
58
|
+
email='user@example.com',
|
|
59
|
+
password='******'
|
|
60
|
+
)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Funding and Acknowledgements
|
|
64
|
+
|
|
65
|
+
Funding for this project was provided by the National Oceanic & Atmospheric Administration (NOAA), awarded to the Cooperative Institute for Research to Operations in Hydrology (CIROH) through the NOAA Cooperative Agreement with The University of Alabama (NA22NWS4320003). Utah State University is a founding member of CIROH and receives funding under subaward from the University of Alabama. Additional funding and support have been provided by the State of Utah Division of Water Rights, the World Meteorological Organization, and the Utah Water Research laboratory at Utah State University.
|
|
66
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# HydroServer Python Client
|
|
2
2
|
|
|
3
|
-
The hydroserverpy Python package provides an interface for managing HydroServer data and metadata, loading observations, and performing data quality control. This guide will go over how to install the package and connect to a HydroServer instance. Full hydroserverpy documentation can be found [here](https://hydroserver2.github.io/hydroserverpy).
|
|
3
|
+
The hydroserverpy Python package provides an interface for managing HydroServer data and metadata, loading observations, and performing data quality control. This guide will go over how to install the package and connect to a HydroServer instance. Full hydroserverpy documentation and examples can be found [here](https://hydroserver2.github.io/hydroserver/how-to/hydroserverpy/hydroserverpy-examples.html).
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -40,5 +40,5 @@ hs_api = HydroServer(
|
|
|
40
40
|
|
|
41
41
|
## Funding and Acknowledgements
|
|
42
42
|
|
|
43
|
-
Funding for this project was provided by the National Oceanic & Atmospheric Administration (NOAA), awarded to the Cooperative Institute for Research to Operations in Hydrology (CIROH) through the NOAA Cooperative Agreement with The University of Alabama (NA22NWS4320003). Utah State University is a founding member of CIROH and receives funding under subaward from the University of Alabama. Additional funding and support have been provided by the State of Utah Division of Water Rights, the World
|
|
43
|
+
Funding for this project was provided by the National Oceanic & Atmospheric Administration (NOAA), awarded to the Cooperative Institute for Research to Operations in Hydrology (CIROH) through the NOAA Cooperative Agreement with The University of Alabama (NA22NWS4320003). Utah State University is a founding member of CIROH and receives funding under subaward from the University of Alabama. Additional funding and support have been provided by the State of Utah Division of Water Rights, the World Meteorological Organization, and the Utah Water Research laboratory at Utah State University.
|
|
44
44
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = hydroserverpy
|
|
3
|
-
version = 1.
|
|
3
|
+
version = 1.5.0
|
|
4
|
+
description = A Python client for managing HydroServer data
|
|
5
|
+
long_description_content_type = text/markdown
|
|
6
|
+
long_description = file: README.md
|
|
4
7
|
|
|
5
8
|
[options]
|
|
6
9
|
package_dir =
|
|
@@ -12,8 +15,8 @@ install_requires =
|
|
|
12
15
|
requests >= 2
|
|
13
16
|
pydantic >= 2.6
|
|
14
17
|
pydantic[email] >= 2.6
|
|
15
|
-
pandas >= 2.
|
|
16
|
-
numpy >=
|
|
18
|
+
pandas >= 2.1
|
|
19
|
+
numpy >= 1.22.4
|
|
17
20
|
pyyaml >= 5
|
|
18
21
|
simplejson >= 3
|
|
19
22
|
crontab >= 1
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/etl_configuration.py
RENAMED
|
@@ -74,7 +74,7 @@ class Timestamp(BaseModel):
|
|
|
74
74
|
timezone: Optional[Union[FixedOffsetTimezone, str]] = Field(None, alias="timezone")
|
|
75
75
|
|
|
76
76
|
class Config:
|
|
77
|
-
|
|
77
|
+
populate_by_name = True
|
|
78
78
|
|
|
79
79
|
@field_validator("timezone")
|
|
80
80
|
def check_timezone(cls, timezone_value, info):
|
|
@@ -96,7 +96,7 @@ class RunTimePlaceholder(BaseModel):
|
|
|
96
96
|
timestamp: Timestamp
|
|
97
97
|
|
|
98
98
|
class Config:
|
|
99
|
-
|
|
99
|
+
populate_by_name = True
|
|
100
100
|
|
|
101
101
|
|
|
102
102
|
PlaceholderVariable = Annotated[
|
|
@@ -114,7 +114,7 @@ class BaseExtractor(BaseModel):
|
|
|
114
114
|
)
|
|
115
115
|
|
|
116
116
|
class Config:
|
|
117
|
-
|
|
117
|
+
populate_by_name = True
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
class HTTPExtractor(BaseExtractor):
|
|
@@ -140,7 +140,7 @@ class JSONTransformer(BaseTransformer):
|
|
|
140
140
|
jmespath: str = Field(..., alias="JMESPath")
|
|
141
141
|
|
|
142
142
|
class Config:
|
|
143
|
-
|
|
143
|
+
populate_by_name = True
|
|
144
144
|
|
|
145
145
|
|
|
146
146
|
class CSVTransformer(BaseTransformer):
|
|
@@ -151,7 +151,7 @@ class CSVTransformer(BaseTransformer):
|
|
|
151
151
|
identifier_type: IdentifierType = Field(..., alias="identifierType")
|
|
152
152
|
|
|
153
153
|
class Config:
|
|
154
|
-
|
|
154
|
+
populate_by_name = True
|
|
155
155
|
|
|
156
156
|
|
|
157
157
|
TransformerConfig = Union[JSONTransformer, CSVTransformer]
|
|
@@ -173,7 +173,7 @@ class ExpressionDataTransformation(BaseModel):
|
|
|
173
173
|
expression: str
|
|
174
174
|
|
|
175
175
|
class Config:
|
|
176
|
-
|
|
176
|
+
populate_by_name = True
|
|
177
177
|
|
|
178
178
|
|
|
179
179
|
class LookupTableDataTransformation(BaseModel):
|
|
@@ -181,7 +181,7 @@ class LookupTableDataTransformation(BaseModel):
|
|
|
181
181
|
lookup_table_id: str = Field(..., alias="lookupTableId")
|
|
182
182
|
|
|
183
183
|
class Config:
|
|
184
|
-
|
|
184
|
+
populate_by_name = True
|
|
185
185
|
|
|
186
186
|
|
|
187
187
|
DataTransformation = Union[ExpressionDataTransformation, LookupTableDataTransformation]
|
|
@@ -194,7 +194,7 @@ class MappingPath(BaseModel):
|
|
|
194
194
|
)
|
|
195
195
|
|
|
196
196
|
class Config:
|
|
197
|
-
|
|
197
|
+
populate_by_name = True
|
|
198
198
|
|
|
199
199
|
|
|
200
200
|
class SourceTargetMapping(BaseModel):
|
|
@@ -202,7 +202,7 @@ class SourceTargetMapping(BaseModel):
|
|
|
202
202
|
paths: List[MappingPath] = Field(default_factory=list)
|
|
203
203
|
|
|
204
204
|
class Config:
|
|
205
|
-
|
|
205
|
+
populate_by_name = True
|
|
206
206
|
|
|
207
207
|
|
|
208
208
|
class Payload(BaseModel):
|
|
@@ -213,7 +213,7 @@ class Payload(BaseModel):
|
|
|
213
213
|
)
|
|
214
214
|
|
|
215
215
|
class Config:
|
|
216
|
-
|
|
216
|
+
populate_by_name = True
|
|
217
217
|
|
|
218
218
|
|
|
219
219
|
class EtlConfiguration(BaseModel):
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/sta/datastream.py
RENAMED
|
@@ -194,6 +194,7 @@ class Datastream(HydroServerBaseModel):
|
|
|
194
194
|
order_by: List[str] = ...,
|
|
195
195
|
phenomenon_time_max: datetime = ...,
|
|
196
196
|
phenomenon_time_min: datetime = ...,
|
|
197
|
+
result_qualifier_code: str = ...,
|
|
197
198
|
fetch_all: bool = False,
|
|
198
199
|
) -> pd.DataFrame:
|
|
199
200
|
"""Retrieve the observations for this datastream."""
|
|
@@ -205,18 +206,21 @@ class Datastream(HydroServerBaseModel):
|
|
|
205
206
|
order_by=order_by,
|
|
206
207
|
phenomenon_time_max=phenomenon_time_max,
|
|
207
208
|
phenomenon_time_min=phenomenon_time_min,
|
|
209
|
+
result_qualifier_code=result_qualifier_code,
|
|
208
210
|
fetch_all=fetch_all
|
|
209
211
|
)
|
|
210
212
|
|
|
211
213
|
def load_observations(
|
|
212
214
|
self,
|
|
213
215
|
observations: pd.DataFrame,
|
|
216
|
+
mode: str = "insert"
|
|
214
217
|
) -> None:
|
|
215
218
|
"""Load a DataFrame of observations to the datastream."""
|
|
216
219
|
|
|
217
220
|
return self.client.datastreams.load_observations(
|
|
218
221
|
uid=self.uid,
|
|
219
222
|
observations=observations,
|
|
223
|
+
mode=mode
|
|
220
224
|
)
|
|
221
225
|
|
|
222
226
|
def delete_observations(
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/sta/observation.py
RENAMED
|
@@ -38,7 +38,9 @@ class ObservationCollection:
|
|
|
38
38
|
data = response.json()
|
|
39
39
|
self.dataframe = pd.DataFrame({to_snake(k): v for k, v in data.items()})
|
|
40
40
|
if "phenomenon_time" in self.dataframe.columns:
|
|
41
|
-
self.dataframe["phenomenon_time"] = pd.to_datetime(
|
|
41
|
+
self.dataframe["phenomenon_time"] = pd.to_datetime(
|
|
42
|
+
self.dataframe["phenomenon_time"], utc=True, format="ISO8601"
|
|
43
|
+
)
|
|
42
44
|
else:
|
|
43
45
|
self.dataframe = pd.DataFrame()
|
|
44
46
|
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/sta/datastream.py
RENAMED
|
@@ -220,6 +220,7 @@ class DatastreamService(HydroServerBaseService):
|
|
|
220
220
|
order_by: List[str] = ...,
|
|
221
221
|
phenomenon_time_max: datetime = ...,
|
|
222
222
|
phenomenon_time_min: datetime = ...,
|
|
223
|
+
result_qualifier_code: str = ...,
|
|
223
224
|
fetch_all: bool = False,
|
|
224
225
|
) -> ObservationCollection:
|
|
225
226
|
"""Retrieve observations of a datastream."""
|
|
@@ -230,6 +231,7 @@ class DatastreamService(HydroServerBaseService):
|
|
|
230
231
|
"order_by": ",".join(order_by) if order_by is not ... else order_by,
|
|
231
232
|
"phenomenon_time_max": phenomenon_time_max,
|
|
232
233
|
"phenomenon_time_min": phenomenon_time_min,
|
|
234
|
+
"result_qualifier_code": result_qualifier_code,
|
|
233
235
|
"format": "column"
|
|
234
236
|
}
|
|
235
237
|
params = {
|
|
@@ -256,12 +258,13 @@ class DatastreamService(HydroServerBaseService):
|
|
|
256
258
|
self,
|
|
257
259
|
uid: Union[UUID, str],
|
|
258
260
|
observations: pd.DataFrame,
|
|
261
|
+
mode: str = "insert"
|
|
259
262
|
) -> None:
|
|
260
263
|
"""Load observations to a datastream."""
|
|
261
264
|
|
|
262
265
|
path = f"/{self.client.base_route}/{self.model.get_route()}/{str(uid)}/observations/bulk-create"
|
|
263
266
|
headers = {"Content-type": "application/json"}
|
|
264
|
-
params = {"mode":
|
|
267
|
+
params = {"mode": mode}
|
|
265
268
|
body = {
|
|
266
269
|
"fields": [to_camel(col) for col in observations.columns.tolist()],
|
|
267
270
|
"data": observations.values.tolist()
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hydroserverpy
|
|
3
|
+
Version: 1.5.0
|
|
4
|
+
Summary: A Python client for managing HydroServer data
|
|
5
|
+
Requires-Python: <4,>=3.9
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: requests>=2
|
|
9
|
+
Requires-Dist: pydantic>=2.6
|
|
10
|
+
Requires-Dist: pydantic[email]>=2.6
|
|
11
|
+
Requires-Dist: pandas>=2.1
|
|
12
|
+
Requires-Dist: numpy>=1.22.4
|
|
13
|
+
Requires-Dist: pyyaml>=5
|
|
14
|
+
Requires-Dist: simplejson>=3
|
|
15
|
+
Requires-Dist: crontab>=1
|
|
16
|
+
Requires-Dist: python-dateutil>=2.8.2
|
|
17
|
+
Requires-Dist: croniter>=2.0.1
|
|
18
|
+
Requires-Dist: jmespath>=1.0.1
|
|
19
|
+
Provides-Extra: docs
|
|
20
|
+
Requires-Dist: sphinx_autodoc_typehints; extra == "docs"
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# HydroServer Python Client
|
|
24
|
+
|
|
25
|
+
The hydroserverpy Python package provides an interface for managing HydroServer data and metadata, loading observations, and performing data quality control. This guide will go over how to install the package and connect to a HydroServer instance. Full hydroserverpy documentation and examples can be found [here](https://hydroserver2.github.io/hydroserver/how-to/hydroserverpy/hydroserverpy-examples.html).
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
You can install the package via pip:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install hydroserverpy
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Connecting to HydroServer
|
|
36
|
+
|
|
37
|
+
To connect to HydroServer, you need to initialize the client with the instance of HydroServer you're using and your user credentials if you want to access and modify your own data. If you don't provide authentication credentials you can read public data, but you will not be able to create or modify any data.
|
|
38
|
+
|
|
39
|
+
### Example: Anonymous User
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from hydroserverpy import HydroServer
|
|
43
|
+
|
|
44
|
+
# Initialize HydroServer connection.
|
|
45
|
+
hs_api = HydroServer(
|
|
46
|
+
host='https://playground.hydroserver.org'
|
|
47
|
+
)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Example: Basic Authentication
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from hydroserverpy import HydroServer
|
|
54
|
+
|
|
55
|
+
# Initialize HydroServer connection with credentials.
|
|
56
|
+
hs_api = HydroServer(
|
|
57
|
+
host='https://playground.hydroserver.org',
|
|
58
|
+
email='user@example.com',
|
|
59
|
+
password='******'
|
|
60
|
+
)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Funding and Acknowledgements
|
|
64
|
+
|
|
65
|
+
Funding for this project was provided by the National Oceanic & Atmospheric Administration (NOAA), awarded to the Cooperative Institute for Research to Operations in Hydrology (CIROH) through the NOAA Cooperative Agreement with The University of Alabama (NA22NWS4320003). Utah State University is a founding member of CIROH and receives funding under subaward from the University of Alabama. Additional funding and support have been provided by the State of Utah Division of Water Rights, the World Meteorological Organization, and the Utah Water Research laboratory at Utah State University.
|
|
66
|
+
|
hydroserverpy-1.4.0b4/PKG-INFO
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: hydroserverpy
|
|
3
|
-
Version: 1.4.0b4
|
|
4
|
-
Requires-Python: <4,>=3.9
|
|
5
|
-
License-File: LICENSE
|
|
6
|
-
Requires-Dist: requests>=2
|
|
7
|
-
Requires-Dist: pydantic>=2.6
|
|
8
|
-
Requires-Dist: pydantic[email]>=2.6
|
|
9
|
-
Requires-Dist: pandas>=2.2
|
|
10
|
-
Requires-Dist: numpy>=2.0
|
|
11
|
-
Requires-Dist: pyyaml>=5
|
|
12
|
-
Requires-Dist: simplejson>=3
|
|
13
|
-
Requires-Dist: crontab>=1
|
|
14
|
-
Requires-Dist: python-dateutil>=2.8.2
|
|
15
|
-
Requires-Dist: croniter>=2.0.1
|
|
16
|
-
Requires-Dist: jmespath>=1.0.1
|
|
17
|
-
Provides-Extra: docs
|
|
18
|
-
Requires-Dist: sphinx_autodoc_typehints; extra == "docs"
|
|
19
|
-
Dynamic: license-file
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: hydroserverpy
|
|
3
|
-
Version: 1.4.0b4
|
|
4
|
-
Requires-Python: <4,>=3.9
|
|
5
|
-
License-File: LICENSE
|
|
6
|
-
Requires-Dist: requests>=2
|
|
7
|
-
Requires-Dist: pydantic>=2.6
|
|
8
|
-
Requires-Dist: pydantic[email]>=2.6
|
|
9
|
-
Requires-Dist: pandas>=2.2
|
|
10
|
-
Requires-Dist: numpy>=2.0
|
|
11
|
-
Requires-Dist: pyyaml>=5
|
|
12
|
-
Requires-Dist: simplejson>=3
|
|
13
|
-
Requires-Dist: crontab>=1
|
|
14
|
-
Requires-Dist: python-dateutil>=2.8.2
|
|
15
|
-
Requires-Dist: croniter>=2.0.1
|
|
16
|
-
Requires-Dist: jmespath>=1.0.1
|
|
17
|
-
Provides-Extra: docs
|
|
18
|
-
Requires-Dist: sphinx_autodoc_typehints; extra == "docs"
|
|
19
|
-
Dynamic: license-file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/data_archive.py
RENAMED
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/data_source.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/extractors/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/loaders/__init__.py
RENAMED
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/loaders/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/timestamp_parser.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/etl/transformers/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/iam/collaborator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/sta/observed_property.py
RENAMED
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/sta/processing_level.py
RENAMED
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/models/sta/result_qualifier.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/etl/__init__.py
RENAMED
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/etl/data_archive.py
RENAMED
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/etl/data_source.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/iam/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/iam/workspace.py
RENAMED
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/sta/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/sta/processing_level.py
RENAMED
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy/api/services/sta/result_qualifier.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hydroserverpy-1.4.0b4 → hydroserverpy-1.5.0}/src/hydroserverpy.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|