Flask based library to help structure an application with an eye towards CLI apps, not just web.
Project description
Flac
Flask based library to help structure an application with an eye towards CLI apps, not just web.
Features
-
App factory pattern
- blueprints (web & CLI)
-
CLI Integration
- custom command
- two-phase init for blueprints
-
Configuration
- .env & .flaskenv
- from files
- from environment
- alternate settings for testing, dev, prod
-
Logging
- logs are probably cheap, don't prematurely optimize
- centralize your logs to an aggregation service
- .info logs are show/saved by default
- cli output is plain text
- saved logs are JSON
- saved logs go to syslog, let devops handle the aggregation
-
Testing
- alternate DB URI
- pytest & fixtures
-
Flask-SQLAlchemy
- ext init
- fixtures to get db to ensure app context
-
Celery
- refresh process pool
-
cli integration with the ability to customize the app's configuration using global cli options
someapp --debug --with-sentry run-some-task
-
pytest fixtures for app initialization
-
demo cli test that uses separate process
Develoment
Copier Template
Project structure and tooling mostly derives from the copier-py-package, see its documentation for context and additional instructions.
This project can be updated from the upstream repo, see updates
Project Setup
From zero to hero (passing tests that is):
- Ensure host dependencies are installed:
-
Start docker service dependencies (if applicable):
docker compose up -d
-
Run tests:
nox
-
Use mise to activate the virtualenv for local dev
-
Install deps in active virtualenv:
reqs bootstrap
reqs sync
-
Configure pre-commit:
pre-commit install
Versions
Versions are date based. Tools:
- Current version:
hatch version
- Bump version based on date, tag, push:
mise run bump
- Options:
mise run bump -- --help
- Options:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file flask_flac-0.20241022.1.tar.gz
.
File metadata
- Download URL: flask_flac-0.20241022.1.tar.gz
- Upload date:
- Size: 96.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ded798f55ea31830c0c0c3b0ff383e3e39745ab73ca82f1deb654a8913bccb1b |
|
MD5 | f85434cc08430fc63cb7b7bf7c713c59 |
|
BLAKE2b-256 | e8a4dfcfe3877cf794aad8467c69cd3fbcd5e3c52abfcbaf153845d1e868c8b3 |
File details
Details for the file flask_flac-0.20241022.1-py2.py3-none-any.whl
.
File metadata
- Download URL: flask_flac-0.20241022.1-py2.py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 364df5e5ad26686dc076e40d8453cef627dd2540264ab3629413243ea4af9957 |
|
MD5 | e6f264b6788ee65f862b50847ba3858d |
|
BLAKE2b-256 | 334bba36f16cd76d053a94507cd45a35e37f870a97c2a06520bf71646a891217 |