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 pipenv is used.
Development
Requirements
- Python >= 3.8
pipenv
- Optional software packages (Debian / Ubuntu)
- python3-all
- debhelper
- dh-python
Project Setup
With
pipenv install --dev
a new virtualenv
is set up and the listed (inclusive dev) dependencies in the Pipfile are installed.
pipenv shell
activates the created virtualenv
and opens a shell inside.
You can also run a command directly with:
pipenv run <command>
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 ofsmartmeter-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 pipenv run
commands to simplify certain development workflows:
build_check
usestwine
to check if the built Python package will be accepted byPiPI
.build_deb
builds a Debian package for the current development plattform.build_srcdeb
builds a Debian source package which can be used to build a Debian (binary) package for any platform (e.g. usingpbuilder
)build
builds a Python package which can be uploaded toPyPI
usingtwine
.debianize
creates adebian/
directory used to build Debian source / binary packages.format_check
checks if the code follows theautopep8
code formatting rules.format
automatically adjusts the code to follow theautopep8
code formatting rules.isort_check
checks if the order of the import statements is correct usingisort
.isort
automatically re-orders the import statements usingisort
.lint_check
checks if the code follows thepylint
rules defined inpyproject.toml
.lint
automatically adjust the code to follow thepylint
rules defined inpyproject.toml
.setup_check
checks whether the dependencies defined inPipfile
/Pipfile.lock
are in sync withsetup.py
.setup
synchronizes the dependencies defined inPipfile
/Pipfile.lock
withsetup.py
.
Make sure to run format_check
/ format
, isort_check
/ isort
, lint_check
/ lint
, license
, setup_check
/ setup
before 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
Release history Release notifications | RSS feed
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
Hashes for smartmeter-datacollector-configurator-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4cf0fe5a75475a2d30f5e76df899ea8df10eaf3cb4f652e9712bf4a940bd715 |
|
MD5 | becbe087b5b87529e435125cb0c26a08 |
|
BLAKE2b-256 | 43d1b7346b888c31718cb760e0d171b97ac2981d9d6bc5eebe05bec80cb610e6 |
Hashes for smartmeter_datacollector_configurator-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c50b04647f31b1506ebbe99627b4268cb8251957b8ab180a6e07e26f30c9d56 |
|
MD5 | c175796e3694aed88f3b20c75c58c98b |
|
BLAKE2b-256 | 4b85783e53043ce6890237979914bec9c008d38626fe82bc9d1bfcd2e5480d18 |