Skip to main content

Reorder python imports for Jupyter notebook and lab

Project description

jupyter-reorder-python-imports

reorder-python-imports is a great library. Now available in Jupyter notebook and lab.

What does it do?

Once loaded, automatically format python imports according to reorder-python-imports using their formatting methods.

Quickstart

python -m pip install jupyter-reorder-python-imports

Import into Jupyter using two methods:

%load_ext jupyter_reorder_python_imports

Or,

import jupyter_reorder_python_imports

jupyter_reorder_python_imports.load()

The latter method allows for specifying the minimum python version (as a tuple of integers) to be used for removing obsolete __future__ imports. For example, jupyter_reorder_python_imports.load(min_python_version=(3,9)) specifies 3.9 as the minimum python version.

See the examples folder for some examples.

Testing

Tests use playwright. Prior to running the tests execute: python -m playwright install --with-deps firefox

If desired, pass the --no-headless flag to pytest for local debugging.

Contributions

TODO:

  • Improve testing
  • Read configuration from pyproject.toml

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

jupyter_reorder_python_imports-0.0.2.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

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