Skip to main content

Auto-generated type definitions for the OCPI (Open Charge Point Interface) protocol.

Project description

ocpi-types (Python)

Auto-generated Python type definitions for the OCPI (Open Charge Point Interface) protocol, using dataclasses and type hints.

📖 Documentation: https://evorada.github.io/ocpi-types/python/

Installation

pip install ocpi-types

Usage

Each OCPI version is its own module inside the ocpi_types package. Every class provides from_dict / to_dict helpers.

import json
from ocpi_types import v2_3_0

raw = """
{
  "country_code": "NL",
  "party_id": "TNM",
  "id": "101",
  "start_date_time": "2024-01-01T12:00:00Z",
  "kwh": 0,
  "cdr_token": {"country_code": "NL", "party_id": "TNM", "uid": "ABC", "type": "RFID", "contract_id": "NL-TNM-C12345678-X"},
  "auth_method": "WHITELIST",
  "location_id": "LOC1",
  "evse_uid": "3256",
  "connector_id": "1",
  "currency": "EUR",
  "status": "ACTIVE",
  "last_updated": "2024-01-01T12:00:00Z"
}
"""

session = v2_3_0.Session.from_dict(json.loads(raw))
print(session.id, session.status)

# serialize back to a JSON-ready dict
data = session.to_dict()

Available versions

Module OCPI version
ocpi_types.v2_1_1 2.1.1
ocpi_types.v2_2_1 2.2.1
ocpi_types.v2_3_0 2.3.0
ocpi_types.v2_3_0_payments 2.3.0 + Payments
ocpi_types.v2_3_0_bookings 2.3.0 + Bookings

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

ocpi_types-0.3.0.tar.gz (88.9 kB view details)

Uploaded Source

Built Distribution

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

ocpi_types-0.3.0-py3-none-any.whl (90.6 kB view details)

Uploaded Python 3

File details

Details for the file ocpi_types-0.3.0.tar.gz.

File metadata

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

File hashes

Hashes for ocpi_types-0.3.0.tar.gz
Algorithm Hash digest
SHA256 98f71d2dc2ee05e95912f2e2c265a441ad9b22949cc1268da1491ed47a07bbca
MD5 cbc62f5eb19ba9e44edcdf3148367f16
BLAKE2b-256 81dffe39142af331ca4b8d5cbb532b261f28ad441c4dc9665e36c58920451044

See more details on using hashes here.

Provenance

The following attestation bundles were made for ocpi_types-0.3.0.tar.gz:

Publisher: publish.yml on evorada/ocpi-types

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

File details

Details for the file ocpi_types-0.3.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for ocpi_types-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d64c68b0ae966d84c5267edd5f5e5dd81af235ec6a82d0307ef1e9c93ff3f57
MD5 b76a8d7d20adafa757599cb6519c0891
BLAKE2b-256 1e7c24edf1989ef3e335423b90d921d5e2cd9ece6c0b7070ad80eba20ca895d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for ocpi_types-0.3.0-py3-none-any.whl:

Publisher: publish.yml on evorada/ocpi-types

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