Skip to main content

Python library for the Open Charge Point Interface (OCPI)

Project description

pyOCPI

Python Rest-Interface for OCPI (2.2) built on Flask-RESTX, providing a OpenAPI interface.

Talking about OCPI, many Charge Point Operators (CPO) and e-Mobility Service Providers (eMSP) implement their own code to integrate OCPI into their software. This is a very tedious way, as the protocol is very complex it is not needed that every entity implements it on their own.

To reduce reimplementation, an academic implementation is provided here, which furthermore allows to integrate with a new RESERVATIONS endpoint, if needed.

Install Instructions

pip install pyocpi

or after cloning the repository, one can run pip install -e . to work locally with the package.

Package information

pyocpi
├── exceptions.py
├── __init__.py
├── managers.py # <- contains stubs which have to be inherited and implemented
├── models      # <- contains JSON Schemas in Flask-RestX
└── namespaces  # <- contains REST Endpoint Descriptions

Configuration

main.py contains an example of how to use this project. The managers are meant to be understood as interfaces, which must be implemented according to the business logic which is not part of this communications module.

An example architecture would use a background job to schedule answers (for example for the commands module) while saving the data from the post/patch requests in a seperate database, which is used for communication between the background job and the Flask app.

Roadmap

This will not be the last iteration of this concept. I think this could be a lot more user friendly and abstracted, so that the usage feels more like the communication of the ocpp python package, which does not need any knowledge of the underlying websockets at all. Yet it is a good approach and is already greatly configurable.

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

python_ocpi-0.2.tar.gz (34.3 kB view details)

Uploaded Source

Built Distribution

python_ocpi-0.2-py3-none-any.whl (49.2 kB view details)

Uploaded Python 3

File details

Details for the file python_ocpi-0.2.tar.gz.

File metadata

  • Download URL: python_ocpi-0.2.tar.gz
  • Upload date:
  • Size: 34.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.13 Linux/5.10.0-19-amd64

File hashes

Hashes for python_ocpi-0.2.tar.gz
Algorithm Hash digest
SHA256 0b8d44bfce18a0c6fa3001f7c205ebc399c54c0eb2ad137544fd8c0eb4a3d60a
MD5 c95a366132d32e31115692248c4c6078
BLAKE2b-256 25102f9cdae23c52b89408f677972f693ec0b2f44ea558b8b224795d89eaf9a7

See more details on using hashes here.

File details

Details for the file python_ocpi-0.2-py3-none-any.whl.

File metadata

  • Download URL: python_ocpi-0.2-py3-none-any.whl
  • Upload date:
  • Size: 49.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.13 Linux/5.10.0-19-amd64

File hashes

Hashes for python_ocpi-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ccbcf1d49c2ea0d0aa2679c3f4fdeb8c6a937b47e8cb9164f4ac1b98cb419cc9
MD5 e50678cc43725bd6c6ae0af9e4281d4a
BLAKE2b-256 4048b219e2a2c494a2e934b40ec51a2a16f03ec953656e549f2ec5e93475e4e6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page