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.4.9.tar.gz (51.8 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.4.9-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for evnex-0.4.9.tar.gz
Algorithm Hash digest
SHA256 63946548deaf849c6845c676f2850a0db4ca058200be4ac7b52e2ca31b67b397
MD5 3780cee3624cdd52f151d3b803fe9226
BLAKE2b-256 700ad33d4cf75ef9d2eb40687e67e6c3b56f5103b2e67b4c10fb55f1d08adc6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for evnex-0.4.9.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.4.9-py3-none-any.whl.

File metadata

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

File hashes

Hashes for evnex-0.4.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1063fd4a4cfe9e1095b4db883da79bd9a926e055768c466bb386597a015aabec
MD5 c63bdcb73f489aa0c17d64d3a1e112d1
BLAKE2b-256 0f47c1c906a0e75a03a122affd8d275b0dd2e73db0ad0174af7b699199307575

See more details on using hashes here.

Provenance

The following attestation bundles were made for evnex-0.4.9-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