Skip to main content

A XML parser for Python written in Rust

Project description

rxml

What is rxml?

rxml is a simple python library to read xml files up to 2 times faster than python's xml(ElementTree) library.

Installation

To install rxml you can use pip:

pip install rxml

Simply as that!

Example usage

To a given xml with test.xml as name:

<?xml version="1.0" encoding="UTF-8"?>
<note example_attr="example value">
    <to>
        <name>Example Name</name>
    </to>
    <from>
        <name>Example Name</name>
    </from>
    <heading>An Example Heading</heading>
    <body>An Example Body!</body>
</note>

We write the following python code:

from rxml import read_file

root_file = read_file("test.xml", "note")

where "test.xml" is the file_name and "note" is the root_tag.

After that we can simply iter through the children with:

for node in root_file.children:
    # do something whith the node here

Node attributes

This is how the Node looks like:

class Node:
    name: str
    attrs: dict[str, str]
    children: list[Node]
    text: str

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

rxml-0.2.0.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distributions

rxml-0.2.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.3 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ s390x

rxml-0.2.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.2 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ppc64le

rxml-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

rxml-0.2.0-cp311-none-win_amd64.whl (156.0 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

rxml-0.2.0-cp311-none-win32.whl (149.2 kB view hashes)

Uploaded CPython 3.11 Windows x86

rxml-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

rxml-0.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.3 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ s390x

rxml-0.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.2 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ppc64le

rxml-0.2.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARMv7l

rxml-0.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

rxml-0.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.5+ i686

rxml-0.2.0-cp311-cp311-macosx_11_0_arm64.whl (272.2 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

rxml-0.2.0-cp311-cp311-macosx_10_7_x86_64.whl (285.0 kB view hashes)

Uploaded CPython 3.11 macOS 10.7+ x86-64

rxml-0.2.0-cp310-none-win_amd64.whl (156.0 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

rxml-0.2.0-cp310-none-win32.whl (149.2 kB view hashes)

Uploaded CPython 3.10 Windows x86

rxml-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

rxml-0.2.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ s390x

rxml-0.2.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ppc64le

rxml-0.2.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARMv7l

rxml-0.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

rxml-0.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.5+ i686

rxml-0.2.0-cp310-cp310-macosx_11_0_arm64.whl (272.2 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

rxml-0.2.0-cp310-cp310-macosx_10_7_x86_64.whl (285.0 kB view hashes)

Uploaded CPython 3.10 macOS 10.7+ x86-64

Supported by

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