Flask-Konch
An improved shell command for Flask
Flask-Konch adds an improved shell command, flask konch, to the Flask CLI.
Benefits of flask konch over flask shell
Uses IPython, BPython, or ptpython if available, and falls back to built-in interpreter
Automatically imports top-level Flask functions and classes by default
Define additional variables to include in the shell context
Configurable banner and prompt
Flask-Konch uses konch, a shell configuration utility, under the hood.
Get it now
pip install flask-konch
Usage
To run the shell:
export FLASK_APP=path/to/app.py
flask konch
To add additional variables to the shell context:
app = Flask(__name__)
app.config.update({"KONCH_CONTEXT": {"db": database, "User": User}})
Configuration options
KONCH_FLASK_IMPORTS: Whether to automatically import top-level Flask functions and classes. Defaults to True.
KONCH_FLASK_SHELL_CONTEXT: Whether to automatically import Flask shell context, as registered by shell_context_processor(f). Defaults to True.
KONCH_CONTEXT: Dictionary of additional variables to include in the shell context.
KONCH_SHELL: May be 'ipy', 'bpy', 'ptpy', 'ptipy', 'py', or 'auto' (default).
KONCH_BANNER: Custom banner.
KONCH_PROMPT: Custom input prompt.
KONCH_OUTPUT: Custom output prompt.
KONCH_CONTEXT_FORMAT: Format to display shell context. May be 'full', 'short', or a function that receives the context dictionary as input and returns a string.
KONCH_IPY_AUTORELOAD: Whether to load and enable the IPython autoreload extension (must be using ipython shell).
KONCH_IPY_EXTENSIONS: List of IPython extension names to load (must be using ipython shell).
KONCH_IPY_COLORS: IPython color style.
KONCH_IPY_HIGHLIGHTING_STYLE: IPython code highlighting style.
KONCH_PTPY_VI_MODE: Enable vi mode (must be using ptpython shell).
License
MIT licensed. See the bundled LICENSE file for more details.
Release files for flask-konch 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flask-konch-3.0.0.tar.gz | 6.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flask_konch-3.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.4 kB
Release files / flask-konch-3.0.0.tar.gz
| Download URL | flask-konch-3.0.0.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8cbf06e6cf8728e69e44851d8acae135777c7914df4e2a566d1b8d27cba4ef00
|
|
BLAKE2b-256 checksum How to use checksums |
7f35d1b60873174944277240c880771a5b26ff855def8ea1eceb78d07a4aa84c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / flask_konch-3.0.0-py3-none-any.whl
| Download URL | flask_konch-3.0.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5bb6ebf19b625700406a5bbd0a4d3fa6026f1c080129c6266ebfd99e926da8f3
|
|
BLAKE2b-256 checksum How to use checksums |
d82de4e968fe7e4de5166bc3c8bc49501bc1368886c266d706dc45e2ec183eec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|