{"id":13861643,"url":"https://github.com/wbolster/emacs-python-black","last_synced_at":"2025-09-05T16:45:26.547Z","repository":{"id":55492444,"uuid":"184804356","full_name":"wbolster/emacs-python-black","owner":"wbolster","description":"Emacs package to reformat Python using black-macchiato","archived":false,"fork":false,"pushed_at":"2024-05-20T07:29:38.000Z","size":23,"stargazers_count":100,"open_issues_count":5,"forks_count":11,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-12-27T09:13:14.740Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wbolster.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-05-03T18:43:34.000Z","updated_at":"2024-12-04T17:21:53.000Z","dependencies_parsed_at":"2024-04-13T15:17:45.223Z","dependency_job_id":"d7839671-1118-4d8b-82bb-77860afb27d7","html_url":"https://github.com/wbolster/emacs-python-black","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbolster%2Femacs-python-black","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbolster%2Femacs-python-black/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbolster%2Femacs-python-black/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbolster%2Femacs-python-black/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wbolster","download_url":"https://codeload.github.com/wbolster/emacs-python-black/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239433909,"owners_count":19637806,"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":[],"created_at":"2024-08-05T06:01:26.959Z","updated_at":"2025-02-18T08:20:56.403Z","avatar_url":"https://github.com/wbolster.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp"],"sub_categories":[],"readme":"python-black.el\n===============\n\nThis is an Emacs package to make it easy to [reformat](https://github.com/purcell/reformatter.el) Python code using [black](https://github.com/python/black), the uncompromising Python code formatter.\n\nAs an optional extra, this package can also reformat partial buffers using [black-macchiato](https://github.com/wbolster/black-macchiato), which is a small wrapper around `black` which does just that.\n\nInstallation\n------------\n\nInstall the [python-black Melpa package](https://melpa.org/#/python-black) using `M-x package-install`, or via [use-package](https://github.com/jwiegley/use-package):\n\n``` elisp\n(use-package python-black\n  :demand t\n  :after python\n  :hook (python-mode . python-black-on-save-mode-enable-dwim))\n```\n\nUsage\n-----\n\nUse one of these commands via `M-x` or bind them to a key:\n\n- `python-black-on-save-mode`\n\n  Minor mode to automatically reformat the buffer on save.\n\n- `python-black-on-save-mode-enable-dwim`\n\n  Enable `python-black-on-save-mode` if this project is using Black. (Useful in hooks; see example above.)\n\n- `python-black-buffer`\n\n  Reformat the current buffer.\n\n- `python-black-region`\n\n  Reformat the current region. (Requires `black-macchiato`.)\n\n- `python-black-statement`\n\n  Reformat the current statement. (Requires `black-macchiato`.)\n\n- `python-black-partial-dwim`\n\n  Reformat the active region or the current statement, depending on whether the region is currently active. (Requires `black-macchiato`.)\n\n- `python-black-org-mode-block`\n\n  Reformat the current `org-mode` Python example or source code block. (Requires `black-macchiato`.)\n\nConfiguration\n-------------\n\nThis package deliberately has minimal configuration. Use `M-x customize-group RET python-black` or change these variables in your `init.el`:\n\n- `python-black-command`\n- `python-black-macchiato-command`\n- `python-black-extra-args`\n\nTo configure `black` itself, use an [external configuration file](https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file) for your project, which has the benefits that it can be per-project, and works outside Emacs as well.\n\nHistory\n-------\n\n- next release (already available via melpa unstable)\n\n  - …\n\n- 1.2.0 (2022-11-03)\n\n  - new `python-black-org-mode-block` function to format an `org-mode` block (#12)\n\n  - `python-black-on-save-mode-enable-dwim` now ignores files in\n    `site-packages/` directories\n\n- 1.1.0 (2021-05-11)\n\n  - Add `python-black-on-save-mode-enable-dwim` for use in hooks\n  - Don't break when there's no newline at the end of the buffer (#4)\n\n- 1.0.0 (2019-08-17)\n\n  - Initial release\n\nLicense\n-------\n\nBSD-3-clause. Copyright © 2019 wouter bolsterlee.\n\nCredits\n-------\n\nwouter bolsterlee. wbolster.\n\nhttps://github.com/wbolster on github. star my repos. fork them. and so on.\n\nhttps://twitter.com/wbolster on twitter. follow me. or say hi.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwbolster%2Femacs-python-black","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwbolster%2Femacs-python-black","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwbolster%2Femacs-python-black/lists"}