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 details)

Uploaded Source

Built Distribution

File details

Details for the file jupyter_reorder_python_imports-0.0.2.tar.gz.

File metadata

File hashes

Hashes for jupyter_reorder_python_imports-0.0.2.tar.gz
Algorithm Hash digest
SHA256 24394ccd1a671e20438dd8afd66b2f1e16cdaf1790aefce8b90a2072a3bb6f37
MD5 9fb5afedcf517ed324c2e6b2f9b063cb
BLAKE2b-256 e701d5b9a752f366fb20389f6bf62e007ed9530e4c4d79172741efe4d27dd0bc

See more details on using hashes here.

File details

Details for the file jupyter_reorder_python_imports-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_reorder_python_imports-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0d70bcc05ce63f313402bc562340b6951e60e8c793a397921ffff5e7b6cf6f18
MD5 7d866ebb40deb8271e76436838789d73
BLAKE2b-256 ea8e0b4e67cf781c256de368911880b5708360a81759cfc7757efb727dbf3e22

See more details on using hashes here.

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