A client library for accessing Delft-FEWS Web Services REST API v1
Project description
FEWS OpenAPI Python Client
A Python client library for accessing the Delft-FEWS Web Services REST API v1. This library provides a type-safe, auto-generated interface to interact with FEWS (Flood Early Warning System) web services.
Table of contents
Features
- Type-safe: Fully typed Python client with type hints
- Auto-generated: Generated from the official FEWS OpenAPI specification
- Async support: Both synchronous and asynchronous API calls
- Comprehensive: Covers all FEWS REST API v1 endpoints including:
- Time series data
- Archive operations
- Display groups and filters
- Parameters, locations, and qualifiers
- Workflow and task management
- And much more
Installation
From PyPI
uv add fews-openapi-py-client
or:
pip install fews-openapi-py-client
From Source
Clone the repository and install the generated client:
cd fews-openapi-py-client
uv pip install -e .
Using UV
uv add ./fews-openapi-py-client
Usage
Basic Example
from fews_openapi_py_client import Client
from fews_openapi_py_client.api.timeseries import timeseries
# Create a client
client = Client(base_url="https://your-fews-server.com/FewsWebServices")
# Fetch time series data
response = timeseries.sync_detailed(
client=client,
filter_id="your_filter_id",
location_ids="location1,location2",
start_time="2024-01-01T00:00:00Z",
end_time="2024-01-31T23:59:59Z"
)
if response.status_code == 200:
data = response.parsed
# Process your time series data
Async Example
import asyncio
from fews_openapi_py_client import Client
from fews_openapi_py_client.api.timeseries import timeseries
async def fetch_data():
client = Client(base_url="https://your-fews-server.com/FewsWebServices")
response = await timeseries.asyncio_detailed(
client=client,
filter_id="your_filter_id",
location_ids="location1,location2",
start_time="2024-01-01T00:00:00Z",
end_time="2024-01-31T23:59:59Z"
)
return response.parsed
# Run the async function
data = asyncio.run(fetch_data())
Client Configuration
Configure the client with custom settings:
from fews_openapi_py_client import Client
client = Client(
base_url="https://your-fews-server.com/FewsWebServices",
timeout=30.0, # Request timeout in seconds
verify_ssl=True, # SSL certificate verification
headers={
"Authorization": "Bearer your_token",
"Custom-Header": "value"
}
)
Contributing and releases
Development, client generation, post-processing, and PyPI release instructions are documented in CONTRIBUTING.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fews_openapi_py_client-0.1.0.tar.gz.
File metadata
- Download URL: fews_openapi_py_client-0.1.0.tar.gz
- Upload date:
- Size: 106.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9022f09d95351cf6285baf88d66298d66dc6dfc078756eaa92ab6310a0696170
|
|
| MD5 |
3121e3005344c097ed940f9ce318744e
|
|
| BLAKE2b-256 |
6796a150ccd2608c253cb6f0f72dde41ece9cad41c98d8ccdac2662b86d9c9d5
|
Provenance
The following attestation bundles were made for fews_openapi_py_client-0.1.0.tar.gz:
Publisher:
publish-to-pypi.yml on Deltares-research/fews-openapi-py-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fews_openapi_py_client-0.1.0.tar.gz -
Subject digest:
9022f09d95351cf6285baf88d66298d66dc6dfc078756eaa92ab6310a0696170 - Sigstore transparency entry: 1591302767
- Sigstore integration time:
-
Permalink:
Deltares-research/fews-openapi-py-client@efb55a353061ab424942998458ba5458e912fc5c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Deltares-research
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@efb55a353061ab424942998458ba5458e912fc5c -
Trigger Event:
push
-
Statement type:
File details
Details for the file fews_openapi_py_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fews_openapi_py_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 250.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47d7ae769e92c23e6e88f8afffbc3fac5e25256fc0d6819326beada465e89a80
|
|
| MD5 |
2bcee46620134b9c9ad81c509ea56799
|
|
| BLAKE2b-256 |
352a3a91ef7797d196e49d610b6f63f362d4d8df1247039006d4ca86e7fb7773
|
Provenance
The following attestation bundles were made for fews_openapi_py_client-0.1.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on Deltares-research/fews-openapi-py-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fews_openapi_py_client-0.1.0-py3-none-any.whl -
Subject digest:
47d7ae769e92c23e6e88f8afffbc3fac5e25256fc0d6819326beada465e89a80 - Sigstore transparency entry: 1591302805
- Sigstore integration time:
-
Permalink:
Deltares-research/fews-openapi-py-client@efb55a353061ab424942998458ba5458e912fc5c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Deltares-research
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@efb55a353061ab424942998458ba5458e912fc5c -
Trigger Event:
push
-
Statement type: