Skip to main content

PyFlumeNG

PyFlumeNG is a fork and superset of PyFlume. It keeps the existing pyflume import package and legacy helpers while adding the customer-portal OAuth flow, portal write operations, typed resource models, pagination, response/error handling, rate-limit state, and the endpoint surface used by Flume's customer portal.

Install PyFlumeNG from PyPI:

pip install PyFlumeNG

Authentication

PyFlumeNG supports two ways to obtain a Flume bearer token. They are not tied to separate sets of read helpers: ordinary reads such as devices, notifications, leaks, usage alerts, and queries can be used with either auth object. The main difference is how the token is obtained and what scopes Flume grants it.

Auth class Credentials Best fit Portal-only writes
PersonalAuth / FlumeAuth Email, password, API client ID, API client secret Flume's documented Personal API flow No
PortalAuth / FlumePortalAuth Email and password Customer-portal flow and code that needs the portal's broader token Yes

PersonalAuth and FlumeAuth are the same class. Use them when you want the documented Personal API password-grant flow with credentials generated from Flume's API Access settings:

import pyflume

auth = pyflume.PersonalAuth(
    username="your_email",
    password="your_password",
    client_id="your_client_id",
    client_secret="your_client_secret",
)
client = pyflume.FlumeClient(auth)

PortalAuth and FlumePortalAuth are the same class. This flow uses the same customer-portal OAuth path as Flume's web app and needs only the account credentials:

import pyflume

auth = pyflume.PortalAuth(
    username="your_email",
    password="your_password",
)
client = pyflume.FlumeClient(auth)

You can use that PortalAuth object for normal reads too. For example, client.list_notifications(), FlumeNotificationList(auth), client.list_devices(), and FlumeData(...) all accept it. Portal auth becomes required when an operation needs a scope that Flume does not grant to a normal Personal API token, including the portal usage-alert rule write routes.

See Authentication for the full distinction, including which auth mode to choose and how the legacy helpers behave.

Typed API

Named resource methods return typed models. For example:

user = client.get_user()  # Optional[User]
devices = client.list_devices()  # list[Device]
rules = client.list_usage_alert_rules("device")  # list[UsageAlertRule]
accuracy = client.get_meter_accuracy("device")  # list[AccuracyResult]

Models expose known API fields to type checkers and IDEs while remaining forward-compatible with Flume additions. Unknown response fields remain available as attributes or mapping keys and are preserved by to_dict().

pyflume ships a py.typed marker so installed type checkers can consume the package annotations. The complete method signatures and model fields are in the generated API reference.

Endpoint coverage

FlumeClient includes the documented Personal API plus portal-discovered routes for users, devices, current flow and queries, locations and location profiles, notifications, usage alerts and rules, do-not-alert schedules, budgets, subscriptions, emergency contacts, shared location access, integrations and shutoff valves, spans and span types, feedback, meter accuracy, support conversations, purchase options, insurers, professional services, API clients, contacts, and subscription/Stripe portal operations.

List helpers follow Flume pagination and return all pages. response() exposes the complete typed response envelope when pagination or metadata matters, and raw() remains an escape hatch for routes added by Flume after this release. See the FlumeClient guide for the main interface.

Legacy helpers

The original helper classes remain available and typed:

Development

The API reference is generated from source signatures and model annotations:

python scripts/generate_api_reference.py
python scripts/generate_api_reference.py --check

tox runs the tests, mypy, generated-reference check, and bytecode compilation.

Download files

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

Source Distribution

pyflumeng-0.9.0.tar.gz (31.0 kB view details)

Uploaded Source

Built Distribution

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

pyflumeng-0.9.0-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

Details for the file pyflumeng-0.9.0.tar.gz.

File metadata

  • Download URL: pyflumeng-0.9.0.tar.gz
  • Upload date:
  • Size: 31.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyflumeng-0.9.0.tar.gz
Algorithm Hash digest
SHA256 2e577064c7a4f2a4c32cc93cf75b7cbaefde9c579f04c3eee4d04fd20cf4faee
MD5 a490162933ffa8b96f65d6f6e2209aae
BLAKE2b-256 ae1316759086b3202609503fac681ecf6c7e2e922d28a15aa7459b93a53bd9c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyflumeng-0.9.0.tar.gz:

Publisher: python-public-release.yml on BookCatKid/PyFlumeNG

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyflumeng-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: pyflumeng-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 30.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyflumeng-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78addce1b1239737988a496943cd453153f87227b6757a7d75628463d64a76fc
MD5 6eee287906f3e7f31ef1ed059e498288
BLAKE2b-256 d9f65b193df5c79825e3e9bb6aa46a181412cc6fddde24e46395a490ad299732

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyflumeng-0.9.0-py3-none-any.whl:

Publisher: python-public-release.yml on BookCatKid/PyFlumeNG

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.12.0

2 files

0.10.0

2 files

This release

0.9.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page