An improved shell command for the Flask CLI
Project description
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_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 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_PTPY_VI_MODE: Enable vi mode (must be using ptpython shell).
Project Links
License
MIT licensed. See the bundled LICENSE file for more details.
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
Hashes for flask_konch-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 264bac6dc0fb41e886f19ed265c7f7ce69783ac5b70700ea644f8f9190ccee0a |
|
MD5 | 1ed467d5789209d5b9bf13acbef5aaf4 |
|
BLAKE2b-256 | 8b3eb0cbb55843ce29fdeca3a42677300e0f478fdb5f73a914ffe98213829c1b |