Skip to main content

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

Metadata

Release files for ocpi-types 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ocpi-types 0.3.0
File Size Uploaded Provenance Actions
ocpi_types-0.3.0.tar.gz 88.9 kB With provenance Details for ocpi_types-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ocpi-types 0.3.0
File Interpreter ABI Platform Actions
ocpi_types-0.3.0-py3-none-any.whl Python 3 none any Details for ocpi_types-0.3.0-py3-none-any.whl

Total release size: 179.5 kB

Release files / ocpi_types-0.3.0.tar.gz

Download URL ocpi_types-0.3.0.tar.gz
Size 88.9 kB
Tags Source
SHA-256 checksum
How to use checksums
98f71d2dc2ee05e95912f2e2c265a441ad9b22949cc1268da1491ed47a07bbca
BLAKE2b-256 checksum
How to use checksums
81dffe39142af331ca4b8d5cbb532b261f28ad441c4dc9665e36c58920451044
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.

Transparency log

Release files / ocpi_types-0.3.0-py3-none-any.whl

Download URL ocpi_types-0.3.0-py3-none-any.whl
Size 90.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d64c68b0ae966d84c5267edd5f5e5dd81af235ec6a82d0307ef1e9c93ff3f57
BLAKE2b-256 checksum
How to use checksums
1e7c24edf1989ef3e335423b90d921d5e2cd9ece6c0b7070ad80eba20ca895d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.

Transparency log

Security for ocpi-types 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ocpi_types-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page