dynamicxml
A simple extension of Etree that gives users the ability to directly access attributes and nodes without having to implement boilerplate python code.
Rationale for this library: Dynamic XML Library with Python
Pip Installer: pip
python -m pip install dynamicxml
DynamicElement is a drop-in replacement for any Etree code that you already have
<!-- ConfigFile.xml -->
<ConfigurationData>
<Runtime timeout="1000" runtimeDataPath="/path/to/runtime/data" />
</ConfigurationData>
# main.py
import dynamicxml
# parse the data and get back an instance of DynamicElement
root = dynamicxml.parse('data/ConfigFile.xml')
# Print the tag of the root element, just like you would a typical etree
# element
print (root.tag)
# get access to the runtime data node, which is a child of
# <ConfigurationData />. The library returns a list of child
# nodes, regardless of how many elements there are. An "AttributeError"
# is raised if the node does not exist.
runtimeNode = root.Runtime[0]
# Access the attributes of the node directly using the "attr_" prefix.
print (runtimeNode.attr_timeout)
print (runtimeNode.attr_runtimeDataPath)
# set the data directly
runtimeNode.attr_timeout = str(int(runtimeNode.attr_timeout) + 1)
# easy writing of the data
dynamicxml.write('data/ConfigFile_Updated.xml', root)
Metadata
Release files for dynamicxml 1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dynamicxml-1.2-py3-none-any.whl | Python 3 | none | any | Details for dynamicxml-1.2-py3-none-any.whl |
Release files / dynamicxml-1.2-py3-none-any.whl
| Download URL | dynamicxml-1.2-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
edc96329e07f26d014fc9bdd0e62ac69830d146a8eaf5399d8f4143fed4b7abf
|
|
BLAKE2b-256 checksum How to use checksums |
3041b60d80b30203fae9505cf3957dfb78f0bde9443d47497590c10bca402aec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.0+
|
Security for dynamicxml 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.