Package: smartmeter-datacollector-configurator
Smart Meter Data Collector Configurator BackendIntroductionThe backend is written with Python3 and bases on the following frameworks and libraries:Uvicorn: ASGI server implementation, using uvloop and httptools.Starlette: ASGI framework/toolkitPydantic: Data validation and settings management using Python type hinting.For managing dependency packages and virtualenvpipenvis used.DevelopmentRequirementsPython >= 3.8pipenvOptional software packages (Debian / Ubuntu)python3-alldebhelperdh-pythonProject SetupWithpipenv install --deva newvirtualenvis set up and the listed (inclusive dev) dependencies in the Pipfile are installed.pipenv shellactivates the createdvirtualenvand opens a shell inside.You can also run a command directly with:pipenv run <command>Running during developmentInside thevirtualenvrun:python -m smartmeter_datacollector_configurator [-c <config_path>] [-s <static_path>] [-d]Now, the backend is running on port8000listening to127.0.0.1. With the option-dhot-reloading and debug logs are enabled.For development purposes it is possible to create an emptystaticfolder inside thebackenddirectory and start the application without the-soption. 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 argumentsThe 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 & workflowssmartmeter-datacollector-configuratoroffers a few custompipenv runcommands to simplify certain development workflows:build_checkusestwineto check if the built Python package will be accepted byPiPI.build_debbuilds a Debian package for the current development plattform.build_srcdebbuilds a Debian source package which can be used to build a Debian (binary) package for any platform (e.g. usingpbuilder)buildbuilds a Python package which can be uploaded toPyPIusingtwine.debianizecreates adebian/directory used to build Debian source / binary packages.format_checkchecks if the code follows theautopep8code formatting rules.formatautomatically adjusts the code to follow theautopep8code formatting rules.isort_checkchecks if the order of the import statements is correct usingisort.isortautomatically re-orders the import statements usingisort.lint_checkchecks if the code follows thepylintrules defined inpyproject.toml.lintautomatically adjust the code to follow thepylintrules defined inpyproject.toml.setup_checkchecks whether the dependencies defined inPipfile/Pipfile.lockare in sync withsetup.py.setupsynchronizes the dependencies defined inPipfile/Pipfile.lockwithsetup.py.Make sure to runformat_check/format,isort_check/isort,lint_check/lint,license,setup_check/setupbefore committing changes to the repository to avoid unnecessary development cycles.smartmeter-datacollector-configuratorusesGitHub Actionsto check if these rules apply.VisitWiki - Creating a Releasefor further documentation about contributing.