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.0.tar.gz (13.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.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flowfabricpy-0.1.0.tar.gz
  • Upload date:
  • Size: 13.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.0.tar.gz
Algorithm Hash digest
SHA256 dc3de7e74426da6c89a7c1f105e3975ad849c9cd7ec72c7af509cd39f9319bd1
MD5 d6a685fb2868fb205edbc2b3fe743b33
BLAKE2b-256 d00c5d4a95701bb6998250483ac9bc8bb670c883202c538c93005d308113cf1d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flowfabricpy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e68f36f614d94ed03cb96be48d2f970af5f1ce458b4fe46218872eb9848af5c
MD5 3e4f1db0c6900414769c8e50411ce258
BLAKE2b-256 e6fb782314bdd6453249ad12487f9b4f0469a5ab04b6dfbd808527fd430a72f4

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