lxml to dict
A simple conversion of an lxml.objectify element to a python dictionary.
Usage
>>> from lxml_to_dict import lxml_to_dict
>>>
>>> lxml_to_dict(<the lxml.objectfy.Element>)
>>>
>>> root = objectify.Element("root") # <root></root>
>>> b = objectify.SubElement(root, "b") # <root><b></b></root>
>>> b = objectify.SubElement(root, "b") # <root><b></b><b></b></root>
>>> a = objectify.SubElement(root, "a") # <root><b></b><b></b><a></a></root>
>>> lxml_to_dict(root) # {'root': {'b': None, 'b1': None, 'a': None}}
Test
You can run the tests using tox
tox
Publish
To publish a new version of this package your Pypi user needs to be added to the project. (Ask Connor to give you access)
# Update version number in setup.py
python setup.py sdist
twine upload dist/*
Metadata
Release files for lxml-to-dict 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lxml_to_dict-0.1.2.tar.gz | 2.1 kB | Without provenance | Details for lxml_to_dict-0.1.2.tar.gz |
Release files / lxml_to_dict-0.1.2.tar.gz
| Download URL | lxml_to_dict-0.1.2.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4fc9eab30614834e85b3a8eccbe19effccbbd09d9377989cb3d63a29808023e
|
|
BLAKE2b-256 checksum How to use checksums |
d8aefa93a5ce28a721f975997567d3327e60a2513122b4c5b53ef06c452c0f7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.2
|
Security for lxml-to-dict 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.