Skip to main content

distxml

Convert labeled data to xml at scale.

Installation

Run the following command:

pip install distxml

Usage

Import the the package and create an instance of XMLConverter with your desired outer xml tag.

from distxml.xml_converter import XMLConverter

xml_con = XMLConverter("Hello")

You now have an XMLConverter object, and if you print it would write <Hello /> to console. Now add data you want within the Hello tags.

data = [
    {'start':'Good morning', 'finish':' Good night'},
    {'finish':' Good evening', 'start':'Good morning again'}
]

xml_con.queue(data)

Now this data is queued in the XMLConverter object, but if you print xml_con, it will still write <Hello /> to console. To solve this, you must compile the data.

xml_con.compile("Greetings")

Now if you print, the console will read

<Hello><Greetings><start>Good morning</start><finish> Good night</finish></Greetings><Greetings><finish> Good evening</finish><start>Good morning again</start></Greetings></Hello>

Finally, to write to a file, just use

xml_con.write_to_file("filepath/file.xml")

And there you go, a new xml file!

Release files for distxml 0.1.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 distxml 0.1.1
File Size Uploaded
distxml-0.1.1.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for distxml 0.1.1
File Interpreter ABI Platform
distxml-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.2 kB

Release files / distxml-0.1.1.tar.gz

Download URL distxml-0.1.1.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cc34ed5208993230d502c47208871ba7ae06aedbf18fbf5b4892480568a9af5a
BLAKE2b-256 checksum
How to use checksums
57e4afa668fd26e565aaa2b257f81e632aff31015113f5e44b52a2b75ab5cdf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release files / distxml-0.1.1-py3-none-any.whl

Download URL distxml-0.1.1-py3-none-any.whl
Size 2.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06ff2f8629fbc0791b88a994589731e5b751f3d80e3a61fa661f895d9c58462f
BLAKE2b-256 checksum
How to use checksums
4f9153347a983f48d6b884c068f92d0b5b95ae5005f6f9e20a00a8b3885fb96c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.2

1 release file

0.0.1

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