ocpp-asgi provides ASGI compliant interface for implementing event-driven server-side support for OCPP protocol with Python
Project description
OCPP-ASGI
ocpp-asgi provides ASGI compliant interface for implementing event-driven server-side support for OCPP protocol with Python. It depends on and extends mobilityhouse/ocpp.
The key features are:
- ASGI compliant interface supporting both WebSocket and HTTP protocols.
- Event-driven and "stateless" approach for implementing action handlers for OCPP messages.
- Highly-scalable and supports serverless (e.g. AWS Lambda) with compatible ASGI server.
- Requires small and straightforward changes from ocpp to action handlers (but is not backwards compatible).
Disclaimer! This library is still in alpha state. It has some rough edges.
Getting started
Installation
pip install ocpp-asgi
Also ASGI server is required e.g. uvicorn or mangum when deployed to AWS Lambda with API Gateway.
pip install uvicorn
Run the examples
There are two kind of examples how to implement central system with ocpp-asgi: standalone and serverless. Both examples use same ocpp action handlers (routers).
Running standalone example
Run the following commands e.g. in different terminal windows (or run the files within IDE).
Start Central System:
python ./examples/central_system/standalone/central_system.py
Start Charging Station:
python ./examples/charging_station.py
Running serverless example
Run the following commands in different terminal windows (or run the files within IDE).
Start Central System HTTP backend:
python ./examples/central_system/serverless/central_system_http.py
Start Central System WebSocket proxy:
python ./examples/central_system/serverless/central_system_proxy.py
Start Charging Station:
python ./examples/charging_station.py
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
Built Distribution
File details
Details for the file ocpp_asgi-0.2.0.tar.gz
.
File metadata
- Download URL: ocpp_asgi-0.2.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.1 Darwin/19.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70900a2a060dbfae971bed9132f6587734d0b2fb81623d3f1353f2fd8692e523 |
|
MD5 | a986e0a33b5b631a247319e0c5619b2f |
|
BLAKE2b-256 | a7515573720cb85dc91c270268c221baa4f242dd41810e427c922af63622ca48 |
File details
Details for the file ocpp_asgi-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: ocpp_asgi-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.1 Darwin/19.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 712374ccb521bd2e8b7ceabb6e46c775e14104f102ad8c8d3a1b3c7efa0d96ed |
|
MD5 | 436570333ba01bf8d293a70b5ba13007 |
|
BLAKE2b-256 | 837d2aca30a9028b5e541a10cbf7b6e3c2c2522f0720a14b7b21c063904b77af |