Efficient XML-to-dict conversion backed by Rust
Project description
quick-xmltodict
Efficient XML-to-dict conversion backed by Rust.
>>> from quick_xmltodict import parse
>>> xml = """
... <movies>
... <movie>
... <title>Her</title>
... <director>Spike Jonze</director>
... <year>2013</year>
... <genre>Science Fiction, Drama, Romance</genre>
... </movie>
... <movie>
... <title>Encanto</title>
... <director>Byron Howard, Jared Bush</director>
... <year>2021</year>
... <genre>Animation, Family, Fantasy</genre>
... </movie>
... </movies>
... """
>>> parse(xml)
{'movies': {'movie': [{'director': 'Spike Jonze',
'genre': 'Science Fiction, Drama, Romance',
'title': 'Her',
'year': '2013'},
{'director': 'Byron Howard, Jared Bush',
'genre': 'Animation, Family, Fantasy',
'title': 'Encanto',
'year': '2021'}]}}
Features
quick-xmltodict
is a Rust-backed XML-to-dict conversion package designed to be fast and efficient.
It has a single function, parse
, that takes an XML string and returns a Python dictionary.
You should be able to use this function as a drop-in replacement for the xmltodict.parse
function from the original xmltodict
package (used without any extra arguments).
Like xmltodict
, quick-xmltodict
follows this schema for converting XML to JSON.
quick-xmltodict
currently does not support namespace expansion, or the reverse operation (dict-to-XML conversion). For these features, use the original xmltodict
package.
Performance
Since xmltodict
uses the non-validating C-based expat parser from Python's standard library, it is already very fast.
quick-xmltodict
is nonetheless about 2-5 times faster than xmltodict
.
Contributing
PRs are very welcome! Please make sure to run the tests before submitting a PR.
Development
This project uses Poetry to manage the environment and Python dependencies, so you'll need to have it installed in addition to Python and Rust.
To install the development environment and run the test suite:
poetry install
poetry run maturin develop
poetry run pytest
Be sure to run poetry run maturin develop
after making changes to the Rust code.
Add the -r
flag for a release build (for example, if you want to run benchmarks).
It's recommended to install the pre-commit hooks:
poetry run pre-commit install
This ensures that linting and formatting are run automatically on every commit.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for quick_xmltodict-0.1.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d627d30b058d7a3b3955aa3cd0e55b9f8632247f0270703bfe163ffe0ed970e4 |
|
MD5 | 67ef4fc9512315fe56854077f2a705db |
|
BLAKE2b-256 | 846468cc57d91a49b9bc9140d51c60f4a5251b8ad8d1b231f07ede80b06fdae7 |
Hashes for quick_xmltodict-0.1.2-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40ac9adeb670b5dba0e01f4e52078c69001249657bcae0b8770e57520c1542c9 |
|
MD5 | d1efa0314220812ae71db2254aeb638c |
|
BLAKE2b-256 | d18daa6566d405e2f4793b27d04a69c1f00a062b6f8c6b2536dbc6f8c87daaf3 |
Hashes for quick_xmltodict-0.1.2-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dab6cc6e1955df12a63ce40dd523c63a0f9d690c726d67711ab24a20de0eb30f |
|
MD5 | 67437cdb5477b36ce2d95afc57704c19 |
|
BLAKE2b-256 | fe3ad5687021caddf2d2e43067d85fd4f23e84dd365d76e11f106d707b14d12a |
Hashes for quick_xmltodict-0.1.2-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51183b85193292c76cf1216b6303f8e520947d2f089089bc6ba90873d261ec7a |
|
MD5 | 23d5c4491e7585b421ba0cc05b1cfe65 |
|
BLAKE2b-256 | d2070f0816bf9eacda9c97d175941fed341d8a952798c5aa5385f9f3f95e25db |
Hashes for quick_xmltodict-0.1.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17c01176a254cc4320d8c35328602d1c21c7136bb1153c9166a481420a8ac257 |
|
MD5 | 4d404f80bef803190a21149e6febf659 |
|
BLAKE2b-256 | 9b3688d0240c3df88a4916913a2c132edb32f1a176ff18265d827010b65af0ed |
Hashes for quick_xmltodict-0.1.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0a69aca89134e3d088d8ecc432655df0ab8b6a2e3d7e3ad2cddcac209970ccf |
|
MD5 | f187897adb671500a6eac9beb89dd497 |
|
BLAKE2b-256 | 7c621af1686e36646b44aec6bf5711ba51cc05a3f0ea0f821ef49da10f8151a6 |
Hashes for quick_xmltodict-0.1.2-cp312-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 246eddd6e11207c3c7101fabbed110cb51d7fcce9610703650f66844fbc1dfd8 |
|
MD5 | 7336705293ddc51b9ed2acc9ff761eca |
|
BLAKE2b-256 | d6cb6dea367067d28342e65634697f787fcb0edfa2bacee612475eedfe8e43b2 |
Hashes for quick_xmltodict-0.1.2-cp312-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 009640692d793a0784c06f435849ad0b86c54611cea898448e06fda5aa5d149c |
|
MD5 | 23821678cb076786950112e2774cf99c |
|
BLAKE2b-256 | a8b0ac823a5d6a09d456022d4f301ef200342fd9ae289c0c5409c00cd9470789 |
Hashes for quick_xmltodict-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73f1be5625a89e97a062a53fa080e1a9fa2ca0514ce5a7bc62dd08d275a5d18c |
|
MD5 | 25f3c1f9b7a4fe017b82607215ab449f |
|
BLAKE2b-256 | 13607f60d5c5cee8e117573f56c65c4c1dad8c1f1bc62a77cb3a4ce5943c04f5 |
Hashes for quick_xmltodict-0.1.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd93a853bdd00938ed1bbc5a9362f713dc7947e87eafd5f33ff93a2ec4e8f7fa |
|
MD5 | c8a0a3eadaffea15de5ce566d22ca417 |
|
BLAKE2b-256 | 6fb3b85a5b10b36de78779f2cd1d7cd2bda1eda66be71f2414f6317944cfccb3 |
Hashes for quick_xmltodict-0.1.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69c5eb01387b91b7b56ed27e98518abca0a6eb866e2b54582547ca3e4e3e8bdb |
|
MD5 | ff4ac82b3faa2481f1a92d3f8955a733 |
|
BLAKE2b-256 | ea976fa4539770f545b44bbad13924264903fe6738597436f8b4eb5e6a871377 |
Hashes for quick_xmltodict-0.1.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 344d107d716f3f52993f3232dc840095447fd9a70ef8aa4c5c61513044fc2119 |
|
MD5 | e2b8ae9339620590cee3234a62a6d3b8 |
|
BLAKE2b-256 | 981347cadc21f19aa6e4857b101d13c373577129e9be5c79c12e38ccbb30837e |
Hashes for quick_xmltodict-0.1.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f2456d497279687e3645bd29b57491c4a2938a63865e1e4856c7865356e4e12 |
|
MD5 | 16585466666cea14b7ee2ab8c2d500ed |
|
BLAKE2b-256 | 59e6041d0f353aaf5b49a99c34d15c9edc3883ad8fccc931736e94af6610ee2e |
Hashes for quick_xmltodict-0.1.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf25629ed1ed8964fe65a0579cb3f7ca364743032189727fec95cdd7659c8343 |
|
MD5 | 193cf28a9908419cf6adeae27c927a23 |
|
BLAKE2b-256 | cbe08468ba2a29a10eeabbd7c706a33b9d9781b49e7e9041b44d98351c8bd1c9 |
Hashes for quick_xmltodict-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02a73b5bfaa9c0ad626019cf6da83a9dd15042c8dc4b43e9d5cfa99e4de61fe9 |
|
MD5 | e72826eb5ff75e72413da0b203a6e356 |
|
BLAKE2b-256 | 37fb8649b2cffa178d66b14ff33a0b535a3642a3076c06585cfa6924fefd2007 |
Hashes for quick_xmltodict-0.1.2-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f8278969786787be3fc4a8cf7f785b54929db62466739b770535ee44cfc61d4 |
|
MD5 | 9f671da26412cccaf892fa7a8fc994e8 |
|
BLAKE2b-256 | 0fa021b2cfd98e22ce1445a1a4f2a82a909a3a2fb7d965dac94b0729db74000a |
Hashes for quick_xmltodict-0.1.2-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ab462ac00d3d974c6eaa567ab43d008ce3116dcb3d3198dcabfa6f29ca8446f |
|
MD5 | 5790939d7c83d8168bb44ba34b7f6b79 |
|
BLAKE2b-256 | eb821fad997030af61ac847026d29b4c7f80e51e1f105dc6cb71227ec7564d56 |
Hashes for quick_xmltodict-0.1.2-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fa945b250cd3833b214a23c8b56d1e07ac5018ad53220c227748dcf86381a97 |
|
MD5 | 8d931063cd784ee2e968d407827de0d5 |
|
BLAKE2b-256 | e8064226e1bc2a0e39393fb133fa15d42cd7da0f2cb58489891f0146d9825e84 |
Hashes for quick_xmltodict-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d77b96d6cc151a13e825468f5b7461dccf0ac334307ba1a7693abe2cfd56bff |
|
MD5 | 5d5daf6f4672ce2efed97b653b6eff36 |
|
BLAKE2b-256 | 1d914088ae7fa470ea9b1e7dc45453fdc4243d9ad6d6fc0a49f8931f63658670 |
Hashes for quick_xmltodict-0.1.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 632eb0211aef6ce826f4e5e910fd0b9efc939ef97e712c310bceed17b0b69f9a |
|
MD5 | 2bde0fec7d3c2489b2f0569bae26c959 |
|
BLAKE2b-256 | aec3169c42a58b3508e46f99521f7342c24d1c85fee44af0f97c2770c4a6255a |
Hashes for quick_xmltodict-0.1.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe1dd4caffaee9b002dd608dd1701d091b3eb5f2f4b46e420154f108ca1a3ead |
|
MD5 | be0ed3feaecdb67b8bbaed11fc25138d |
|
BLAKE2b-256 | b083a235bb9488c79559d4294148c0eb6969771af454de1f0f98d2b307f90dea |
Hashes for quick_xmltodict-0.1.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a48835fea083928ba759e0e1c65cae35daa10f35e0175dbc203c9ea7d3979be |
|
MD5 | d876ab242315d91193720ba9cd00e273 |
|
BLAKE2b-256 | 917a2a0e6a41c242f1bbe3f3f178cdfacd9836293c0141d243784de1ed9f7cab |
Hashes for quick_xmltodict-0.1.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c00620c3d3488997068e56fca848dd5d6175912be1fabf9b421a8f4e696be24c |
|
MD5 | 191a90734bf64178e6fb32534287aa91 |
|
BLAKE2b-256 | 6199f6c00735454a2961be565b6f9ebef0cfae2d40ff3cd7d8c0853687a90458 |
Hashes for quick_xmltodict-0.1.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a812c36d42cf412e8fb3eed13f094a5964977ef1c1f877f0eb26cd45ed627d74 |
|
MD5 | 8585ecaca59e5bd988035d8d7126def3 |
|
BLAKE2b-256 | e299a441d70a4e913b8b227b9bd5524f78fdc6774e758237bfc1219eec6a534e |
Hashes for quick_xmltodict-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 866328e7bfdae76705a0ee7da105c3dd481028f6cad972ab6c89834a54f2daeb |
|
MD5 | 2a36151aaa07d941fb30ffcd58f2f1e8 |
|
BLAKE2b-256 | e74ce0626d2cb64fe82074a39e7388ee2b85be857a387a4db7d5eafd565a3e96 |
Hashes for quick_xmltodict-0.1.2-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01c95d6117403d97be49dd68f78a249c2c9d41b9efb749fdcd3899cb601159f4 |
|
MD5 | c700be00a742cbfa7054aefd2d410a82 |
|
BLAKE2b-256 | c4d900c3db52dae4a0aa5b103cacdf8792328e3d872cc64bbb9c6bce0026d705 |
Hashes for quick_xmltodict-0.1.2-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df74f5b4d156c8be31145a19c63645c6a804428874e0068a27a9fbbc370448cd |
|
MD5 | 1330e4da9899f679dc85729792c88099 |
|
BLAKE2b-256 | efe5333cf78ed7f0ea55840e6369e253fdfa2f5274ccc1aa37bebdd84acf1be2 |
Hashes for quick_xmltodict-0.1.2-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb77055302e3785f8b562178f616043b19c4eb52fe7f934e6b88ef4acb9eb30b |
|
MD5 | 5f7dd14b84d9dabeb2c0535db76db6f4 |
|
BLAKE2b-256 | 0ebceea36a4ffa942fdfd6c6865b56c413ffac7619a62afe048c7a594f878fb6 |
Hashes for quick_xmltodict-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dffa0516bdc9b4f79c5382b8c73f93e2979b7d5bef4b5a7b4a01f0286d18e35a |
|
MD5 | 934d69313fd95a0788742a6133a03fd3 |
|
BLAKE2b-256 | e46a051f020b0dfdfdb20216f1b7e3f6b93308fc1b2f0ab88c4fbd0a9380ed81 |
Hashes for quick_xmltodict-0.1.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bc7271ce1cfcd04c15608752bdc72ffded705139a95d8da4440f3e26a59b647 |
|
MD5 | 77af8444390cf2a684712f016fb757d1 |
|
BLAKE2b-256 | 7fc4ac8eadba276e520746a5e571d3a9123f27b3e74d8bccdda5731248d79054 |
Hashes for quick_xmltodict-0.1.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b32fa40751934df7702b151c2cfd7147710f5918be913122a422fd4cbdf0b3a |
|
MD5 | d2040ff2902083cda3411d0dd3323171 |
|
BLAKE2b-256 | dfa6f3b643f5659dc53b1b28da740b7681bbc019f65788922d47aead73d8318b |
Hashes for quick_xmltodict-0.1.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 800748229b15dbd875ab6038796798c669708dc47fdafd3848cae0cdd4874c47 |
|
MD5 | e2a697a44f15efc43f8ce9a901992fa7 |
|
BLAKE2b-256 | 7e317009884bad6ede6d6014aa62c15896e3433b9d5dd551654a1105f388f905 |
Hashes for quick_xmltodict-0.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e5a6f73513065a6f2afdedc9e54bded64a75efb0e943e4441c51867d08f9efa |
|
MD5 | 83cf5cfb717b7ffa3137b626c86fa646 |
|
BLAKE2b-256 | d013863265a4ccda806158856f89cd1e6873df9595b9a1d64b4ee65068a3b417 |
Hashes for quick_xmltodict-0.1.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c6a61653097d802cded95a6dfa8779058598be1ab6d4836f6b2fcfb5697f3fa |
|
MD5 | a9a641bf53b43b8e5574ffbb286f800f |
|
BLAKE2b-256 | daf107044a7dc298e336e0db7397ee5c85c07fafdf155b5ed37fe5e2389323b4 |
Hashes for quick_xmltodict-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b22ff0de1e57a641b375c5d3ab8711afe88bd54e2a857d901b80596ced7d86a1 |
|
MD5 | a1b2360a3c9117debda9159653baf9b2 |
|
BLAKE2b-256 | f1b5b2e2a5341529c0a1961a6438cfd7a93499bfe0131e42a958ae8334ba7671 |
Hashes for quick_xmltodict-0.1.2-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29b07098b9edc66740a94760b5613d82a234dccb5cb311248f6cd2067c599791 |
|
MD5 | 3767d9182436a4cb7c69fc497d7448c4 |
|
BLAKE2b-256 | 7b43239203b7a0adade89edd819b01f78a620a14d94d47137b779b75553dd65d |