From 53d23a61b685a36a821ddec567e866e3646c7542 Mon Sep 17 00:00:00 2001 From: Wester Coenraads Date: Wed, 22 Oct 2025 14:05:19 +0200 Subject: [PATCH 1/3] Add the S2 logo and a badge with Discord invite to the README. --- Logo-S2.svg | 1 + README.rst | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 Logo-S2.svg diff --git a/Logo-S2.svg b/Logo-S2.svg new file mode 100644 index 0000000..be4d4bd --- /dev/null +++ b/Logo-S2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/README.rst b/README.rst index b0eefd2..16c598b 100644 --- a/README.rst +++ b/README.rst @@ -1,11 +1,16 @@ Python Wrapper for S2 Flexibility Protocol =========================================== -.. image:: https://img.shields.io/pypi/v/s2-python - :alt: PyPI - Version -.. image:: https://img.shields.io/pypi/pyversions/s2-python - :alt: PyPI - Python Version -.. image:: https://img.shields.io/pypi/l/s2-python - :alt: PyPI - License +.. raw:: html +
+ +
+ + + + +
+
+
This Python package implements the message validation for the EN50491-12-2 "S2" standard for home and building energy management. This implementation is based on the asyncapi description of the protocol provided in the `s2-ws-json `_ repository. From 9e9e6cbe6b2a16e6c86a7e7ac25cb549d0a6d6fd Mon Sep 17 00:00:00 2001 From: Wester Coenraads Date: Wed, 22 Oct 2025 14:21:56 +0200 Subject: [PATCH 2/3] Convert README.rst to Markdown. --- README.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++++ README.rst | 85 ------------------------------------------------------ 2 files changed, 76 insertions(+), 85 deletions(-) create mode 100644 README.md delete mode 100644 README.rst diff --git a/README.md b/README.md new file mode 100644 index 0000000..c3e3870 --- /dev/null +++ b/README.md @@ -0,0 +1,76 @@ +# Python Wrapper for S2 Flexibility Protocol + +
+ +
+ + + + +
+
+
+ +This Python package implements the message validation for the EN50491-12-2 "S2" standard for home and building energy management. This implementation +is based on the asyncapi description of the protocol provided in the [s2-ws-json](https://github.com/flexiblepower/s2-ws-json/) repository. + +## To Install +You can install this package using pip or any Python dependency manager that collects the packages from PyPI: + +```bash +pip install s2-python +pip install s2-python[ws] # for S2 over WebSockets +``` + +The packages on PyPI may be found [here](https://pypi.org/project/s2-python/). + +## Mypy support +s2-python uses pydantic at its core to define the various S2 messages. As such, the pydantic mypy plugin is required +for type checking to succeed. + +Add to your pyproject.toml: + +```toml +[tool.mypy] +plugins = ['pydantic.mypy'] +``` + + +## Example + +```python +from s2python.common import PowerRange, CommodityQuantity + +# create s2 messages as Python objects +number_range = PowerRange( + start_of_range=4.0, + end_of_range=5.0, + commodity_quantity=CommodityQuantity.ELECTRIC_POWER_L1, +) +# serialize s2 messages +number_range.to_json() +# deserialize s2 messages +json_str = '{"start_of_range": 4.0, "end_of_range": 5.0, "commodity_quantity": "ELECTRIC.POWER.L1"}' +PowerRange.from_json(json_str) +``` + +## Development + +For development, you can install the required dependencies using the following command: +```bash + pip install -e .[testing,development,ws] +``` + +The tests can be run using tox: +```bash + tox +``` + +To build the package, you can use tox as well: +```bash + tox -e build,clean +``` + +## Funding Acknowledgements +This project is co-financed by [TKI-Energie](https://topsectorenergie.nl/nl/maak-kennis-met-tse/tki-energie-en-industrie/) from the Top Consortia for Knowledge and Innovation (TKI) surcharge of +the Ministry of Economic Affairs and Climate Policy. diff --git a/README.rst b/README.rst deleted file mode 100644 index 16c598b..0000000 --- a/README.rst +++ /dev/null @@ -1,85 +0,0 @@ -Python Wrapper for S2 Flexibility Protocol -=========================================== -.. raw:: html -
- -
- - - - -
-
-
- -This Python package implements the message validation for the EN50491-12-2 "S2" standard for home and building energy management. This implementation -is based on the asyncapi description of the protocol provided in the `s2-ws-json `_ repository. - -To Install ------------ -You can install this package using pip or any Python dependency manager that collects the packages from PyPI: - -.. code-block:: bash - - pip install s2-python - pip install s2-python[ws] # for S2 over WebSockets - -The packages on PyPI may be found `here `_ - -Mypy support ------------- -s2-python uses pydantic at its core to define the various S2 messages. As such, the pydantic mypy plugin is required -for type checking to succeed. - -Add to your pyproject.toml: - -.. code-block:: toml - - [tool.mypy] - plugins = ['pydantic.mypy'] - -Example ---------- - -.. code-block:: python - - from s2python.common import PowerRange, CommodityQuantity - - # create s2 messages as Python objects - number_range = PowerRange( - start_of_range=4.0, - end_of_range=5.0, - commodity_quantity=CommodityQuantity.ELECTRIC_POWER_L1, - ) - # serialize s2 messages - number_range.to_json() - # deserialize s2 messages - json_str = '{"start_of_range": 4.0, "end_of_range": 5.0, "commodity_quantity": "ELECTRIC.POWER.L1"}' - PowerRange.from_json(json_str) - -Development -------------- - -For development, you can install the required dependencies using the following command: - - pip install -e .[testing,development,ws] - - -The tests can be run using tox: - - tox - -To build the package, you can use tox as well: - - tox -e build,clean - - -Funding Acknowledgements --------------------------- -This project is co-financed by `TKI-Energie`_ from the Top Consortia for Knowledge and Innovation (TKI) surcharge of -the Ministry of Economic Affairs and Climate Policy. - -.. _TKI-Energie: https://topsectorenergie.nl/nl/maak-kennis-met-tse/tki-energie-en-industrie/ - - - From d0b798463f7735b7d59405c4f9a87b0d5e7a42f1 Mon Sep 17 00:00:00 2001 From: Wester Coenraads <155964995+wcoenraads@users.noreply.github.com> Date: Wed, 22 Oct 2025 14:24:29 +0200 Subject: [PATCH 3/3] Adjust the layout of badges. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c3e3870..f142f32 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@
+
+