Skip to main content

Run any Python code quality tool on a Jupyter Notebook!

Project description

nbQA

https://dev.azure.com/megorelli/megorelli/_apis/build/status/MarcoGorelli.nbQA?branchName=master https://img.shields.io/azure-devops/coverage/megorelli/megorelli/1/master.svg

Adapter to run any code-quality tool on a Jupyter notebook.

The general command is

nbqa <command> <root directory> <flags for command>

For example, you could run:

nbqa flake8 my_notebook.ipynb
nbqa black . --check
nbqa mypy --missing-imports
nbqa pytest . --doctest-modules

Installation: nbQA has no dependencies, so as long as you have Python3.6+, you can do

pip install -U nbqa

and it’ll work without conflicting with any of your existing installs!

Supported third party packages

In theory, nbqa can adapt any Python code-quality tool to a Jupyter Notebook.

In practice, here are the tools I’ve actually tested: - flake8 - black - pytest - mypy (make sure you will need to have __init__ files in each subdirectory) - doctest (as long as you run it via pytest with the –doctest-modules flag)

History

0.1.0 (2020-07-13)

  • First release on PyPI.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nbqa-0.1.2.tar.gz (12.5 kB view hashes)

Uploaded Source

Built Distribution

nbqa-0.1.2-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

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