Skip to main content

prettify-xml

License: GPL v3 Python Versions Style Black Documentation Status status-badge

Why

Pretty xml output is necessary for debugging xml-based communications and other operations involving XML

What

It is a simple command-line application formatting XML files written in Python

Usage

xml-formatter -i sample.xml -o formatted_test.xml

Installation

Production Build

pip install xml-formatter

Dev Build

Linux

Run with one of the follwing:

bash install.sh
./install.sh
sh install.sh

Windows

Double click on install.bat or run

install.bat

Usage

python .\xml-format.py -i .\sample.xml -o formatted_test.xml

Register a shell command

The section is about registering shell commands using the Click library. Maybe you are curious, about crafting your own OS? Go for it! I do it and it is a lot of fun :)

The best way to have a system wide executable command on both, Windows and Linux systems is to use setuputools.

There is a description in the click package about how to do it

In a nutshell, the setup.py file has to follow a certain pattern, e.g.

from setuptools import setup, find_packages

setup(
    name='prettify_xml',
    version='0.4.3',
    packages=find_packages(),
    include_package_data=True,
    install_requires=[
        'Click',
    ],
    entry_points={
        'console_scripts': [
            'formatter = prettify_xml.formatter:format',
        ],
    },
)

Then, you can run on Windows:

python -m venv venv 
venv/Scripts/activate
pip install --editable .

And on Linux you can run:

python -m venv venv 
source venv/bin/activate
pip install --editable .

Then, test the application with:

xml-formatter -i sample.xml -o formatted_test.xml

Metadata

Release files for prettify-xml 0.4.5

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

Source distribution (sdist)

Source distribution for prettify-xml 0.4.5
File Size Uploaded
prettify-xml-0.4.5.tar.gz 14.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prettify-xml 0.4.5
File Interpreter ABI Platform
prettify_xml-0.4.5-py3-none-any.whl Python 3 none any Details

Total release size: 30.1 kB

Release files / prettify-xml-0.4.5.tar.gz

Download URL prettify-xml-0.4.5.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b332c899f1e51352c783c30f750c609de801e6f99a94ef865aa58b80757820a3
BLAKE2b-256 checksum
How to use checksums
6fd0f822d826ed1668877f3ace1be7724bbf144b89c7c71501ad2871fdc4c321
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / prettify_xml-0.4.5-py3-none-any.whl

Download URL prettify_xml-0.4.5-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
881a7602882536d93fd76b874b47e08166fe093083ef2302afa50150013f6229
BLAKE2b-256 checksum
How to use checksums
425f37f20892dcfe8ce54a3ee2eab30c64418ae7707a24e571288da4db063d58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.4.5 This release

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

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