Skip to main content

A Python wrapper for the EVNEX Cloud API

Project description

python-evnex

CI PyPI

Python client for the Evnex API.

Author not affiliated with Evnex.

Features

  • Talks to your Evnex charger via Cloud API
  • Automatic retries with exponential backoff
  • Automatic re-authentication
  • Optionally pass in a httpx client
  • Optionally pass in tokens to resume an existing session

Installation

pip install evnex

Requirements: Python 3.11+

Usage

import asyncio
from pydantic import SecretStr
from pydantic_settings import BaseSettings
from evnex.api import Evnex


class EvnexAuthDetails(BaseSettings):
    EVNEX_CLIENT_USERNAME: str
    EVNEX_CLIENT_PASSWORD: SecretStr


async def main():
    creds = EvnexAuthDetails()
    evnex = Evnex(username=creds.EVNEX_CLIENT_USERNAME,
                  password=creds.EVNEX_CLIENT_PASSWORD.get_secret_value())

    user_data = await evnex.get_user_detail()

    for org in user_data.organisations:
        print("Getting 7 day insight for", org.name, "User:", user_data.name)
        insights = await evnex.get_org_insight(days=7, org_id=org.id)

        for segment in insights:
            print(segment)


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

Examples

python-evnex is intended as a library, but a few example scripts are provided in the examples folder.

Providing authentication for the examples is via environment variables, e.g. on nix systems:

export EVNEX_CLIENT_USERNAME=you@example.com
export EVNEX_CLIENT_PASSWORD=<your password>

python -m examples.get_charge_point_detail

Developer Notes

Development Setup

# Install dependencies with development tools
uv sync --group dev

# Set up pre-commit hooks (recommended)
uv run pre-commit install

# Alternatively, format and lint manually
uv run ruff format .
uv run ruff check .

Making a new release

What ends up on PyPi is what really matters. Creating a release in GitHub triggers a release workflow that builds and publishes to PyPi.

To manually release, update the version in pyproject.toml, build and publish with uv:

uv build
uv publish

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

evnex-0.5.0.tar.gz (74.5 kB view details)

Uploaded Source

Built Distribution

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

evnex-0.5.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file evnex-0.5.0.tar.gz.

File metadata

  • Download URL: evnex-0.5.0.tar.gz
  • Upload date:
  • Size: 74.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for evnex-0.5.0.tar.gz
Algorithm Hash digest
SHA256 5a200ba9d1ab45bf220b2db712252213d6fb6aee319c76e7c687d682763a6978
MD5 703a99ddc4153144c0592453c7248baf
BLAKE2b-256 93bdcbb880640f00f884a1ec4a786c63cdd092237a482b631f1f9c2bd7c64789

See more details on using hashes here.

Provenance

The following attestation bundles were made for evnex-0.5.0.tar.gz:

Publisher: ci.yml on hardbyte/python-evnex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file evnex-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: evnex-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for evnex-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba27c356f6dcb442eaf50aeb151962e470404f1dbd98eb34a0cd6eb2e6a572c2
MD5 6ad75b2d0e4d8878f4665e3e9da8bb78
BLAKE2b-256 535cf83f04e91be5292a8edb2c3f41c1951b7fecec361bf643ddae06bfbfb9e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for evnex-0.5.0-py3-none-any.whl:

Publisher: ci.yml on hardbyte/python-evnex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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