Skip to main content

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 pagination
  • async_get_charge_point(charge_point_id) - Get a specific charge point by ID with full details
  • async_get_charges(charge_point_id, state, from_date, to_date, page, per_page) - Get charges for a specific charge point
  • async_start_charge(charge_point_id) - Start a charging session
  • async_stop_charge(charge_id) - Stop a charging session
  • async_get_personal_wallet() - Get personal wallet information
  • async_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

monta-1.0.3.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

monta-1.0.3-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file monta-1.0.3.tar.gz.

File metadata

  • Download URL: monta-1.0.3.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for monta-1.0.3.tar.gz
Algorithm Hash digest
SHA256 f1bf155cc2e660c446efea93c7f701d793cba05328cbfd173ff0217ab866325a
MD5 d0eb9fac18fd240a116dff4d922bcffd
BLAKE2b-256 5b308fd8c00aae0b44a759a3cb6a6f141c8fd34a28fdfe9378b5e855a41c7404

See more details on using hashes here.

File details

Details for the file monta-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: monta-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for monta-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 57962b9001c89b8bd11bc350d98e9d4087b433ca7183bfe08cd962da0a92a78e
MD5 b1002bd6bbea03353c6c7f62d9f38502
BLAKE2b-256 07ae364f452b4886b88f102db5027ff39fb6e31cb6fa87d6f71a92518502102f

See more details on using hashes here.

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