pyproject-fmt-py
A pyproject.toml formatter written in pure Python, reimplementation of pyproject-fmt.
Installation
# mise via github release
mise use -g github:eggplants/pyproject-fmt-py
# mise via pipx
mise use -g pipx:pyproject-fmt-py
# pipx
pipx install pyproject-fmt-py
# pip
pip install pyproject-fmt-py
Docker
docker pull ghcr.io/eggplants/pyproject-fmt-py
docker run --rm -v "$PWD:/w" -w /w ghcr.io/eggplants/pyproject-fmt-py pyproject.toml
CLI
$ pyproject-fmt pyproject.toml
--- pyproject.toml
+++ pyproject.toml
@@ -1,3 +1,3 @@
[project]
-name="My_Package"
-dependencies=["b","a >= 1.0.0"]
+name = "my-package"
+dependencies = [ "a>=1", "b" ]
$ pyproject-fmt --check pyproject.toml # fail without writing
$ pyproject-fmt --stdout pyproject.toml # write the result to stdout
$ cat pyproject.toml | pyproject-fmt - # read from stdin
Settings
[tool.pyproject-fmt]
column_width = 120
indent = 2
# "long" writes each sub-table under a header of its own
table_format = "short"
# true keeps a redundant `.0` in a dependency version
keep_full_version = false
max_supported_python = "3.15"
Library
from pyproject_fmt_py import Settings, format_toml
print(format_toml('[project]\nname="My_Package"\n', Settings()))
format_toml raises FormatError when the source is not a document, or
says something the rules reject, such as a project.version does not read.
License
Metadata
Release files for pyproject-fmt-py 0.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyproject_fmt_py-0.0.0.tar.gz | 80.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyproject_fmt_py-0.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 180.1 kB
Release files / pyproject_fmt_py-0.0.0.tar.gz
| Download URL | pyproject_fmt_py-0.0.0.tar.gz |
|---|---|
| Size | 80.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e60dc5caf2c300539a384258fa43fb1149814e27bf5941704e420e2efbdc583d
|
|
BLAKE2b-256 checksum How to use checksums |
74ed1358608e0a67eb2050238f57a75daf0c4abbf33bf3ffaf619b22bf023c83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pyproject_fmt_py-0.0.0-py3-none-any.whl
| Download URL | pyproject_fmt_py-0.0.0-py3-none-any.whl |
|---|---|
| Size | 100.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f60904a26c39a076f0f807c6b412ac6271ab2155e43f1bdc0d75a558bb85ea7c
|
|
BLAKE2b-256 checksum How to use checksums |
02d10183d6be018b92f1284cb849ba9802240e237596be89acc7090a8a0a1235
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|