An example of a minimal Python 3.11+ project that contains an web application built with aiohttp. At the same time the project exemplifies:
- aiohttp server;
- logging formatting;
- unit tests;
- tox automation for:
- flake8 style enforcement;
- running unit tests and coverage;
- github-actions and coveralls integration;
- bandit to check common security issues in Python code;
- building documentation for readthedocs.
Installation can be done:
- Github - without cloning
$ pip install git+https://github.com/blankdots/minimalpy.git
- cloning repository:
$ git clone [email protected]:blankdots/minimalpy.git
$ cd minimalpy
$ pip install .
After install the application can be started like: $ minimal
In order to run the tests: $ tox
in the root directory of the git project.
To build documentation locally:
$ cd docs
$ make html
Following a similar structure as described in: Structuring Your (Python) Project.
Main application resides in minimalpy
folder, documentation in docs
and unit tests in tests
.
.
├── minimalpy
│ ├── __init__.py
│ └── server.py
├── data
│ └── data.json
├── docs
│ ├── conf.py
│ ├── index.rst
│ └── Makefile
├── bandit.yml
├── LICENSE
├── README.md
├── readthedocs.yml
├── requirements.txt
├── setup.py
├── tests
│ ├── conftest.py
│ ├── coveralls.py
│ ├── __init__.py
│ └── test_server.py
└── tox.ini
build and run using docker
:
docker build -t minimalpy .
docker run -p 5430:5430 minimalpy
minimalpy
python and all it sources are released under Apache License 2.0
.
Some projects similar in scope: