Skip to main content

Smart Meter Data Collector Configurator Backend

Introduction

The backend is written with Python3 and bases on the following frameworks and libraries:

  • Uvicorn: ASGI server implementation, using uvloop and httptools.
  • Starlette: ASGI framework/toolkit
  • Pydantic: Data validation and settings management using Python type hinting.

For managing dependency packages and virtualenv poetry is used.

Development

Requirements

  • Python >= 3.10, <= 3.14
  • poetry
  • Optional software packages
    • debhelper
    • dh-make

Project Setup

With

poetry install

This will install all runtime and development dependencies for smartmeter-datacollector-configurator in a new virtual environment. Now you are ready to start working on the project.

Running during development

Inside the virtualenv run:

python -m smartmeter_datacollector_configurator [-c <config_path>] [-s <static_path>] [-d]

Now, the backend is running on port 8000 listening to 127.0.0.1. With the option -d hot-reloading and debug logs are enabled.

For development purposes it is possible to create an empty static folder inside the backend directory and start the application without the -s option. At the same time you start the frontend (npm run serve) in a separate shell. The API calls of the frontend, during development, are directed to a local backend to port 8000.

Command line arguments

The following command line arguments are supported:

  • -h, --help: Shows the help output of smartmeter-datacollector-configurator.
  • -c, --config PATH: Directory path where the configuration files are read and deployed (default: Current directory ./).
  • -s,--static PATH: Directory path where the static frontend files are located. If left empty the app check if a static directory exists in the package location and falls back to the current directory ./static.
  • --host: Listening host IP (default: 127.0.0.1).
  • --port: Listening port number (default: 8000).
  • -d, --dev: Enable development mode which provides debug logging and hot reloading.

Custom commands & workflows

smartmeter-datacollector-configurator offers a few custom poetry run poe commands to simplify certain development workflows:

  • build_py builds a Python package which can be uploaded to PyPI
  • build_shiv builds a self-contained zipapp (.pyz) including dependencies (but without interpreter) using shiv
  • build_deb builds a Debian package for the current development platform
  • build_srcdeb builds a Debian source package which can be used to build a Debian (binary) package for any platform
  • clean removes build output from the working directory
  • debianize creates a debian/ directory used to build Debian source / binary packages
  • format automatically adjusts the code to follow the autopep8 code formatting rules
  • format_check checks if the code follows the autopep8 code formatting rules
  • isort automatically re-orders the import statements using isort
  • isort_check checks if the order of the import statements is correct using isort
  • lint automatically adjust the code to follow the pylint rules defined in pyproject.toml
  • lint_check checks if the code follows the pylint rules defined in pyproject.toml
  • test runs all unit tests using pytest

Make sure to run format_check / format, isort_check / isort, lint_check / lintbefore committing changes to the repository to avoid unnecessary development cycles. smartmeter-datacollector-configurator uses GitHub Actions to check if these rules apply.

Visit Wiki - Creating a Release for further documentation about contributing.

Metadata

Release files for smartmeter-datacollector-configurator 2.0.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 smartmeter-datacollector-configurator 2.0.0
File Size Uploaded
smartmeter_datacollector_configurator-2.0.0.tar.gz 349.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smartmeter-datacollector-configurator 2.0.0
File Interpreter ABI Platform
smartmeter_datacollector_configurator-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 700.0 kB

Release files / smartmeter_datacollector_configurator-2.0.0.tar.gz

Download URL smartmeter_datacollector_configurator-2.0.0.tar.gz
Size 349.6 kB
Tags Source
SHA-256 checksum
How to use checksums
62cb04e4763e937c0793ac6fe310932de4e478bdb8d0a0201fe703b4c9c190a7
BLAKE2b-256 checksum
How to use checksums
43ea6df2fe029310b5fc6af8e30fd64a22440ac2750ca01c26bdc48fd9a228d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / smartmeter_datacollector_configurator-2.0.0-py3-none-any.whl

Download URL smartmeter_datacollector_configurator-2.0.0-py3-none-any.whl
Size 350.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8816c7aae2c3c61d38289d3572dcf6455fbbfaa9efe194e6ba023213d9528d57
BLAKE2b-256 checksum
How to use checksums
bc13333c4a632084bb63b06f6ff13f9b84d9bf800a97efa229ad6f1a6a42bdf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.0

2 release files

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