Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/znitche/piscan
backend for SANE operations
https://github.com/znitche/piscan
alembic background-jobs file-server file-storage flask marshmallow rest-api scanner sqlalchemy
Last synced: about 10 hours ago
JSON representation
backend for SANE operations
- Host: GitHub
- URL: https://github.com/znitche/piscan
- Owner: zNitche
- License: mit
- Created: 2024-01-26T19:47:29.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-19T10:03:44.000Z (9 months ago)
- Last Synced: 2024-12-01T14:24:03.266Z (about 2 months ago)
- Topics: alembic, background-jobs, file-server, file-storage, flask, marshmallow, rest-api, scanner, sqlalchemy
- Language: Python
- Homepage:
- Size: 148 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# piScan
Flask based wrapper for SANE (in this case scan-image tool)---
### Features:
- 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.### How to use it:
1. Setup project according to `Production Setup`.
2. Connect scanner / printer with scanner to host device USB port.
3. Use bare API requests (api docs accessible at `/docs` if `HOST_DOCS` set to `1`) or [web app](https://github.com/zNitche/piScanUI) to interact with connected devices.### Project Goals:
The main goals of the project was to:
- setup complete Flask app without 3rd party plugins (like `Flask-SQLAlchemy` or `Flask-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.
### Dev Setup
1. Clone this repo.
2. Create `.env` and set needed variables.
```
cp .env.template .env
```3. Start app services
```
docker compose -f docker-compose-dev.yml up
```##### Extra Steps (needed during development)
- Generate swagger docs.
```
python3 generate_swagger_docs.py
```- Run database migration.
```
python3 migrate.py
```### Production Setup
1. Clone this repo.
2. Create `.env` and set needed variables.
```
cp .env.template .env
```3. Run docker container.
```
sudo docker compose up -d
```### Tests
App contains basic tests suit. To run them:
```
pytest -v tests/
```