[{"data":1,"prerenderedAt":178},["ShallowReactive",2],{"repo-psf-black-zh-CN":3,"i18n-psf-black-zh-CN":175},{"mirrorPool":4,"detail":13,"relatedProjects":174},[5,9],{"key":6,"label":7,"base":8,"type":6},"github","mirror.github","https:\u002F\u002Fgithub.com\u002F",{"key":10,"label":11,"base":12,"type":10},"auto-proxy","mirror.autoProxy","https:\u002F\u002Fgithub.xxlab.tech\u002F",{"owner":14,"repo":15,"repoId":16,"repoUrl":17,"starCount":18,"language":19,"description":20,"languages":21,"screenshots":26,"homepage":27,"pushedAt":28,"ownerAvatar":29,"ownerName":30,"ownerBio":31,"lastSyncTime":32,"lastReleaseTime":33,"tags":34,"license":44,"category":45,"subgroup":46,"releases":47},"psf","black",125266328,"https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack",41954,"Python","The uncompromising Python code formatter",{"Python":22,"Vim Script":23,"Jupyter Notebook":24,"Dockerfile":25},99.7,0.2,0.1,0,[],"https:\u002F\u002Fblack.readthedocs.io\u002Fen\u002Fstable\u002F","2026-10-19","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F50630501?v=4","Python Software Foundation","Official repositories for the Python Software Foundation, the nonprofit steward of Python—supporting the language, community, infrastructure, grants, and PyCon ","2026-10-20T10:24:45.289243+00:00","2026-10-10T04:11:33Z",[35,36,37,38,39,40,41,42,43],"autopep8","code","codeformatter","formatter","gofmt","hacktoberfest","pre-commit-hook","python","yapf","MIT","development","",[48,68,83,99,113,129,143,158],{"tag":49,"publishAt":33,"semVer":50,"prerelease":54,"assets":55},"26.10.1",[51,52,53],26,10,1,false,[56,62],{"fileName":57,"sizeMb":58,"sha256":59,"downloadCount":60,"originUrl":61},"black_windows-arm.exe",13.1,"8b2233f85d92cef5f916c44b6b9b51530dd3502c6a396ecf8ddda807544b3d0c",16,"https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack\u002Freleases\u002Fdownload\u002F26.10.1\u002Fblack_windows-arm.exe",{"fileName":63,"sizeMb":64,"sha256":65,"downloadCount":66,"originUrl":67},"black_windows.exe",13.36,"9901f869bcfe0df3304ee7a42913dc3a8f6d85ad4feff6f6c30c26bfd7063dd4",65,"https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack\u002Freleases\u002Fdownload\u002F26.10.1\u002Fblack_windows.exe",{"tag":69,"publishAt":70,"semVer":71,"prerelease":54,"assets":72},"26.10.0","2026-10-04T16:50:23Z",[51,52,25],[73,78],{"fileName":57,"sizeMb":74,"sha256":75,"downloadCount":76,"originUrl":77},13.12,"2bc1eb682574e603ed67690bfa088855ceb457714e6257838341814b01e70721",88,"https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack\u002Freleases\u002Fdownload\u002F26.10.0\u002Fblack_windows-arm.exe",{"fileName":63,"sizeMb":79,"sha256":80,"downloadCount":81,"originUrl":82},13.4,"e0f372391d2bec44689e69b3d699fecf85d9ac5f0da1b7c31317ed68fef82925",98,"https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack\u002Freleases\u002Fdownload\u002F26.10.0\u002Fblack_windows.exe",{"tag":84,"publishAt":85,"semVer":86,"prerelease":54,"assets":88},"26.5.1","2026-05-18T16:52:38Z",[51,87,53],5,[89,94],{"fileName":57,"sizeMb":90,"sha256":91,"downloadCount":92,"originUrl":93},11.46,"c832511835f05327c90d3e764b754da3518a9ecca58b06d4aee00a307a6e7db0",70,"https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack\u002Freleases\u002Fdownload\u002F26.5.1\u002Fblack_windows-arm.exe",{"fileName":63,"sizeMb":95,"sha256":96,"downloadCount":97,"originUrl":98},11.7,"d3d971d1e86ddde7f9c114e4b8170cf1d5df841c021014c288a08caf699e1dd8",1126,"https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack\u002Freleases\u002Fdownload\u002F26.5.1\u002Fblack_windows.exe",{"tag":100,"publishAt":101,"semVer":102,"prerelease":54,"assets":103},"26.5.0","2026-05-16T17:56:23Z",[51,87,25],[104,108],{"fileName":57,"sizeMb":90,"sha256":105,"downloadCount":106,"originUrl":107},"d391553c021283b17ff01d854047341d663408a7564d5665064c01daafbf9531",18,"https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack\u002Freleases\u002Fdownload\u002F26.5.0\u002Fblack_windows-arm.exe",{"fileName":63,"sizeMb":109,"sha256":110,"downloadCount":111,"originUrl":112},11.69,"c91395baa0daadedc964cd475a05e59c046f3fd18e55ccabf84afb302d31edd6",22,"https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack\u002Freleases\u002Fdownload\u002F26.5.0\u002Fblack_windows.exe",{"tag":114,"publishAt":115,"semVer":116,"prerelease":54,"assets":118},"26.3.1","2026-03-12T03:35:15Z",[51,117,53],3,[119,124],{"fileName":57,"sizeMb":120,"sha256":121,"downloadCount":122,"originUrl":123},11.41,"b40972f71496bb0ad55308779b52a84e167c3493f892a8741d338e84e92b1fff",29,"https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack\u002Freleases\u002Fdownload\u002F26.3.1\u002Fblack_windows-arm.exe",{"fileName":63,"sizeMb":125,"sha256":126,"downloadCount":127,"originUrl":128},11.64,"d76aff80a9349c3185d94f42b44cc667be3d3b616b346dcecd57f75453518e67",130,"https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack\u002Freleases\u002Fdownload\u002F26.3.1\u002Fblack_windows.exe",{"tag":130,"publishAt":131,"semVer":132,"prerelease":54,"assets":133},"26.3.0","2026-03-06T17:41:48Z",[51,117,25],[134,139],{"fileName":57,"sizeMb":135,"sha256":136,"downloadCount":137,"originUrl":138},11.4,"3c8e05c79db9dc6f86d80b06975e9b5094c4a455c276a7f0c2fa9f7706383ea0",15,"https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack\u002Freleases\u002Fdownload\u002F26.3.0\u002Fblack_windows-arm.exe",{"fileName":63,"sizeMb":140,"sha256":141,"downloadCount":106,"originUrl":142},11.63,"f6c883b3af94d0ad98f95585b56b8f84f1009bf869c8d46737bdd5514a11888c","https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack\u002Freleases\u002Fdownload\u002F26.3.0\u002Fblack_windows.exe",{"tag":144,"publishAt":145,"semVer":146,"prerelease":54,"assets":147},"26.1.0","2026-01-18T04:49:25Z",[51,53,25],[148,153],{"fileName":57,"sizeMb":149,"sha256":150,"downloadCount":151,"originUrl":152},11.51,"f236ddb08cac12dbbc6a82e9f20ed47d8817e3b357b8184bbb8ac82310d93ce7",20,"https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack\u002Freleases\u002Fdownload\u002F26.1.0\u002Fblack_windows-arm.exe",{"fileName":63,"sizeMb":154,"sha256":155,"downloadCount":156,"originUrl":157},11.65,"50d28ab3f46d408f60f26158e5528f3956f4b4e028efe5345df20378943464df",152,"https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack\u002Freleases\u002Fdownload\u002F26.1.0\u002Fblack_windows.exe",{"tag":159,"publishAt":160,"semVer":161,"prerelease":162,"assets":163},"26.1a1","2025-12-08T01:46:21Z",[25,25,25],true,[164,169],{"fileName":57,"sizeMb":165,"sha256":166,"downloadCount":167,"originUrl":168},11.47,"a1c9b65049e24339db6804f2f4522a7ab75363ec6c29e79ed6c827374c42f6e1",11,"https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack\u002Freleases\u002Fdownload\u002F26.1a1\u002Fblack_windows-arm.exe",{"fileName":63,"sizeMb":170,"sha256":171,"downloadCount":172,"originUrl":173},11.62,"d050013219d196ea61866161b7e8142d41dd3abc8a1fc8d427050a2e50e2c160",14,"https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack\u002Freleases\u002Fdownload\u002F26.1a1\u002Fblack_windows.exe",[],{"description":176,"readmeHtml":177},"Black 是毫不妥协的 Python 代码格式化器，用固定风格自动重排代码，消除格式争论，让代码评审聚焦内容本身。","\u003Ch2 id=\"项目概述\">项目概述\u003C\u002Fh2>\u003Cp>Black 是 Python 社区最流行的代码格式化器之一，以「毫不妥协」著称：风格选项刻意保持极少，格式化结果确定且全项目统一。它让你放弃对格式细节的控制，换回速度、确定性和免受风格告警打扰的开发体验。经 Black 格式化的代码在所有项目里观感一致，并生成最小化 diff 以加快代码评审。\u003C\u002Fp>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>项目\u003C\u002Fth>\n\u003Cth>内容\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>语言\u003C\u002Ftd>\n\u003Ctd>Python\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>运行要求\u003C\u002Ftd>\n\u003Ctd>Python 3.10+\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>风格基准\u003C\u002Ftd>\n\u003Ctd>PEP 8\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>许可\u003C\u002Ftd>\n\u003Ctd>MIT\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\u003C\u002Ftable>\n\u003Cblockquote>\n\u003Cp>格式交给 Black，精力还给代码本身。\u003C\u002Fp>\n\u003C\u002Fblockquote>\n\u003Ch2 id=\"主要功能\">主要功能\u003C\u002Fh2>\u003Cul>\n\u003Cli>\u003Cstrong>自动格式化\u003C\u002Fstrong>：直接重排整个文件，风格统一无需讨论\u003C\u002Fli>\n\u003Cli>\u003Cstrong>PEP 8 兼容\u003C\u002Fstrong>：在 PEP 8 基础上给出确定的风格决策\u003C\u002Fli>\n\u003Cli>\u003Cstrong>最小 diff\u003C\u002Fstrong>：格式化后产生尽可能小的差异，评审更聚焦\u003C\u002Fli>\n\u003Cli>\u003Cstrong>安全校验\u003C\u002Fstrong>：默认校验格式化前后 AST 等价，避免改变语义\u003C\u002Fli>\n\u003Cli>\u003Cstrong>pyproject 配置\u003C\u002Fstrong>：支持通过 pyproject.toml 指定 include 与 exclude 等选项\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Notebook 支持\u003C\u002Fstrong>：安装 black[jupyter] 可格式化 Jupyter Notebook\u003C\u002Fli>\n\u003Cli>\u003Cstrong>预提交钩子\u003C\u002Fstrong>：常与 pre-commit 配合实现提交前自动格式化\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"适用人群\">适用人群\u003C\u002Fh2>\u003Cul>\n\u003Cli>Python 开发者\u003C\u002Fli>\n\u003Cli>开源项目维护者\u003C\u002Fli>\n\u003Cli>希望终结风格争论的团队\u003C\u002Fli>\n\u003Cli>重视评审效率的技术负责人\u003C\u002Fli>\n\u003Cli>CI 流水线维护者\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"快速上手\">快速上手\u003C\u002Fh2>\u003Col>\n\u003Cli>安装 Black\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cdiv class=\"code-block\">\u003Cpre>\u003Ccode class=\"hljs language-bash\">pip install black\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003Col start=\"2\">\n\u003Cli>格式化文件或目录\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cdiv class=\"code-block\">\u003Cpre>\u003Ccode class=\"hljs language-bash\">black {source_file_or_directory}\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003Col start=\"3\">\n\u003Cli>\u003Cp>无 Python 环境的机器可从 GitHub Releases 下载独立可执行文件使用\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>可选：在 pyproject.toml 中配置 include 与 exclude 模式\u003C\u002Fp>\n\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Ch2 id=\"核心优势\">核心优势\u003C\u002Fh2>\u003Cul>\n\u003Cli>\u003Cstrong>风格零争论\u003C\u002Fstrong>：选项极少，团队无需在风格上消耗时间\u003C\u002Fli>\n\u003Cli>\u003Cstrong>结果确定\u003C\u002Fstrong>：同样的输入永远得到同样的输出\u003C\u002Fli>\n\u003Cli>\u003Cstrong>语义安全\u003C\u002Fstrong>：默认校验 AST 等价，格式化不改行为\u003C\u002Fli>\n\u003Cli>\u003Cstrong>广泛验证\u003C\u002Fstrong>：Django、SQLAlchemy、pandas 等大量项目长期使用\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"系统要求\">系统要求\u003C\u002Fh2>\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>项目\u003C\u002Fth>\n\u003Cth>要求\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>操作系统\u003C\u002Ftd>\n\u003Ctd>Linux、macOS、Windows\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>语言环境\u003C\u002Ftd>\n\u003Ctd>Python 3.10 及以上\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Notebooks\u003C\u002Ftd>\n\u003Ctd>需安装 black[jupyter] 附加依赖\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\u003C\u002Ftable>\n\u003Ch2 id=\"注意事项\">注意事项\u003C\u002Fh2>\u003Cul>\n\u003Cli>\u003Cstrong>风格稳定\u003C\u002Fstrong>：项目已进入稳定期，不再出现大规模风格变更\u003C\u002Fli>\n\u003Cli>\u003Cstrong>例外规则\u003C\u002Fstrong>：部分场景存在 pragmatism 例外，提交 issue 前先查阅文档\u003C\u002Fli>\n\u003Cli>\u003Cstrong>速度取舍\u003C\u002Fstrong>：AST 安全校验会略降速度，确有需要可用 \u003Ccode>--fast\u003C\u002Fcode>\u003C\u002Fli>\n\u003C\u002Ful>\n",1793197927264]