flask-konch


Nameflask-konch JSON
Version 1.2.0.post0 PyPI version JSON
download
home_pagehttps://github.com/sloria/flask-konch
SummaryAn improved shell command for the Flask CLI
upload_time2017-10-27 02:32:13
maintainer
docs_urlNone
authorSteven Loria
requires_python
licenseMIT
keywords flask-konch
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            ***********
Flask-Konch
***********

|pypi-package| |build-status|

.. image:: https://user-images.githubusercontent.com/2379650/32085344-61a939da-ba9c-11e7-84e2-39fbd9eadc9d.png
    :alt: Flask-Konch

An improved shell command for Flask
===================================

Flask-Konch adds an improved shell command, ``flask konch``, to the `Flask CLI <http://flask.pocoo.org/docs/0.11/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 <https://github.com/sloria/konch>`_, a shell configuration utility, under the hood.

Get it now
==========
::

    pip install flask-konch

Usage
=====

To run the shell:

.. code-block:: bash

   export FLASK_APP=path/to/app.py
   flask konch

To add additional variables to the shell context:

.. code-block:: python

   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) <http://flask.pocoo.org/docs/0.12/api/#flask.Flask.shell_context_processor>`_. 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_PTPY_VI_MODE``: Enable vi mode (must be using ``ptpython`` shell).



Project Links
=============

- PyPI: https://pypi.python.org/pypi/flask-konch
- Issues: https://github.com/sloria/flask-konch/issues

License
=======

MIT licensed. See the bundled `LICENSE <https://github.com/sloria/flask-konch/blob/master/LICENSE>`_ file for more details.


.. |pypi-package| image:: https://badge.fury.io/py/flask-konch.svg
    :target: http://badge.fury.io/py/flask-konch
    :alt: Latest version
.. |build-status| image:: https://travis-ci.org/sloria/flask-konch.svg
    :target: https://travis-ci.org/sloria/flask-konch
    :alt: Travis-CI



            

Raw data

            {
    "maintainer": "", 
    "docs_url": null, 
    "requires_python": "", 
    "maintainer_email": "", 
    "cheesecake_code_kwalitee_id": null, 
    "keywords": "flask-konch", 
    "upload_time": "2017-10-27 02:32:13", 
    "author": "Steven Loria", 
    "home_page": "https://github.com/sloria/flask-konch", 
    "github_user": "sloria", 
    "download_url": "https://pypi.python.org/packages/ac/58/fdae9ebbbae6104a83ff21e717007c4e767dd596e06e1ea6525843c5cf7c/flask-konch-1.2.0.post0.tar.gz", 
    "platform": "", 
    "version": "1.2.0.post0", 
    "cheesecake_documentation_id": null, 
    "description": "***********\nFlask-Konch\n***********\n\n|pypi-package| |build-status|\n\n.. image:: https://user-images.githubusercontent.com/2379650/32085344-61a939da-ba9c-11e7-84e2-39fbd9eadc9d.png\n    :alt: Flask-Konch\n\nAn improved shell command for Flask\n===================================\n\nFlask-Konch adds an improved shell command, ``flask konch``, to the `Flask CLI <http://flask.pocoo.org/docs/0.11/cli/>`_.\n\n\nBenefits of ``flask konch`` over ``flask shell``\n================================================\n\n- Uses IPython, BPython, or ptpython if available, and falls back to built-in interpreter\n- Automatically imports top-level Flask functions and classes by default\n- Define additional variables to include in the shell context\n- Configurable banner and prompt\n\nFlask-Konch uses `konch <https://github.com/sloria/konch>`_, a shell configuration utility, under the hood.\n\nGet it now\n==========\n::\n\n    pip install flask-konch\n\nUsage\n=====\n\nTo run the shell:\n\n.. code-block:: bash\n\n   export FLASK_APP=path/to/app.py\n   flask konch\n\nTo add additional variables to the shell context:\n\n.. code-block:: python\n\n   app = Flask(__name__)\n   app.config.update({\n      'KONCH_CONTEXT': {\n         'db': database,\n         'User': User,\n      }\n   })\n\n\nConfiguration options\n=====================\n\n- ``KONCH_FLASK_IMPORTS``: Whether to automatically import top-level Flask functions and classes. Defaults to ``True``.\n- ``KONCH_FLASK_SHELL_CONTEXT``: Whether to automatically import Flask shell context, as registered by `shell_context_processor(f) <http://flask.pocoo.org/docs/0.12/api/#flask.Flask.shell_context_processor>`_. Defaults to ``True``.\n- ``KONCH_CONTEXT``: Dictionary of additional variables to include in the shell context.\n- ``KONCH_SHELL``: May be ``'ipy'``, ``'bpy'``, ``'ptpy'``, ``'ptipy'``, ``'py'``, or ``'auto'`` (default).\n- ``KONCH_BANNER``: Custom banner.\n- ``KONCH_PROMPT``: Custom input prompt.\n- ``KONCH_OUTPUT``: Custom output prompt.\n- ``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.\n- ``KONCH_IPY_AUTORELOAD``: Whether to load and enable the IPython autoreload extension (must be using ``ipython`` shell).\n- ``KONCH_IPY_EXTENSIONS``: List of IPython extension names to load (must be using ``ipython`` shell).\n- ``KONCH_PTPY_VI_MODE``: Enable vi mode (must be using ``ptpython`` shell).\n\n\n\nProject Links\n=============\n\n- PyPI: https://pypi.python.org/pypi/flask-konch\n- Issues: https://github.com/sloria/flask-konch/issues\n\nLicense\n=======\n\nMIT licensed. See the bundled `LICENSE <https://github.com/sloria/flask-konch/blob/master/LICENSE>`_ file for more details.\n\n\n.. |pypi-package| image:: https://badge.fury.io/py/flask-konch.svg\n    :target: http://badge.fury.io/py/flask-konch\n    :alt: Latest version\n.. |build-status| image:: https://travis-ci.org/sloria/flask-konch.svg\n    :target: https://travis-ci.org/sloria/flask-konch\n    :alt: Travis-CI\n\n\n", 
    "tox": true, 
    "lcname": "flask-konch", 
    "bugtrack_url": null, 
    "github": true, 
    "coveralls": false, 
    "name": "flask-konch", 
    "license": "MIT", 
    "travis_ci": true, 
    "github_project": "flask-konch", 
    "summary": "An improved shell command for the Flask CLI", 
    "split_keywords": [
        "flask-konch"
    ], 
    "author_email": "sloria1@gmail.com", 
    "urls": [
        {
            "has_sig": false, 
            "upload_time": "2017-10-27T02:32:13", 
            "comment_text": "", 
            "python_version": "source", 
            "url": "https://pypi.python.org/packages/ac/58/fdae9ebbbae6104a83ff21e717007c4e767dd596e06e1ea6525843c5cf7c/flask-konch-1.2.0.post0.tar.gz", 
            "md5_digest": "7ef6d0922a9a02262ab08570171c9cc7", 
            "downloads": 0, 
            "filename": "flask-konch-1.2.0.post0.tar.gz", 
            "packagetype": "sdist", 
            "path": "ac/58/fdae9ebbbae6104a83ff21e717007c4e767dd596e06e1ea6525843c5cf7c/flask-konch-1.2.0.post0.tar.gz", 
            "size": 5052
        }, 
        {
            "has_sig": false, 
            "upload_time": "2017-10-27T02:32:11", 
            "comment_text": "", 
            "python_version": "py2.py3", 
            "url": "https://pypi.python.org/packages/df/e8/cd6b7313e5d2bde4d360c044c2199e6fb1cc83b375666394dd03c661e84b/flask_konch-1.2.0.post0-py2.py3-none-any.whl", 
            "md5_digest": "7944a35520d1dc30bd75ac0ac133db27", 
            "downloads": 0, 
            "filename": "flask_konch-1.2.0.post0-py2.py3-none-any.whl", 
            "packagetype": "bdist_wheel", 
            "path": "df/e8/cd6b7313e5d2bde4d360c044c2199e6fb1cc83b375666394dd03c661e84b/flask_konch-1.2.0.post0-py2.py3-none-any.whl", 
            "size": 6525
        }
    ], 
    "_id": null, 
    "cheesecake_installability_id": null
}