Home Guardian, a smart intruder inspection system, ran on Python 3, Raspberry Pi.
Here are the highlights of home_guardian:
-
Inherited from modern and the latest newest Python technologies:
-
Sending Email via Tom Email Service, email template engine powered by Jinjia2
-
Environment variable and configuration with pyhocon. Read
${ENVIRONMENT_VARIABLE}
when startup -
Testing with pytest
-
Formatting with black
-
Import sorting with isort
-
Static typing with mypy
-
Linting with flake8
-
Git hooks that run all the above with pre-commit
-
Deployment ready with Docker
-
Continuous Integration with GitHub Actions
-
Universal logging configuration based on Loguru. Log sample is like,
2021-11-09 10:57:55.362 | WARNING | MainThread | home_guardian.configuration.loguru_configuration:configure:61 - Loguru logging configured 2021-11-09 10:57:55.367 | WARNING | MainThread | home_guardian.configuration.thread_pool_configuration:configure:18 - Thread pool executor with 8 workers, executor: <concurrent.futures.thread.ThreadPoolExecutor object at 0x10ad487c0> 2021-11-09 10:57:55.603 | INFO | MainThread | home_guardian.repository.model.base.model:<module>:7 - SQLite database path: /Users/johnny/Projects/PyCharmProjects/home_guardian/home_guardian/_data/home_guardian.db 2021-11-09 10:57:55.603 | WARNING | MainThread | home_guardian.repository.model.base.model:<module>:9 - Initialized db file: <peewee.SqliteDatabase object at 0x10ad48fa0>
-
Clone or download this project.
$ git clone https://github.com/johnnymillergh/python_boilerplater.git
-
Build with newest PyCharm.
-
Click the green triangle to Run.
-
Install dependencies
$ pipenv install --dev
-
Setup pre-commit and pre-push hooks
$ pipenv run pre-commit install -t pre-commit $ pipenv run pre-commit install -t pre-push
$ pipenv run pytest --cov --cov-fail-under=50
-
Install global dependencies (optional if installed):
$ npm install -g conventional-changelog-cli
-
This will not overwrite any previous changelogs. The above generates a changelog based on commits since the last semver tag that matches the pattern of "Feature", "Fix", "Performance Improvement" or "Breaking Changes".
$ conventional-changelog -p angular -i CHANGELOG.md -s
-
If this is your first time using this tool and you want to generate all previous changelogs, you could do:
$ conventional-changelog -p angular -i CHANGELOG.md -s -r 0
- GitHub Actions is for building project and running tests.
Travis CI is for publishing Docker Hub images of SNAPSHOT and RELEASE.
Feel free to dive in! Open an issue.
This project exists thanks to all the people who contribute.
- Johnny Miller [@johnnymillergh]
- …
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]
This package was created with Cookiecutter and the sourcery-ai/python-best-practices-cookiecutter project template.
Inspired by How to set up a perfect Python project.
Icon from flaticon - Shield, home.
Apache License © Johnny Miller
2021 - Present