Plugin-based XML formatter with a strong house style.
Project description
xmlegant
Plugin-based XML formatter with a strong house style.
Think black but for XML, but with a small plugin surface for domain-specific element layout.
Install
xmlegant runs on Linux, macOS, and Windows with Python 3.10 or newer.
The PyPI distribution is published as xmlegant-format (the short name was
already taken on PyPI), but the installed CLI command and the import name
are both xmlegant. Pick whichever installer you already use:
pipx install xmlegant-format # isolated, recommended for end users
uv tool install xmlegant-format # if you use uv
pip install xmlegant-format # plain pip into the active environment
After install, the xmlegant command is available on PATH:
xmlegant --help
Commands
xmlegant format [-c CONFIG_DIR] [-o OUTPUT_FILE] FILE [FILE ...]
xmlegant check [-c CONFIG_DIR] FILE [FILE ...]
formatrewrites each input file in place. With-o, writes to one output (errors out with two or more inputs).checkprints a unified diff to stdout for files that would change. Exits 0 when all files are already formatted, 1 when any file would change, 2 on error.
If the config directory (default ./.xmlegant) doesn't exist, the tool runs
in canonicalization mode: parse and re-emit with the default layout.
Development
This project uses uv.
uv sync
uv run xmlegant --help
uv run pytest
uv run ruff format .
uv run ruff check .
See AGENTS.md for agent-facing operational notes and design decisions.
Releasing
Releases are cut from master and published to PyPI by GitHub Actions.
Versions are immutable on PyPI — once a number is published it cannot be
reused, so double-check before tagging.
-
Make sure CI is green on the
mastercommit you want to release. -
Bump
versioninpyproject.toml. -
In
CHANGELOG.md, rename the## [Unreleased]heading to## [X.Y.Z] - YYYY-MM-DDand add a fresh empty## [Unreleased]section above it. -
Commit (
Release X.Y.Z) and push tomaster. -
Once that commit's CI is green, tag it and push the tag:
git tag vX.Y.Z git push origin vX.Y.Z
-
The
publishworkflow builds the sdist and wheel and uploads them to PyPI via Trusted Publishing. -
Draft the GitHub Release manually, pasting the relevant
CHANGELOG.mdsection as the release notes.
Release candidates
To rehearse a release without burning a real version number, tag with an
-rcN suffix (e.g. v1.2.0-rc1). The testpypi workflow uploads those
builds to TestPyPI instead of PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xmlegant_format-0.0.1.tar.gz.
File metadata
- Download URL: xmlegant_format-0.0.1.tar.gz
- Upload date:
- Size: 79.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f70b10eeef8744ec42d96f75890baa59bfd8a46f52ac68c2eab101754f93aa24
|
|
| MD5 |
ee177780855037aeeefd3b030a0aa8e4
|
|
| BLAKE2b-256 |
6c4ddb71ac68399d81f4e542705ba35d6486ebc5111b7c7a125b6774e2982b61
|
Provenance
The following attestation bundles were made for xmlegant_format-0.0.1.tar.gz:
Publisher:
publish.yml on DarthEivor/xmlegant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xmlegant_format-0.0.1.tar.gz -
Subject digest:
f70b10eeef8744ec42d96f75890baa59bfd8a46f52ac68c2eab101754f93aa24 - Sigstore transparency entry: 1520696269
- Sigstore integration time:
-
Permalink:
DarthEivor/xmlegant@b7c771efd5e8d390b781340ba6f933bcef473c12 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/DarthEivor
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b7c771efd5e8d390b781340ba6f933bcef473c12 -
Trigger Event:
push
-
Statement type:
File details
Details for the file xmlegant_format-0.0.1-py3-none-any.whl.
File metadata
- Download URL: xmlegant_format-0.0.1-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a202324676242a63d2c9fd60091d910f9d21f33f8fe7d98e702aee892ab1b482
|
|
| MD5 |
4df14ec7109b0651b3381930a26b76b8
|
|
| BLAKE2b-256 |
0ea26b5fa51bd2f51f369e848ddae76d63c1e770755e179be7d2865c46a537c0
|
Provenance
The following attestation bundles were made for xmlegant_format-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on DarthEivor/xmlegant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xmlegant_format-0.0.1-py3-none-any.whl -
Subject digest:
a202324676242a63d2c9fd60091d910f9d21f33f8fe7d98e702aee892ab1b482 - Sigstore transparency entry: 1520696330
- Sigstore integration time:
-
Permalink:
DarthEivor/xmlegant@b7c771efd5e8d390b781340ba6f933bcef473c12 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/DarthEivor
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b7c771efd5e8d390b781340ba6f933bcef473c12 -
Trigger Event:
push
-
Statement type: