Skip to main content

Pretty-print XML and HTML files in a light, YAML-like, readable format

Project description

Unxml

Simplify and "flatten" XML files into a YAML-like readable format.

This is a Rust clone of the original unxml F# tool.

Installation

Pre-built Binaries (Recommended)

Download the latest release for your platform from the GitHub Releases page:

  • Linux (x86_64): unxml-linux-x86_64.tar.gz
  • Windows (x86_64): unxml-windows-x86_64.zip
  • macOS (Intel): unxml-macos-x86_64.tar.gz
  • macOS (Apple Silicon): unxml-macos-arm64.tar.gz

Extract the archive and place the unxml binary in your PATH.

From Source

git clone https://github.com/yourusername/unxml-rs
cd unxml-rs
cargo install --path .

Using Cargo

cargo install unxml

Usage

unxml <xml_file>

Introduction

This command line application was developed for comparing XML files (e.g. database/application state dumps). It takes an XML file and converts it to a YAML-like syntax that is easier to read and compare.

Example

Given this XML input:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <PackAsTool>true</PackAsTool>
    <Description>Unxml 'pretty-prints' xml files in light, yamly, readable format</Description>
    <PackageVersion>1.0.0</PackageVersion>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="FileSystemHelper.fs"/>
    <Compile Include="MutableCol.fs"/>
    <Compile Include="Program.fs" />
  </ItemGroup>
</Project>

The output would be:

Project
  [Sdk]: Microsoft.NET.Sdk
  PropertyGroup
    OutputType = Exe
    TargetFramework = netcoreapp2.1
    PackAsTool = true
    Description = Unxml 'pretty-prints' xml files in light, yamly, readable format
    PackageVersion = 1.0.0
  ItemGroup
    Compile
      [Include]: FileSystemHelper.fs
    Compile
      [Include]: MutableCol.fs
    Compile
      [Include]: Program.fs

Key Features

  • Attributes in Square Brackets: Element attributes are displayed as [attribute]: value
  • Text Content with Equals: Element text content is shown as ElementName = text content
  • Hierarchical Indentation: Nested elements are properly indented
  • Clean Format: Easy to read and compare, great for diffing

Technical Details

  • Built with Rust for performance and safety
  • Uses quick-xml for fast XML parsing
  • Uses clap for command-line argument parsing
  • Proper error handling with anyhow

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Creating Releases

To create a new release:

  1. Update the version in Cargo.toml and src/main.rs
  2. Commit the version changes
  3. Create and push a version tag:
    git tag v1.0.1
    git push origin v1.0.1
    
  4. The GitHub Actions workflow will automatically build binaries for all platforms and create a release

The CI workflow runs on every push to ensure code quality with formatting checks, linting, and tests.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

unxml_rs-1.0.1-py3-none-win_amd64.whl (731.8 kB view details)

Uploaded Python 3Windows x86-64

unxml_rs-1.0.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (938.2 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

unxml_rs-1.0.1-py3-none-macosx_11_0_arm64.whl (848.9 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

unxml_rs-1.0.1-py3-none-macosx_10_12_x86_64.whl (867.9 kB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file unxml_rs-1.0.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: unxml_rs-1.0.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 731.8 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for unxml_rs-1.0.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 5d0910c387813ba1deb9551a72a739d5aafe84ed7f34309da33057c9839cf9ab
MD5 58f1f5153adff4d8693ae8e4078bdd2e
BLAKE2b-256 eede5baa16d1f46f37bc2bcc1f3bf22e8a47005708b154b2e10666eb0684005b

See more details on using hashes here.

Provenance

The following attestation bundles were made for unxml_rs-1.0.1-py3-none-win_amd64.whl:

Publisher: release.yml on vivainio/unxml-rs

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

File details

Details for the file unxml_rs-1.0.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for unxml_rs-1.0.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 403f1f792d6e098e3df729c18514116cdc77e4b4b4dad6ee8bf125f7372aba14
MD5 63ed212a2e6a68ce38f507bd2edd2686
BLAKE2b-256 b84179df222c60ff1a40e44ee8bbf33b790ce2cc14ecede57c68fb474cee78cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for unxml_rs-1.0.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on vivainio/unxml-rs

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

File details

Details for the file unxml_rs-1.0.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for unxml_rs-1.0.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 191339af98910be9545fa4951b320bb73beb782c881bb89d0d3c28ed132742b0
MD5 19ce47e22df51c6b236fa7cd4b48e36d
BLAKE2b-256 adfe3b51300550d12c2ef64d642f0894682491d3cc0a18b86322c469d6a9e56d

See more details on using hashes here.

Provenance

The following attestation bundles were made for unxml_rs-1.0.1-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on vivainio/unxml-rs

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

File details

Details for the file unxml_rs-1.0.1-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for unxml_rs-1.0.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 97088c90e8b202c46de5841d7734a7d4255767bf3fdc992aa126fd72d2684d94
MD5 9615ff1b74d6c3e6bee4bc8b1c68719a
BLAKE2b-256 b0007facdf417fd7271101ede27510fa1810e0c66b529258c700dae4575c9ddd

See more details on using hashes here.

Provenance

The following attestation bundles were made for unxml_rs-1.0.1-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on vivainio/unxml-rs

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