This project has been archived by its maintainers, and is no longer receiving any updates.
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.
Currently, the only other public Python Implementation can be found here: https://github.com/TECHS-Technological-Solutions/ocpi/
The Documentation of OCPI can be found here: https://github.com/ocpi/ocpi/
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.
Metadata
Release files for python-ocpi 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python_ocpi-0.3.1.tar.gz | 34.5 kB | Without provenance | Details for python_ocpi-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_ocpi-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for python_ocpi-0.3.1-py3-none-any.whl |
Total release size: 83.7 kB
Release files / python_ocpi-0.3.1.tar.gz
| Download URL | python_ocpi-0.3.1.tar.gz |
|---|---|
| Size | 34.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e056ee93fab963e74f3e4f2cb36bcf4b3b247ff798d99537baa35034757d30b9
|
|
BLAKE2b-256 checksum How to use checksums |
bff144de36b4db0d8af26a208a3ffdb5b3c57fe60fd56ddbe0f79d421cf9c250
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.9.13 Linux/5.10.0-19-amd64
|
Release files / python_ocpi-0.3.1-py3-none-any.whl
| Download URL | python_ocpi-0.3.1-py3-none-any.whl |
|---|---|
| Size | 49.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df3916d309bd2c08b395a6411241dbe9d71c13e9bfb95967365c1af123135ae9
|
|
BLAKE2b-256 checksum How to use checksums |
e44e5a1b11ec525f3f7a1f3b9b55a6713e6602163f23ffb8abbbc7b2bc1bd418
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.9.13 Linux/5.10.0-19-amd64
|
Security for python-ocpi 0.3.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.