Skip to main content

pyproject-fmt-py

PyPI CI

ghcr size

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

MIT License

Metadata

Release files for pyproject-fmt-py 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyproject-fmt-py 0.0.1
File Size Uploaded
pyproject_fmt_py-0.0.1.tar.gz 80.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyproject-fmt-py 0.0.1
File Interpreter ABI Platform
pyproject_fmt_py-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 180.2 kB

Release files / pyproject_fmt_py-0.0.1.tar.gz

Download URL pyproject_fmt_py-0.0.1.tar.gz
Size 80.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dc3659e1d0f3752c318ebc8da52331dffda9933658dc55e0c4aaf8ea3a10550a
BLAKE2b-256 checksum
How to use checksums
e5371514f6f8ad8f4363756bd2fc5bcf90589630a98b82a3fb0a26d30338dd43
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.1-py3-none-any.whl

Download URL pyproject_fmt_py-0.0.1-py3-none-any.whl
Size 100.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8aad7816190d065cb93390348dd8dccd4013810d28adf148cf14cefc605ac838
BLAKE2b-256 checksum
How to use checksums
a14527fba21360dc25550b64974a71d577db2c928cab5bd8475261ab0e907fd8
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 history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page