Skip to main content

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):

  1. Ensure host dependencies are installed:
  • reqs: for virtualenv python deps
  • mise: for everything else, e.g. terraform, npm
  1. Start docker service dependencies (if applicable):

    docker compose up -d

  2. Run tests:

    nox

  3. Use mise to activate the virtualenv for local dev

  4. Install deps in active virtualenv:

    • reqs bootstrap
    • reqs sync
  5. 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask_flac-0.20241018.1.tar.gz (82.2 kB view details)

Uploaded Source

Built Distribution

flask_flac-0.20241018.1-py2.py3-none-any.whl (14.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file flask_flac-0.20241018.1.tar.gz.

File metadata

  • Download URL: flask_flac-0.20241018.1.tar.gz
  • Upload date:
  • Size: 82.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for flask_flac-0.20241018.1.tar.gz
Algorithm Hash digest
SHA256 ad15de75baa7fa20acdf9b9bd57e80249c5debc6f62cb1e739588da6a6921ce4
MD5 63b6ecdfe340d9a9036952dff8d7f7cb
BLAKE2b-256 c6c43086669dbff17cc29e501d7bf57938542cddf92e389233c161915a1876e0

See more details on using hashes here.

File details

Details for the file flask_flac-0.20241018.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for flask_flac-0.20241018.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ab7d719a79c1e5019de84d7a41c3e946e780dc9c94cb0eba5fa5f1762b53dff4
MD5 bf707627fedf8d13dfb21ee5dffb46f1
BLAKE2b-256 92bb2c980f7bc3839ed3c472bb7417fe955b8e725f59f062f2bdeb058968b01e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page