Skip to content

Releases: nickknissen/monta-python

v1.2.0

Choose a tag to compare

@nickknissen nickknissen released this 06 Aug 07:40

What's Changed

Recovery from tokens the Monta API refuses, so a stale token no longer surfaces as a credentials prompt (#14). This is the library side of nickknissen/hass-monta#321, where a Home Assistant user was asked to re-enter working credentials roughly once an hour.

  • A refused refresh token now falls back to the client id and secret instead of ending the attempt. Previously the stored refresh expiry is a month out, so every later call retried the same dead token and nothing short of new credentials got out of it.
  • A request refused with a 401 drops the token and is tried once more. Token validity is judged locally against this machine's clock, so a slow clock or a token revoked ahead of its expiry could get an authentication error out of an otherwise healthy client.
  • Requests refused at the same moment share one replacement token rather than each minting their own and rotating the refresh token out from under the others.
  • A refused token is dropped from TokenStorage, not just from memory, so storage that outlives the process does not hand the dead token back on the next start.

Behaviour change

  • MontaApiClientAuthenticationError now carries status, the HTTP status the API answered with, so callers can tell a refused token (401) from a request the credentials are not allowed to make (403). Only a 401 is retried.
  • A 403 now raises with the message "Request not permitted" rather than "Invalid credentials", which was untrue of credentials the API had accepted. Code matching on the exception type is unaffected; code matching on the message string is not.

Also

  • First test suite for the client, run against Python 3.11 through 3.14 in CI.

Full Changelog: v1.1.0...v1.2.0

v1.1.0

Choose a tag to compare

@nickknissen nickknissen released this 29 Jul 11:57
44b65ce

What's Changed

  • New async_get_all_charge_points(per_page=100) that follows pagination via the response meta.totalPageCount, so accounts with more than one page of charge points no longer silently lose chargers (#13)

Full Changelog: v1.0.6...v1.1.0

v1.0.6

Choose a tag to compare

@nickknissen nickknissen released this 29 Jun 12:34

What's Changed

  • Add MontaApiClientRateLimitError raised on HTTP 429 responses (#10)

Full Changelog: v1.0.5...v1.0.6

v1.0.5

Choose a tag to compare

@nickknissen nickknissen released this 21 Apr 12:12

Changelog

  • Updated locked dependencies.
  • Added release process documentation.

Notes

  • No functional library changes in this release.

v1.0.4

Choose a tag to compare

@nickknissen nickknissen released this 26 Nov 19:34
7359ec2

What's Changed

  • refactor: replace async-timeout with built-in asyncio.timeout() by @nickknissen in #7

Full Changelog: v1.0.3...v1.0.4

v1.0.3

Choose a tag to compare

@nickknissen nickknissen released this 16 Nov 08:18

Fix date parameter formatting to use ISO8601 with UTC timezone

Full Changelog: v1.0.2...v1.0.3

v1.0.2

Choose a tag to compare

@nickknissen nickknissen released this 12 Nov 20:16
4dc8496

What's Changed

Full Changelog: v1.0.0...v1.0.2

v1.0.1

Choose a tag to compare

@nickknissen nickknissen released this 12 Nov 14:26
14f518b

🎉 Initial Release - v1.0.1

Excited to announce the first public release of the Monta Python client library!

Overview

This library provides a simple, async-first Python interface to the Monta EV charging API, making it easy to integrate Monta's EV charging infrastructure into your Python applications.

Features

  • Async/await support - Built on aiohttp for efficient async operations
  • Charge Point Management - List and retrieve detailed information about charge points
  • Charging Session Control - Start and stop charging sessions programmatically
  • Wallet Integration - Access wallet balance and transaction history
  • Type-safe data models - Clean, structured data objects for all API responses
  • Pagination support - Handle large datasets efficiently

Installation

pip install monta

Quick Start

import asyncio
import aiohttp
from monta import MontaApiClient

async def main():
    async with aiohttp.ClientSession() as session:
        client = MontaApiClient(
            client_id="your_client_id",
            client_secret="your_client_secret",
            session=session,
        )
        
        # Get all charge points
        charge_points = await client.async_get_charge_points()
        for charge_point_id, charge_point in charge_points.items():
            print(f"Charge Point: {charge_point.name}")

asyncio.run(main())

Happy charging! ⚡

v1.0.0

v1.0.0 Pre-release
Pre-release

Choose a tag to compare

@nickknissen nickknissen released this 12 Nov 14:21
14f518b

🎉 Initial Release - v1.0.0

Excited to announce the first public release of the Monta Python client library!

Overview

This library provides a simple, async-first Python interface to the Monta EV charging API, making it easy to integrate Monta's EV charging infrastructure into your Python applications.

Features

  • Async/await support - Built on aiohttp for efficient async operations
  • Charge Point Management - List and retrieve detailed information about charge points
  • Charging Session Control - Start and stop charging sessions programmatically
  • Wallet Integration - Access wallet balance and transaction history
  • Type-safe data models - Clean, structured data objects for all API responses
  • Pagination support - Handle large datasets efficiently

Installation

pip install monta

Quick Start

import asyncio
import aiohttp
from monta import MontaApiClient

async def main():
    async with aiohttp.ClientSession() as session:
        client = MontaApiClient(
            client_id="your_client_id",
            client_secret="your_client_secret",
            session=session,
        )
        
        # Get all charge points
        charge_points = await client.async_get_charge_points()
        for charge_point_id, charge_point in charge_points.items():
            print(f"Charge Point: {charge_point.name}")

asyncio.run(main())

Happy charging! ⚡

v0.2.0

v0.2.0 Pre-release
Pre-release

Choose a tag to compare

@nickknissen nickknissen released this 12 Nov 14:04
2c98906

What's Changed

  • Add pagination support to get charge points endpoint by @nickknissen in #1
  • Validate chargepoints data and endpoints by @nickknissen in #2
  • Make charge_point_id parameter optional in async_get_charges by @nickknissen in #3
  • Lower minimum Python version to 3.11 by @nickknissen in #4
  • Add PyPI publishing workflow and enhance package metadata by @nickknissen in #5

New Contributors

Full Changelog: https://github.com/nickknissen/monta-python/commits/v0.2.0