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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smartmeter_datacollector_configurator-2.0.0.tar.gz (349.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file smartmeter_datacollector_configurator-2.0.0.tar.gz.

File metadata

File hashes

Hashes for smartmeter_datacollector_configurator-2.0.0.tar.gz
Algorithm Hash digest
SHA256 62cb04e4763e937c0793ac6fe310932de4e478bdb8d0a0201fe703b4c9c190a7
MD5 9f2fe0211a165c072eb14b36f882adc8
BLAKE2b-256 43ea6df2fe029310b5fc6af8e30fd64a22440ac2750ca01c26bdc48fd9a228d0

See more details on using hashes here.

File details

Details for the file smartmeter_datacollector_configurator-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for smartmeter_datacollector_configurator-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8816c7aae2c3c61d38289d3572dcf6455fbbfaa9efe194e6ba023213d9528d57
MD5 209eaf24aa21e96138d03de9a89dd3ee
BLAKE2b-256 bc13333c4a632084bb63b06f6ff13f9b84d9bf800a97efa229ad6f1a6a42bdf6

See more details on using hashes here.

Supported by

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