Repository navigation
Releases: nickknissen/monta-python
Release list
v1.2.0
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
MontaApiClientAuthenticationErrornow carriesstatus, 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
What's Changed
- New
async_get_all_charge_points(per_page=100)that follows pagination via the responsemeta.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
What's Changed
- Add
MontaApiClientRateLimitErrorraised on HTTP 429 responses (#10)
Full Changelog: v1.0.5...v1.0.6
v1.0.5
Changelog
- Updated locked dependencies.
- Added release process documentation.
Notes
- No functional library changes in this release.
v1.0.4
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
Fix date parameter formatting to use ISO8601 with UTC timezone
Full Changelog: v1.0.2...v1.0.3
v1.0.2
What's Changed
- Fix deadlock bug in monta-python SDK by @nickknissen in #6
Full Changelog: v1.0.0...v1.0.2
v1.0.1
🎉 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 montaQuick 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
🎉 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 montaQuick 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
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
- @nickknissen made their first contribution in #1
Full Changelog: https://github.com/nickknissen/monta-python/commits/v0.2.0