Skip to main content

Smart Meter Data Collector Configurator

Project description

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.

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

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-1.3.0.tar.gz.

File metadata

File hashes

Hashes for smartmeter_datacollector_configurator-1.3.0.tar.gz
Algorithm Hash digest
SHA256 7112e7635fc716c1e7c97315d2ef8e1129eae5cfe8957378c27a05c36f9c10cb
MD5 2d6899cfe9d44fd0de61794279ffff3b
BLAKE2b-256 4ef34b898fb2d598425a3d75d7809f5e3596cb9398112b6ca98d0748791d7138

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for smartmeter_datacollector_configurator-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db72ab40aeb89b6b2cf40f4173e924b671c8b7d66ae55f8571b2d6b5e10b68bd
MD5 d00668bcf770ae406cae3705965036a0
BLAKE2b-256 00168eece327f84817293af9e3c764c540515993af7f347eb5ae0e50537f9192

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