Flask based wrapper for SANE (in this case scan-image tool)
- Getting connected devices + supported devices scanning options.
- Performing scans (with tracking operation progress).
- Scanned files management (download, preview, update, etc.).
- Easy setup via docker compose.
- Minimalist Flask application without usage of 3rd party plugins (adapters).
- Swagger documentation.
- Gunicorn errors/access logging.
- Cron based gunicorn logs clearing.
- Setup project according to
Production Setup
. - Connect scanner / printer with scanner to host device USB port.
- Use bare API requests (api docs accessible at
/docs
ifHOST_DOCS
set to1
) or web app to interact with connected devices.
The main goals of the project was to:
- setup complete Flask app without 3rd party plugins (like
Flask-SQLAlchemy
orFlask-Migrate
). - add some core features like data serialization and swagger docs.
- test my own approach to flask project structure.
- setup background process using
cron
.
In the end, getting a working and functional app was a nice bonus.
- Clone this repo.
- Create
.env
and set needed variables.
cp .env.template .env
- Start app services
docker compose -f docker-compose-dev.yml up
- Generate swagger docs.
python3 generate_swagger_docs.py
- Run database migration.
python3 migrate.py
- Clone this repo.
- Create
.env
and set needed variables.
cp .env.template .env
- Run docker container.
sudo docker compose up -d
App contains basic tests suit. To run them:
pytest -v tests/