Skip to main content

Python client library for the Provident (MeterConnex) API

Project description

provident-py

CI PyPI Python License

Python client library for the Provident (MeterConnex) utility monitoring API. Supports both synchronous and asynchronous usage with full type safety.

Installation

pip install provident

Quick Start

from datetime import date

from provident import MeterType, Period, ProvidentClient, ProvidentConfig

config = ProvidentConfig(base_url="https://provident.meterconnex.com")

with ProvidentClient(config) as client:
    # Authenticate
    result = client.login("account-id", "password")
    if not result.success:
        print(result.msg)
        return

    # Read meter data
    electricity = client.get_chart_data(
        MeterType.ELECTRICITY, Period.MONTH, date(2026, 1, 1)
    )
    print(f"Units: {electricity.units}")  # kWh
    print(f"Data: {electricity.data}")     # [1.79, 2.76, ...]

    # Read all meter types
    for meter in [MeterType.COLD_WATER, MeterType.HOT_WATER, MeterType.ELECTRICITY]:
        data = client.get_chart_data(meter, Period.YEAR, date(2026, 1, 1))
        print(f"{meter.value}: {len(data.data)} data points in {data.units}")

Async Usage

from datetime import date

from provident import AsyncProvidentClient, MeterType, Period, ProvidentConfig

config = ProvidentConfig(base_url="https://provident.meterconnex.com")

async with AsyncProvidentClient(config) as client:
    await client.login("account-id", "password")

    result = await client.get_chart_data(
        MeterType.ELECTRICITY, Period.DAY, date(2026, 6, 1)
    )
    print(result.data)

API Reference

Client Classes

Class Description
ProvidentClient(config) Synchronous client. Use as a context manager.
AsyncProvidentClient(config) Asynchronous client. Use as an async context manager.

Authentication

Method Returns Description
login(username, password, *, remember_me=False) LoginResult Authenticate with the API. Session is persisted via cookies.
check_login() bool Check if the current session is still authenticated.
is_authenticated bool Property — checks if the auth cookie is present.

Meter Data

Method Returns Description
get_chart_data(meter_type, period, start) ChartDataResult Fetch usage data for a meter type and time period.

Enums

MeterType

Value API String
COLD_WATER "Cold Water"
ELECTRICITY "Electricity"
HOT_WATER "Hot Water"

Period

Value Data Points
DAY 24 (hourly)
MONTH 28–31 (daily)
YEAR 12 (monthly)

Models

Model Fields
LoginResult success: bool, msg: str | None
ChartDataResult error: bool, units: str | None, data: list[float]

Errors

All exceptions inherit from ProvidentError.

Exception HTTP Status Description
ProvidentAPIError 4xx Base class for API errors. Includes status_code, message, headers, body.
ProvidentAuthenticationError 401 Invalid or expired credentials.
ProvidentNotFoundError 404 Requested resource not found.
ProvidentRateLimitError 429 Rate limit exceeded. Includes retry_after.
ProvidentServerError 5xx Server error. Includes stack_trace, exception_type from ASP.NET.
ProvidentConnectionError N/A Network-level failure (timeout, DNS, etc.).

Requirements

License

MIT

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

provident-0.1.0.tar.gz (26.9 kB view details)

Uploaded Source

Built Distribution

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

provident-0.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: provident-0.1.0.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for provident-0.1.0.tar.gz
Algorithm Hash digest
SHA256 db7f06ce2a834a67d538031edecd7d2b42cffa6b68c2026f69937a3c526b93fb
MD5 df284fc91e992606ce67d7a97d9b746c
BLAKE2b-256 c01dd5136ce5ffb7f2aac0ec529b6bf08ffabdae51e1b52608ddfb105ae190c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for provident-0.1.0.tar.gz:

Publisher: release.yml on dangreco/provident-py

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

File details

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

File metadata

  • Download URL: provident-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for provident-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13303674c296eb8eade2562c11c9bcd3aa579262e4f9ada4a0182e54eeed7330
MD5 10844ccaaef8ce35564f255d8fe9ed2c
BLAKE2b-256 b1ae45259c4f4d6e0bb2329cf167e6c3b3b99fe9c777c8aae7e0d19a2bc607db

See more details on using hashes here.

Provenance

The following attestation bundles were made for provident-0.1.0-py3-none-any.whl:

Publisher: release.yml on dangreco/provident-py

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

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