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.1.tar.gz (28.8 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.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: provident-0.1.1.tar.gz
  • Upload date:
  • Size: 28.8 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.1.tar.gz
Algorithm Hash digest
SHA256 f35f0f0b3f912a325d0f7dba9d2de0d072d0cafef91f7cc69e892347096417c9
MD5 6cf39178229abdc6009249d8ca5f785e
BLAKE2b-256 90cef43b0fe25ce8d2de5b522d64ba5ea2daffa26779bc2d8692588573b63413

See more details on using hashes here.

Provenance

The following attestation bundles were made for provident-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: provident-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1cd27044d4d6595f8d08761ac72ea15ddf78f090ff66ff8cde20bc3dbbcb248d
MD5 1192defcddec5329de56fbfde759d569
BLAKE2b-256 73d47d33ba7d92a98ff23736c00b2be06ecbbb2bdc9eee18e674c6271291bdfa

See more details on using hashes here.

Provenance

The following attestation bundles were made for provident-0.1.1-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