{"id":25971543,"url":"https://github.com/python/black","last_synced_at":"2025-03-05T00:01:50.990Z","repository":{"id":37484964,"uuid":"125266328","full_name":"psf/black","owner":"psf","description":"The uncompromising Python code formatter","archived":false,"fork":false,"pushed_at":"2025-03-03T14:24:04.000Z","size":7214,"stargazers_count":39863,"open_issues_count":362,"forks_count":2549,"subscribers_count":231,"default_branch":"main","last_synced_at":"2025-03-03T14:48:40.429Z","etag":null,"topics":["autopep8","code","codeformatter","formatter","gofmt","hacktoberfest","pre-commit-hook","python","yapf"],"latest_commit_sha":null,"homepage":"https://black.readthedocs.io/en/stable/","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/psf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-14T19:54:45.000Z","updated_at":"2025-03-03T14:24:10.000Z","dependencies_parsed_at":"2022-07-14T10:31:18.352Z","dependency_job_id":"6dc842a0-b173-4161-9953-642bdd608ef7","html_url":"https://github.com/psf/black","commit_stats":{"total_commits":1922,"total_committers":466,"mean_commits":4.124463519313305,"dds":0.8064516129032258,"last_synced_commit":"c472557ba84bf0bd8a31c15542479fe19c989901"},"previous_names":["ambv/black","python/black"],"tags_count":64,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psf%2Fblack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psf%2Fblack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psf%2Fblack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psf%2Fblack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psf","download_url":"https://codeload.github.com/psf/black/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241686829,"owners_count":20003112,"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":["autopep8","code","codeformatter","formatter","gofmt","hacktoberfest","pre-commit-hook","python","yapf"],"created_at":"2025-03-05T00:01:31.180Z","updated_at":"2025-03-05T00:01:50.970Z","avatar_url":"https://github.com/psf.png","language":"Python","readme":"[![Black Logo](https://raw.githubusercontent.com/psf/black/main/docs/_static/logo2-readme.png)](https://black.readthedocs.io/en/stable/)\n\n\u003ch2 align=\"center\"\u003eThe Uncompromising Code Formatter\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/psf/black/actions\"\u003e\u003cimg alt=\"Actions Status\" src=\"https://github.com/psf/black/workflows/Test/badge.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://black.readthedocs.io/en/stable/?badge=stable\"\u003e\u003cimg alt=\"Documentation Status\" src=\"https://readthedocs.org/projects/black/badge/?version=stable\"\u003e\u003c/a\u003e\n\u003ca href=\"https://coveralls.io/github/psf/black?branch=main\"\u003e\u003cimg alt=\"Coverage Status\" src=\"https://coveralls.io/repos/github/psf/black/badge.svg?branch=main\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/psf/black/blob/main/LICENSE\"\u003e\u003cimg alt=\"License: MIT\" src=\"https://black.readthedocs.io/en/stable/_static/license.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://pypi.org/project/black/\"\u003e\u003cimg alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/black\"\u003e\u003c/a\u003e\n\u003ca href=\"https://pepy.tech/project/black\"\u003e\u003cimg alt=\"Downloads\" src=\"https://static.pepy.tech/badge/black\"\u003e\u003c/a\u003e\n\u003ca href=\"https://anaconda.org/conda-forge/black/\"\u003e\u003cimg alt=\"conda-forge\" src=\"https://img.shields.io/conda/dn/conda-forge/black.svg?label=conda-forge\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/psf/black\"\u003e\u003cimg alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003e “Any color you like.”\n\n_Black_ is the uncompromising Python code formatter. By using it, you agree to cede\ncontrol over minutiae of hand-formatting. In return, _Black_ gives you speed,\ndeterminism, and freedom from `pycodestyle` nagging about formatting. You will save time\nand mental energy for more important matters.\n\nBlackened code looks the same regardless of the project you're reading. Formatting\nbecomes transparent after a while and you can focus on the content instead.\n\n_Black_ makes code review faster by producing the smallest diffs possible.\n\nTry it out now using the [Black Playground](https://black.vercel.app). Watch the\n[PyCon 2019 talk](https://youtu.be/esZLCuWs_2Y) to learn more.\n\n---\n\n**[Read the documentation on ReadTheDocs!](https://black.readthedocs.io/en/stable)**\n\n---\n\n## Installation and usage\n\n### Installation\n\n_Black_ can be installed by running `pip install black`. It requires Python 3.9+ to run.\nIf you want to format Jupyter Notebooks, install with `pip install \"black[jupyter]\"`.\n\nIf you can't wait for the latest _hotness_ and want to install from GitHub, use:\n\n`pip install git+https://github.com/psf/black`\n\n### Usage\n\nTo get started right away with sensible defaults:\n\n```sh\nblack {source_file_or_directory}\n```\n\nYou can run _Black_ as a package if running it as a script doesn't work:\n\n```sh\npython -m black {source_file_or_directory}\n```\n\nFurther information can be found in our docs:\n\n- [Usage and Configuration](https://black.readthedocs.io/en/stable/usage_and_configuration/index.html)\n\n_Black_ is already [successfully used](https://github.com/psf/black#used-by) by many\nprojects, small and big. _Black_ has a comprehensive test suite, with efficient parallel\ntests, and our own auto formatting and parallel Continuous Integration runner. Now that\nwe have become stable, you should not expect large formatting changes in the future.\nStylistic changes will mostly be responses to bug reports and support for new Python\nsyntax. For more information please refer to\n[The Black Code Style](https://black.readthedocs.io/en/stable/the_black_code_style/index.html).\n\nAlso, as a safety measure which slows down processing, _Black_ will check that the\nreformatted code still produces a valid AST that is effectively equivalent to the\noriginal (see the\n[Pragmatism](https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#ast-before-and-after-formatting)\nsection for details). If you're feeling confident, use `--fast`.\n\n## The _Black_ code style\n\n_Black_ is a PEP 8 compliant opinionated formatter. _Black_ reformats entire files in\nplace. Style configuration options are deliberately limited and rarely added. It doesn't\ntake previous formatting into account (see\n[Pragmatism](https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#pragmatism)\nfor exceptions).\n\nOur documentation covers the current _Black_ code style, but planned changes to it are\nalso documented. They're both worth taking a look at:\n\n- [The _Black_ Code Style: Current style](https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html)\n- [The _Black_ Code Style: Future style](https://black.readthedocs.io/en/stable/the_black_code_style/future_style.html)\n\nChanges to the _Black_ code style are bound by the Stability Policy:\n\n- [The _Black_ Code Style: Stability Policy](https://black.readthedocs.io/en/stable/the_black_code_style/index.html#stability-policy)\n\nPlease refer to this document before submitting an issue. What seems like a bug might be\nintended behaviour.\n\n### Pragmatism\n\nEarly versions of _Black_ used to be absolutist in some respects. They took after its\ninitial author. This was fine at the time as it made the implementation simpler and\nthere were not many users anyway. Not many edge cases were reported. As a mature tool,\n_Black_ does make some exceptions to rules it otherwise holds.\n\n- [The _Black_ code style: Pragmatism](https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#pragmatism)\n\nPlease refer to this document before submitting an issue just like with the document\nabove. What seems like a bug might be intended behaviour.\n\n## Configuration\n\n_Black_ is able to read project-specific default values for its command line options\nfrom a `pyproject.toml` file. This is especially useful for specifying custom\n`--include` and `--exclude`/`--force-exclude`/`--extend-exclude` patterns for your\nproject.\n\nYou can find more details in our documentation:\n\n- [The basics: Configuration via a file](https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file)\n\nAnd if you're looking for more general configuration documentation:\n\n- [Usage and Configuration](https://black.readthedocs.io/en/stable/usage_and_configuration/index.html)\n\n**Pro-tip**: If you're asking yourself \"Do I need to configure anything?\" the answer is\n\"No\". _Black_ is all about sensible defaults. Applying those defaults will have your\ncode in compliance with many other _Black_ formatted projects.\n\n## Used by\n\nThe following notable open-source projects trust _Black_ with enforcing a consistent\ncode style: pytest, tox, Pyramid, Django, Django Channels, Hypothesis, attrs,\nSQLAlchemy, Poetry, PyPA applications (Warehouse, Bandersnatch, Pipenv, virtualenv),\npandas, Pillow, Twisted, LocalStack, every Datadog Agent Integration, Home Assistant,\nZulip, Kedro, OpenOA, FLORIS, ORBIT, WOMBAT, and many more.\n\nThe following organizations use _Black_: Dropbox, KeepTruckin, Lyft, Mozilla,\nQuora, Duolingo, QuantumBlack, Tesla, Archer Aviation.\n\nAre we missing anyone? Let us know.\n\n## Testimonials\n\n**Mike Bayer**, [author of `SQLAlchemy`](https://www.sqlalchemy.org/):\n\n\u003e I can't think of any single tool in my entire programming career that has given me a\n\u003e bigger productivity increase by its introduction. I can now do refactorings in about\n\u003e 1% of the keystrokes that it would have taken me previously when we had no way for\n\u003e code to format itself.\n\n**Dusty Phillips**,\n[writer](https://smile.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps\u0026field-keywords=dusty+phillips):\n\n\u003e _Black_ is opinionated so you don't have to be.\n\n**Hynek Schlawack**, [creator of `attrs`](https://www.attrs.org/), core developer of\nTwisted and CPython:\n\n\u003e An auto-formatter that doesn't suck is all I want for Xmas!\n\n**Carl Meyer**, [Django](https://www.djangoproject.com/) core developer:\n\n\u003e At least the name is good.\n\n**Kenneth Reitz**, creator of [`requests`](https://requests.readthedocs.io/en/latest/)\nand [`pipenv`](https://readthedocs.org/projects/pipenv/):\n\n\u003e This vastly improves the formatting of our code. Thanks a ton!\n\n## Show your style\n\nUse the badge in your project's README.md:\n\n```md\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n```\n\nUsing the badge in README.rst:\n\n```\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n```\n\nLooks like this:\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n## License\n\nMIT\n\n## Contributing\n\nWelcome! Happy to see you willing to make the project better. You can get started by\nreading this:\n\n- [Contributing: The basics](https://black.readthedocs.io/en/latest/contributing/the_basics.html)\n\nYou can also take a look at the rest of the contributing docs or talk with the\ndevelopers:\n\n- [Contributing documentation](https://black.readthedocs.io/en/latest/contributing/index.html)\n- [Chat on Discord](https://discord.gg/RtVdv86PrH)\n\n## Change log\n\nThe log has become rather long. It moved to its own file.\n\nSee [CHANGES](https://black.readthedocs.io/en/latest/change_log.html).\n\n## Authors\n\nThe author list is quite long nowadays, so it lives in its own file.\n\nSee [AUTHORS.md](./AUTHORS.md)\n\n## Code of Conduct\n\nEveryone participating in the _Black_ project, and in particular in the issue tracker,\npull requests, and social media activity, is expected to treat other people with respect\nand more generally to follow the guidelines articulated in the\n[Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/).\n\nAt the same time, humor is encouraged. In fact, basic familiarity with Monty Python's\nFlying Circus is expected. We are not savages.\n\nAnd if you _really_ need to slap somebody, do it with a fish while dancing.\n","funding_links":[],"categories":["Code Analysis","All-in formatters","Code Analysis [🔝](#readme)","Formatters"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython%2Fblack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython%2Fblack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython%2Fblack/lists"}