Python client for Flowfabric
Project description
flowfabricpy: Effortless Python Access to FlowFabric API
flowfabricpy is a powerful Python client for the FlowFabric API, providing seamless access to hydrologic forecasts, reanalysis, rating curves, and datasets. With robust authentication and automatic token caching, you can focus on data science, not on data munging plumbing.
Key Features
- Evolving catalog of harmonized data from multiple models
- Single method access to all models - both retrospective and forecast
- One-time authentication: Log in once, and your token is cached for future use.
- Arrow IPC support: Fast, memory-efficient data transfer
Installation
# Install from GitHub:
pip install flowfabricpy
Quick Start
# 1. List available datasets
datasets = flowfabric_list_datasets()
print(datasets)
# 2. Query streamflow forecast (first call prompts login, then caches token)
# More on authentication below ...
tbl = flowfabric_streamflow_query(
dataset_id = "nws_owp_nwm_analysis",
feature_ids = ["101", "1001"],
issue_time = "latest"
)
print(tbl)
# 3. Query streamflow reanalysis data
tbl_re = flowfabric_streamflow_query(
"nws_owp_nwm_reanalysis_3_0",
feature_ids = ["101", "1001"],
start_time = "2018-01-01",
end_time = "2018-01-31"
)
print(tbl_re)
# 4. Query ratings
ratings = flowfabric_ratings_query(
feature_ids = ["101", "1001"],
type = "rem"
)
print(ratings)
Authentication & Token Caching
Using this platform requires authentication via the Lynker Spatial Portal. Accounts are free to set up and use. If use exceeds costs we can burden we will reach out to power users to better understand how we can help.
To get access, users can create an account here: https://proxy.lynker-spatial.com/
The first API call will prompt you to log in via browser. Your token is then cached and reused for all future calls—no repeated browser prompts!
Manual token refresh:
flowfabric_refresh_token() # Forces re-authentication and updates cached token
Advanced: You can always pass a token explicitly:
token = flowfabric_get_token()['id_token']
healthz = flowfabric_healthz(token = token)
Troubleshooting
- If you see repeated browser prompts, call
flowfabric_refresh_token()once, then retry your queries. - If you switch users, manually refresh the token.
- Use
verbose = TRUEin any endpoint for detailed debug output.
Learn More
- See the vignettes for advanced usage, authentication, and custom queries.
- All API responses are Arrow tables for high-performance analytics.
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 flowfabricpy-0.1.2.tar.gz.
File metadata
- Download URL: flowfabricpy-0.1.2.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4df7591f221b3a2c0ca5b26fb1f95c6ba4eed358054046540443781a70be0ae
|
|
| MD5 |
0265915224a095804e529a614b6504ab
|
|
| BLAKE2b-256 |
82120a0c82959495b16c27606a10c66c3336fb434be9034a5e3f0a16d8a84314
|
File details
Details for the file flowfabricpy-0.1.2-py3-none-any.whl.
File metadata
- Download URL: flowfabricpy-0.1.2-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04a88df9081f438bde33b0ec9a867cdbd37d873cbc4afcbe33f4ddbf56744cda
|
|
| MD5 |
861ca29a6d0b1920072fdc874e3ba791
|
|
| BLAKE2b-256 |
16de1a1a8d08967b20ae6dd96e6fce78520adb8063ba81476ec26f2f2a12b10e
|