Skip to main content

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 git+https://github.com/lynker-spatial/flowfabric-py#egg=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 atuhentication 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 = TRUE in 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flowfabricpy-0.1.1.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flowfabricpy-0.1.1-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file flowfabricpy-0.1.1.tar.gz.

File metadata

  • Download URL: flowfabricpy-0.1.1.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for flowfabricpy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9bd0d94366a0375e515835dd84888db66626d4f6961da22ccd0853566ad518b8
MD5 8bf55315684e5c96df605168c3e90590
BLAKE2b-256 6e2bed17dcd7a940d280d8aa5848c37631eebc7e0a29354153e9dd4066d25ce3

See more details on using hashes here.

File details

Details for the file flowfabricpy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: flowfabricpy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for flowfabricpy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eaf311af39c0aedddf700a650ffd337c03a3de4b277df559429a3fc510514127
MD5 a269ac32e2cc5843ed18c8a5658b4458
BLAKE2b-256 91080a892364c8349e1b4fafaf568471721ed6c0984d861c9ae724d305238c43

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page