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
You can also write it to a file or string(refer to the .pyi
file for the args).
from rxml import Node, write_file
example_node = Node(
name="hello_world",
attrs={"example_attr": "example"},
text="Hello World!"
)
write_file(example_node, "test_ex.xml")
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.4.0.tar.gz
(7.4 kB
view hashes)
Built Distributions
rxml-0.4.0-cp311-none-win_amd64.whl
(169.7 kB
view hashes)
rxml-0.4.0-cp311-none-win32.whl
(164.9 kB
view hashes)
rxml-0.4.0-cp310-none-win_amd64.whl
(169.7 kB
view hashes)
rxml-0.4.0-cp310-none-win32.whl
(164.9 kB
view hashes)
Close
Hashes for rxml-0.4.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8be28ddd0ac9b956ef3e344e3dae1d84f1cd77107638d0b395c8eb636bd8c60e |
|
MD5 | deb5d286ea611892de0a1305ee4426c7 |
|
BLAKE2b-256 | 98cdc27b66be84ba31640e7093bc2f4fe3d05163a675b75a360f2a93b53d3047 |
Close
Hashes for rxml-0.4.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e56dcda3d216bfb536ff31367cffb877b603b8b112b2ac8044cca29a03212fa |
|
MD5 | 9027a69e7283ed1c2d740ea9c67e12aa |
|
BLAKE2b-256 | b155eeb0220c0ad07a5c9d34cdfa02ce560d93feb9a1a83addd533fff72cb19b |
Close
Hashes for rxml-0.4.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a7a20364e66da150f0c3dc99fa436b1a94af8e35ac1ab1de41b406821f4e917 |
|
MD5 | a9a1949f41f0751d5f8d9e96752d1316 |
|
BLAKE2b-256 | 5ed9c8b369dc169e40729045773d17ffe08566b4cc586c1d31ba8e21f64055fa |
Close
Hashes for rxml-0.4.0-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4126a07f219f0a0e9c2707a2f8d461466c67cdb81e4873ce2a56c7d06c3d9119 |
|
MD5 | faffa62759ce7f3ab43dae9b349f2489 |
|
BLAKE2b-256 | cdd29aaa32df824ae4b68b674aef341506ba09153cc8d358e52d04b6b6646157 |
Close
Hashes for rxml-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94147d2ce5c5df1b3c379bcd45d806d1a86078811c6b10110bc47f311099ba72 |
|
MD5 | c7ea78babec6604969e9229c0a25bbc5 |
|
BLAKE2b-256 | f271b95ba3af450e6b129a0b2a93031163d28c1017b49007826f65d043fa75e2 |
Close
Hashes for rxml-0.4.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f23d149ee8085f75ec1708bf163b5aae12dbe42af6f397fc02f21ec939e6a14 |
|
MD5 | 13c286d13a0e9fe2f9af5ae54c20ad3f |
|
BLAKE2b-256 | 9c7a00f763d6321fcf60652c0f8fff14f19c8e39ba95387431c751ba0efabe9a |
Close
Hashes for rxml-0.4.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc19419c85d18e9837c211f30a30b2d0a40f52accffec55239552cfd6341a0c7 |
|
MD5 | eb63bff0ba0e74980e85a0547948a357 |
|
BLAKE2b-256 | b2e48ef16e49ea8a592d34447c40fc167828f1f060a5b80c98acf8e695f640ff |
Close
Hashes for rxml-0.4.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5185397c013be1c0e1bfea469f582694b3acce1f5c669ec926eec96793094e65 |
|
MD5 | 1839a1684e94d6c8fec5caf793aee9e9 |
|
BLAKE2b-256 | 98cba55a1587967d9134fdc1812cc1d658d604887967342810c11d6fa5d443d1 |
Close
Hashes for rxml-0.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e4043733288b5965e64e44ed2ab9268f31eddd93e1cf1c97171c0f15cc6e80a |
|
MD5 | cb9dc7650002cb3ce24250e1f4e8a474 |
|
BLAKE2b-256 | 55ffd4a6d51a2f366754474171a877c009d68e4e46a10ea94e9e632304282893 |
Close
Hashes for rxml-0.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83ae5b8a7f7abba421680cb5318b219e44c7ec2eb5f9d683afbf0054fcb5fe03 |
|
MD5 | c6375b4875d8f11de8891185092ae251 |
|
BLAKE2b-256 | 4359d4cde75592db32bdd577362b0fc74e884d5a89fe4477347f509f6f7c0f51 |
Close
Hashes for rxml-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef030284a0637bb5d6a76a426c99d84af7e0bb8cc667a33ccc3b09b001d7484c |
|
MD5 | 3634fed4ad0c7fd268b6e5082bd62fa0 |
|
BLAKE2b-256 | 8bb982d187ab8bbaf8038cbe302d7a54baf4773d0725d6bfa9037ab6026d15c2 |
Close
Hashes for rxml-0.4.0-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecb0d8cef4ff657b1b6429421b9a53c825f6a79ed74232fea615ae2cb2b7212b |
|
MD5 | 196d4cd4aca42ec61740472f106577ee |
|
BLAKE2b-256 | 88281cb03bfabf98a98c8a54f45b6f0e7a10343c6f0a28d9438c8b9b52c260b2 |
Close
Hashes for rxml-0.4.0-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ddfbf508b738e4abf065d6d53ac28eb765dc15b1aeeb10a45b8cdc07139e40b |
|
MD5 | 4c83194712e52bb37574d5c82e7ef5c4 |
|
BLAKE2b-256 | 944825e15e78415e3cbc5b4a610b5912e1cc02f6f4cb588bc7eb231ec3c4b0aa |
Close
Hashes for rxml-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41cb400bed65de720eb266ba8bb5e1bf0a9bacbcba969aa18a4c14d639ac3007 |
|
MD5 | 06fcde382ec7f13ecba1f0dc24811e47 |
|
BLAKE2b-256 | 32b195240672f49b878c2b17b90b06cca4d2f64b4408939c6216481972d4a4f4 |
Close
Hashes for rxml-0.4.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0ab101846f5dec38ea58e6e3a8b52a9c844408b50742175ecda1e008b34c5ad |
|
MD5 | 94d0255360fb2fd0734cb476e8b3b9af |
|
BLAKE2b-256 | 1c7bec04d5927ab82fa0f9abda166cf239566157df4574c64b9c41dd477c3722 |
Close
Hashes for rxml-0.4.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed1a9a78d7bee2463bd8ea32ba4ef5e2a3db898bed906cb6cbb07ae08c88d324 |
|
MD5 | 757f012ca07bb2aa05e51e182f658abe |
|
BLAKE2b-256 | 5edbda6c3bf9c23ea596077ff24f3acd06bb5778c260299d2b1ff53b981acd48 |
Close
Hashes for rxml-0.4.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 870fb15e2fa526be1410bdae43c96fb826d8aaabd41ab2908b50e269c6188df1 |
|
MD5 | 58a1b233f52b619c9132eb0dab3f4394 |
|
BLAKE2b-256 | 6973e131fe024ccd697c17fdfc1221cf3867de9bbf97832d86bb7197c880c393 |
Close
Hashes for rxml-0.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c927d9b3555b29af7f3d1e9baeb25a4cf073b129e1c5360bf1d9f232889067a4 |
|
MD5 | 966b305dacc33f3a28a3949955fce84d |
|
BLAKE2b-256 | b9ad7051d714d6fdb9e906180a62e225a9d11536fd83d23208f8c568a2592b2c |
Close
Hashes for rxml-0.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4c62a53645dfa8e39e617ae8d0471f9e78fc0e6964f5a18b9639f5435cabdae |
|
MD5 | ff52aada3d3d0e8433d63c00169a7dc6 |
|
BLAKE2b-256 | be19675b4265a4e48a36011b2f1c0685ce8ee4717bb9039460e876adc17e0f13 |
Close
Hashes for rxml-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15b8c899576082c98b9f681d741f759445a9911fa5aa66a958ac2adda906d73e |
|
MD5 | 39692f81abe0706fe5fc66fcce8cc4e3 |
|
BLAKE2b-256 | a226315cdeffd194de88624431ebf384f4d0882a724ed4f130adc68b2a957e6f |
Close
Hashes for rxml-0.4.0-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6edb75ef0a9095949ca5ad053b4d0d127cbb2c43ee27e249a23d30ea65ef0cef |
|
MD5 | beb909a9d766ad92ab4aba06d5a346c5 |
|
BLAKE2b-256 | 93319ce47d45cc7336bb7a8fedcfb2f34aeef17d7abfa5cad74d1d6252bd450d |