Skip to main content

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 ...]
  • format rewrites each input file in place. With -o, writes to one output (errors out with two or more inputs).
  • check prints 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.

  1. Make sure CI is green on the master commit you want to release.

  2. Bump version in pyproject.toml.

  3. In CHANGELOG.md, rename the ## [Unreleased] heading to ## [X.Y.Z] - YYYY-MM-DD and add a fresh empty ## [Unreleased] section above it.

  4. Commit (Release X.Y.Z) and push to master.

  5. Once that commit's CI is green, tag it and push the tag:

    git tag vX.Y.Z
    git push origin vX.Y.Z
    
  6. The publish workflow builds the sdist and wheel and uploads them to PyPI via Trusted Publishing.

  7. Draft the GitHub Release manually, pasting the relevant CHANGELOG.md section 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xmlegant_format-0.0.1.tar.gz (79.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xmlegant_format-0.0.1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

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

Hashes for xmlegant_format-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f70b10eeef8744ec42d96f75890baa59bfd8a46f52ac68c2eab101754f93aa24
MD5 ee177780855037aeeefd3b030a0aa8e4
BLAKE2b-256 6c4ddb71ac68399d81f4e542705ba35d6486ebc5111b7c7a125b6774e2982b61

See more details on using hashes here.

Provenance

The following attestation bundles were made for xmlegant_format-0.0.1.tar.gz:

Publisher: publish.yml on DarthEivor/xmlegant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for xmlegant_format-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a202324676242a63d2c9fd60091d910f9d21f33f8fe7d98e702aee892ab1b482
MD5 4df14ec7109b0651b3381930a26b76b8
BLAKE2b-256 0ea26b5fa51bd2f51f369e848ddae76d63c1e770755e179be7d2865c46a537c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for xmlegant_format-0.0.1-py3-none-any.whl:

Publisher: publish.yml on DarthEivor/xmlegant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page