Skip to main content

Replace default `flask shell` command by similar command running IPython.

Project description

Flask-Shell-IPython

flask-shell-ipython is a Python package that replaces the default flask shell command with a similar command that runs IPython. This provides an enhanced interactive Python shell with additional features like syntax highlighting, tab-completion, and more.

Installation

To install flask-shell-ipython, simply run:

pip install flask-shell-ipython

Usage

After installing flask-shell-ipython, the flask shell command will automatically use IPython instead of the default Python shell. There are no additional steps required.

flask shell

You can also pass any valid IPython arguments after the flask shell command:

flask shell --no-banner -i foo.py

Configuration

You can configure IPython settings by adding an IPYTHON_CONFIG key to your Flask app's configuration. The value should be a dictionary containing the configuration options you'd like to set.

For example:

app.config['IPYTHON_CONFIG'] = {
    'InteractiveShell': {
        'colors': 'Linux',
        'confirm_exit': False,
    },
}

Testing

To run tests for flask-shell-ipython, install the pytest-forked plugin, which enables running tests in isolated forked subprocesses to ensure running a clean IPython instance for each test case.

Installing Dependencies

Install testing dependencies from requirements-test.txt:

pip install -r requirements-test.txt

Running Tests

After installing the dependencies, run the test suite with the --forked option:

pytest --forked

Please, note that does pytest-forked does not work on Windows. To test flask-shell-ipython on Windows run each test manually.

License

flask-shell-ipython is licensed under the MIT License. See the LICENSE file for more information.

Contributing

If you'd like to contribute to the project, feel free to submit a pull request on the GitHub repository at http://github.com/ei-grad/flask-shell-ipython.

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_shell_ipython-0.5.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

flask_shell_ipython-0.5.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file flask_shell_ipython-0.5.2.tar.gz.

File metadata

  • Download URL: flask_shell_ipython-0.5.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for flask_shell_ipython-0.5.2.tar.gz
Algorithm Hash digest
SHA256 d007f13a8bc477a66ba1926cf7246917eae49169647425e6248a1765607955f8
MD5 6c2ead7f2c0cfe8800dff894a4d9b11d
BLAKE2b-256 2f3f71b2612944b713ae7cc60a0ecb36c1d9430a0b200f57cb641affff533d96

See more details on using hashes here.

Provenance

File details

Details for the file flask_shell_ipython-0.5.2-py3-none-any.whl.

File metadata

File hashes

Hashes for flask_shell_ipython-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e30ec443bcf79c58253b5fd8edb9f4c3e45d8d339063edd0b2fbcdc26f74a320
MD5 de5eb99c7ec580e0354cdad8aeceb3c1
BLAKE2b-256 66f18b80153b0d5df1b7f8fb1d6d7b3edfcdaf1e6255bb9916eb191528ec1bfb

See more details on using hashes here.

Provenance

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