Skip to main content

Toadr3 Publish to PyPI image Python Versions image Ruff Checked with mypy

toadr3

Tiny OpenADR3 Python Library

This Python library is a tiny OpenADR3 library that can be used to perform a minimal set of operations towards a VTN.

Currently, it supports the following operations:

  • List events [GET]
    • Filter by program id
    • Filter by target type and target values
    • Limit and skip for pagination
  • List programs [GET]
    • Filter by target type and target values
    • Limit and skip for pagination
  • List reports [GET]
    • Filter by program id
    • Filter by event id
    • Filter by client name
    • Limit and skip for pagination
  • List subscriptions [GET]
    • Filter by program id
    • Filter by client name
    • Filter by target type and target values
    • Filter by objects
    • Limit and skip for pagination
  • Update a subscription [PUT]
  • Delete a subscription [DELETE]
  • Get a subscription by id [GET]
  • Update a program [PUT]
  • Delete a program [DELETE]
  • Get a program by id [GET]
  • Create a report [POST]
  • Create a subscription [POST]
  • Create a report object based on an initial event

Example

A small example of how to list programs and events and create a report:

import asyncio
import toadr3


OAUTH_CONFIG = toadr3.OAuthConfig(
    token_url="",          # URL to the OAuth2 token endpoint
    grant_type="",         # OAuth2 grant type
    claims={"scope": ""},  # OAuth2 claims, for example 'scope'
    client_id="",          # OAuth2 client ID or set to None use environment variable
    client_secret="",      # OAuth2 secret or set to None use environment variable
)

VTN_URL = ""  # URL to the VTN

async def main():
  async with toadr3.ToadrClient(vtn_url=VTN_URL, oauth_config=OAUTH_CONFIG) as client:
    programs = await client.get_programs()
    for program in programs:
      print(f"Program: ID={program.id}, Name={program.program_name}")
        
    events = await client.get_events()
    for event in events:
      print(f"Event: ID={event.id}, Name={event.event_name}, Date={event.created_date_time}")

    report = toadr3.models.Report.create_report(
      event=events[0],
      client_name="ReadmeClient",
      report_type="README_REPORT",
      report_values=[True],
    )

    try:
      result = await client.post_report(report)
      print(f"Report created with ID={result.id}")
    except toadr3.ToadrError as e:
      print(f"ToadrError: {e}")
 


if __name__ == '__main__':
  asyncio.run(main())

Metadata

Release files for toadr3 0.29.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for toadr3 0.29.0
File Size Uploaded
toadr3-0.29.0.tar.gz 25.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for toadr3 0.29.0
File Interpreter ABI Platform
toadr3-0.29.0-py3-none-any.whl Python 3 none any Details

Total release size: 64.2 kB

Release files / toadr3-0.29.0.tar.gz

Download URL toadr3-0.29.0.tar.gz
Size 25.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6ddab74ca31efe01567dfd25c1675b2984f997eab7b80f761c2572ee3c97339e
BLAKE2b-256 checksum
How to use checksums
8198cdaaf130b4c82039e62a0d4f7bed4588e8e2f3ba370c26d7102cc0e9e39d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2025.

Transparency log

Release files / toadr3-0.29.0-py3-none-any.whl

Download URL toadr3-0.29.0-py3-none-any.whl
Size 39.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8b298205082f2c5d86d182bc0c58e237812f69e7aaeb07312d86ca578f81974
BLAKE2b-256 checksum
How to use checksums
f472ca452ec9b51ac77cbe1d15869fc0f270111e7a51d6f102daf0bb61bdbfa7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.29.0 This release

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.24.1

2 release files

0.24.0

2 release files

0.23.1

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.17.0

2 release files

0.14.6

2 release files

0.14.5

2 release files

0.14.4

2 release files

0.14.3

2 release files

0.14.2

2 release files

0.14.1

2 release files

0.12.4

2 release files

0.12.3

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.2

2 release files

0.11.1

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release 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