Coder Social home page Coder Social logo

flask-konch's Introduction

Flask-Konch

Latest PyPI version Build status

Flask-Konch screenshot

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.

flask-konch's People

Contributors

dependabot[bot] avatar pre-commit-ci[bot] avatar sbusch avatar sloria avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

flask-konch's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.