{"id":20752796,"url":"https://github.com/kpj/jupyfmt","last_synced_at":"2025-07-26T20:33:47.683Z","repository":{"id":44586837,"uuid":"332296606","full_name":"kpj/jupyfmt","owner":"kpj","description":"The uncompromising Jupyter notebook formatter.","archived":false,"fork":false,"pushed_at":"2024-01-26T21:45:59.000Z","size":43,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-01T22:17:43.246Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kpj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-23T19:58:27.000Z","updated_at":"2023-11-14T12:55:48.000Z","dependencies_parsed_at":"2024-01-26T22:44:20.016Z","dependency_job_id":null,"html_url":"https://github.com/kpj/jupyfmt","commit_stats":{"total_commits":69,"total_committers":2,"mean_commits":34.5,"dds":0.04347826086956519,"last_synced_commit":"a0505d71099e1a91c5a44d05a7668a964b20b71f"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/kpj/jupyfmt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpj%2Fjupyfmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpj%2Fjupyfmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpj%2Fjupyfmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpj%2Fjupyfmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kpj","download_url":"https://codeload.github.com/kpj/jupyfmt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpj%2Fjupyfmt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267228194,"owners_count":24056368,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-17T08:42:43.379Z","updated_at":"2025-07-26T20:33:47.630Z","avatar_url":"https://github.com/kpj.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jupyfmt\n\n[![PyPI](https://img.shields.io/pypi/v/jupyfmt.svg?style=flat)](https://pypi.python.org/pypi/jupyfmt)\n[![Tests](https://github.com/kpj/jupyfmt/workflows/Tests/badge.svg)](https://github.com/kpj/jupyfmt/actions)\n\nThe uncompromising Jupyter notebook formatter.\n\n`jupyfmt` allows you to format notebooks in-place from the commandline as well as assert properly formatted Jupyter notebook cells in your CI.\nInspired by [snakefmt](https://github.com/snakemake/snakefmt/).\n\nThe following formatters are included for each language:\n* Python: [black](https://github.com/psf/black/)\n* R: [styler](https://github.com/r-lib/styler)\n\n\n## Installation\n\nInstall the latest release from PyPI:\n\n```python\n$ pip install jupyfmt\n```\n\n\n## Usage\n\n`jupyfmt` can be used to format notebooks in-place or report diffs and summary statistics.\n\nOverview of commandline parameters:\n```\n$ jupyfmt --help\nUsage: jupyfmt [OPTIONS] [PATH_LIST]...\n\n  The uncompromising Jupyter notebook formatter.\n\n  PATH_LIST specifies notebooks and directories to search for notebooks in. By\n  default, all notebooks will be formatted in-place. Use `--check`, `--diff`\n  (or `--compact-diff`) to print summary reports instead.\n\nOptions:\n  -l, --line-length INT           How many characters per line to allow.\n  -S, --skip-string-normalization\n                                  Don't normalize string quotes or prefixes.\n  --check                         Don't write files back, just return status\n                                  and print summary.\n  -d, --diff                      Don't write files back, just output a diff\n                                  for each file to stdout.\n  --compact-diff                  Same as --diff but only show lines that\n                                  would change plus a few lines of context.\n  --assert-consistent-execution   Assert that all cells have been executed in\n                                  correct order.\n  --exclude PATTERN               Regular expression to match paths which\n                                  should be exluded when searching\n                                  directories.  [default: (/.git/|/.ipynb_chec\n                                  kpoints/|/build/|/dist/)]\n  --accepted-languages PATTERN    Only format Jupyter notebooks in these\n                                  languages.  [default: python]\n  --exclude-nonkernel-languages   Only format code cells in language of\n                                  notebook kernel.\n  --version                       Show the version and exit.\n  --help                          Show this message and exit.\n```\n\nReport formatting suggestions for a given notebook (this is particularly useful for CI workflows):\n```bash\n$ jupyfmt --check --compact-diff Notebook.ipynb\n--- Notebook.ipynb - Cell 1 (original)\n+++ Notebook.ipynb - Cell 1 (formatted)\n@@ -1,2 +1,2 @@\n-def foo (*args):\n+def foo(*args):\n     return sum(args)\n\n--- Notebook.ipynb - Cell 2 (original)\n+++ Notebook.ipynb - Cell 2 (formatted)\n@@ -1 +1 @@\n-foo(1, 2,3)\n+foo(1, 2, 3)\n\n2 cell(s) would be changed 😬\n1 cell(s) would be left unchanged 🎉\n\n1 file(s) would be changed 😬\n```\n\n## Mega-Linter Integration\n\n`jupyfmt` can be run as part of [Mega-Linter](https://github.com/nvuillam/mega-linter) by adding the following to `.mega-linter.yml`:\n\n```yaml\nPLUGINS:\n  - https://raw.githubusercontent.com/kpj/jupyfmt/master/mega-linter-plugin-jupyfmt/jupyfmt.megalinter-descriptor.yml\n\nENABLE_LINTERS:\n  - JUPYTER_JUPYFMT\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkpj%2Fjupyfmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkpj%2Fjupyfmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkpj%2Fjupyfmt/lists"}