{"id":13735291,"url":"https://github.com/s-weigand/flake8-nb","last_synced_at":"2025-10-10T18:46:33.271Z","repository":{"id":35203198,"uuid":"211533352","full_name":"s-weigand/flake8-nb","owner":"s-weigand","description":"Flake8 checking for jupyter notebooks","archived":false,"fork":false,"pushed_at":"2024-11-18T07:21:07.000Z","size":652,"stargazers_count":28,"open_issues_count":8,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-18T18:46:59.987Z","etag":null,"topics":["cli","code-quality-analyzer","flake8","flake8-nb","jupyter-notebooks","notebook","quality-assurance","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/s-weigand.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null}},"created_at":"2019-09-28T16:58:21.000Z","updated_at":"2024-11-07T07:41:17.000Z","dependencies_parsed_at":"2023-02-16T05:01:28.110Z","dependency_job_id":"5a3672b2-e771-44f8-9edc-667685ec9020","html_url":"https://github.com/s-weigand/flake8-nb","commit_stats":{"total_commits":486,"total_committers":12,"mean_commits":40.5,"dds":"0.24279835390946503","last_synced_commit":"9d88c59f6fae6219a34cf3d8ef81b5ce6d7843ac"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-weigand%2Fflake8-nb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-weigand%2Fflake8-nb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-weigand%2Fflake8-nb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-weigand%2Fflake8-nb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s-weigand","download_url":"https://codeload.github.com/s-weigand/flake8-nb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250080505,"owners_count":21371519,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","code-quality-analyzer","flake8","flake8-nb","jupyter-notebooks","notebook","quality-assurance","testing-tools"],"created_at":"2024-08-03T03:01:05.134Z","updated_at":"2025-10-10T18:46:28.234Z","avatar_url":"https://github.com/s-weigand.png","language":"Python","funding_links":[],"categories":["Integrations"],"sub_categories":[],"readme":"# flake8-nb\n\n[![PyPi Version](https://img.shields.io/pypi/v/flake8_nb.svg)](https://pypi.org/project/flake8-nb/)\n[![Conda Version](https://img.shields.io/conda/vn/conda-forge/flake8-nb.svg)](https://anaconda.org/conda-forge/flake8-nb)\n[![Supported Python Versions](https://img.shields.io/pypi/pyversions/flake8_nb.svg)](https://pypi.org/project/flake8-nb/)\n[![Pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)](https://github.com/pre-commit/pre-commit)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n[![Actions Status](https://github.com/s-weigand/flake8-nb/workflows/Tests/badge.svg)](https://github.com/s-weigand/flake8-nb/actions)\n[![Documentation Status](https://readthedocs.org/projects/flake8-nb/badge/?version=latest)](https://flake8-nb.readthedocs.io/en/latest/?badge=latest)\n[![Testing Coverage](https://codecov.io/gh/s-weigand/flake8-nb/branch/main/graph/badge.svg)](https://codecov.io/gh/s-weigand/flake8-nb)\n[![Documentation Coverage](https://flake8-nb.readthedocs.io/en/latest/_static/interrogate_badge.svg)](https://github.com/s-weigand/flake8-nb)\n\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/d02b436a637243a1b626b74d018c3bbe)](https://www.codacy.com/gh/s-weigand/flake8-nb/dashboard?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=s-weigand/flake8-nb\u0026utm_campaign=Badge_Grade)\n[![All Contributors](https://img.shields.io/github/all-contributors/s-weigand/flake8-nb)](#contributors)\n[![Code style Python: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Binder](https://static.mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/s-weigand/flake8-nb.git/main?urlpath=lab%2Ftree%2Ftests%2Fdata%2Fnotebooks)\n\n[`flake8`](https://github.com/pycqa/flake8) checking for jupyter notebooks.\n\nThis tool is mainly aimed towards writing tutorials/lecture material, where one might also want\nto show off bad practices and/or errors, while still keeping the rest of the code clean and\nwithout adding the complexity of tooling to the readers\n(see [docs on cell tags](https://flake8-nb.readthedocs.io/en/latest/usage.html#cell-tags)).\n\nBasically this is a hack on the `flake8`'s `Application` class,\nwhich adds parsing and a cell based formatter for `*.ipynb` files.\n\nThis is **NOT A PLUGIN** but a stand alone CLI tool/[pre-commit](https://pre-commit.com/) hook to be used instead of the `flake8` command/hook.\n\n## Features\n\n- flake8 CLI tests for jupyter notebooks\n- Full base functionality of `flake8` and its plugins\n- Input cell based error formatting (Execution count/code cell count/total cellcount)\n- Report fine tuning with cell-tags (`flake8-noqa-tags` see [usage](https://flake8-nb.readthedocs.io/en/latest/usage.html#cell-tags))\n- [pre-commit](https://pre-commit.com/) hook\n\n## Examples\n\n## Default reporting\n\nIf you had a notebook with name `example_notebook.ipynb`, where the code cell\nwhich was executed as 34th cell (`In[34]`) had the following code:\n\n```python\nbad_formatted_dict = {\"missing\":\"space\"}\n```\n\nrunning `flake8_nb` would result in the following output.\n\n### Execution count\n\n```bash\n$ flake8_nb example_notebook.ipynb\nexample_notebook.ipynb#In[34]:1:31: E231 missing whitespace after ':'\n```\n\n## Custom reporting\n\nIf you prefer the reports to show the cell number rather then the execution count you\ncan use the `--notebook-cell-format` option, given that the cell is the 5th `code` cell\nand 10th total cell (taking `raw` and `markdown` cells into account),\nyou will get the following output.\n\n### Code cell count\n\n```bash\n$ flake8_nb --notebook-cell-format '{nb_path}:code_cell#{code_cell_count}' example_notebook.ipynb\nexample_notebook.ipynb:code_cell#5:1:31: E231 missing whitespace after ':'\n```\n\n### Total cell count\n\n```bash\n$ flake8_nb --notebook-cell-format '{nb_path}:cell#{total_cell_count}' example_notebook.ipynb\nexample_notebook.ipynb:cell#10:1:31: E231 missing whitespace after ':'\n```\n\n## Similar projects\n\n- [nbQA](https://github.com/nbQA-dev/nbQA):\n  Run isort, pyupgrade, mypy, pylint, flake8, mdformat, black, blacken-docs, and more on Jupyter Notebooks\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/s-weigand\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/9513634?v=4?s=100\" width=\"100px;\" alt=\"Sebastian Weigand\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSebastian Weigand\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/s-weigand/flake8-nb/commits?author=s-weigand\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-s-weigand\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"#maintenance-s-weigand\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"#projectManagement-s-weigand\" title=\"Project Management\"\u003e📆\u003c/a\u003e \u003ca href=\"#infra-s-weigand\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e \u003ca href=\"https://github.com/s-weigand/flake8-nb/commits?author=s-weigand\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"https://github.com/s-weigand/flake8-nb/commits?author=s-weigand\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://jtmiclat.me\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/30991698?v=4?s=100\" width=\"100px;\" alt=\"Jt Miclat\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJt Miclat\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/s-weigand/flake8-nb/issues?q=author%3Ajtmiclat\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://eisenhauer.io\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/3607591?v=4?s=100\" width=\"100px;\" alt=\"Philipp Eisenhauer\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ePhilipp Eisenhauer\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/s-weigand/flake8-nb/issues?q=author%3Apeisenha\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://shmokmt.github.io/\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/32533860?v=4?s=100\" width=\"100px;\" alt=\"Shoma Okamoto\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eShoma Okamoto\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/s-weigand/flake8-nb/commits?author=shmokmt\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://marcogorelli.github.io/\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/33491632?v=4?s=100\" width=\"100px;\" alt=\"Marco Gorelli\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMarco Gorelli\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#tool-MarcoGorelli\" title=\"Tools\"\u003e🔧\u003c/a\u003e \u003ca href=\"https://github.com/s-weigand/flake8-nb/commits?author=MarcoGorelli\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://blog.ouseful.info\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/82988?v=4?s=100\" width=\"100px;\" alt=\"Tony Hirst\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTony Hirst\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-psychemedia\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/Dobatymo\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/7647594?v=4?s=100\" width=\"100px;\" alt=\"Dobatymo\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDobatymo\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/s-weigand/flake8-nb/issues?q=author%3ADobatymo\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/AlpAribal\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/6286038?v=4?s=100\" width=\"100px;\" alt=\"Alp Arıbal\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAlp Arıbal\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/s-weigand/flake8-nb/issues?q=author%3AAlpAribal\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://www.tuhh.de/mls/en/institute/associates/marvin-kastner-msc.html\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/5236165?v=4?s=100\" width=\"100px;\" alt=\"1kastner\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003e1kastner\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/s-weigand/flake8-nb/issues?q=author%3A1kastner\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/dominiquesydow\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/7207093?v=4?s=100\" width=\"100px;\" alt=\"Dominique Sydow\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDominique Sydow\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/s-weigand/flake8-nb/issues?q=author%3Adominiquesydow\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://www.keegan.ch\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/12845624?v=4?s=100\" width=\"100px;\" alt=\"Liam Keegan\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eLiam Keegan\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/s-weigand/flake8-nb/issues?q=author%3Alkeegan\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/s-weigand/flake8-nb/commits?author=lkeegan\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs-weigand%2Fflake8-nb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs-weigand%2Fflake8-nb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs-weigand%2Fflake8-nb/lists"}