Python client library for the Monta EV charging API
Project description
Monta
A Python client library for the Monta EV charging API.
API Documentation
For complete API documentation, visit the official Monta API docs: https://docs.public-api.monta.com/reference/home
Requirements
- Python 3.11 or higher
- aiohttp
- async-timeout
Installation
This package is available on PyPI:
pip install monta
Alternatively, install from source with:
python -m pip install .
Usage
Here's a basic example of how to use the Monta API client:
import asyncio
import aiohttp
from monta import MontaApiClient
async def main():
async with aiohttp.ClientSession() as session:
# Initialize the client
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_id}: {charge_point.name}")
# Get a specific charge point with full details
if charge_points:
first_charge_point_id = next(iter(charge_points.keys()))
charge_point = await client.async_get_charge_point(first_charge_point_id)
# Access location information
if charge_point.location and charge_point.location.coordinates:
print(f"Location: {charge_point.location.coordinates.latitude}, "
f"{charge_point.location.coordinates.longitude}")
# Access connector information
print(f"Available connectors: {[c.name for c in charge_point.connectors]}")
# Get charges for this charge point
charges = await client.async_get_charges(first_charge_point_id)
print(f"Found {len(charges)} charges")
# Get wallet information
wallet = await client.async_get_personal_wallet()
print(f"Wallet balance: {wallet.balance.amount} {wallet.balance.currency.identifier}")
# Run the async function
asyncio.run(main())
Available Methods
async_get_charge_points(page, per_page)- Retrieve all available charge points with paginationasync_get_charge_point(charge_point_id)- Get a specific charge point by ID with full detailsasync_get_charges(charge_point_id, state, from_date, to_date, page, per_page)- Get charges for a specific charge pointasync_start_charge(charge_point_id)- Start a charging sessionasync_stop_charge(charge_id)- Stop a charging sessionasync_get_personal_wallet()- Get personal wallet informationasync_get_wallet_transactions(state, from_date, to_date, page, per_page)- Retrieve wallet transactions
License
See LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file monta-1.0.1.tar.gz.
File metadata
- Download URL: monta-1.0.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f725cb72007376107ce5bc64babb6d73811ac79fcaf298151b1ff1aa4877d1b
|
|
| MD5 |
be7ced08de6479b9e3ad68adf22d6f37
|
|
| BLAKE2b-256 |
ac8d06b341155bc63a5ae60a34a48fd46c31f7e3ed7a332239e936112a0881c2
|
File details
Details for the file monta-1.0.1-py3-none-any.whl.
File metadata
- Download URL: monta-1.0.1-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d3f71c8143b860bccbfba3ae8c2aa8f04d573f03b710842c4a60e7f5d0b00b8
|
|
| MD5 |
1aa52536cdf1ff8455370777b493ec4d
|
|
| BLAKE2b-256 |
57da8824cd9fc7991285fd63d98a20856e5f6c0e6fc5ea1d449aab40c14dbfab
|