Comprehensive XML generator for Python
Project description
Project Name
Comprehensive XML generator for Python
Table of Contents
Installation
pip install xml-generator
Usage
Import
from xml_generator.types import XmlNode
Comprehensive parsing
Parse Comprehensive format into an XmlNode object.
node = XmlNode.parse(
{
"name": "node",
"attributes": {"attr1": "value1", "attr2": "value2"},
"body": [
{"name": "child1", "attributes": {"attr1": "value1"}},
{"name": "child2", "attributes": {"attr2": "value2"}},
],
}
)
Searching a specific node
Return the first XmlNode with the given query. Query can be a name with attributes.
parent = node.find("node")
child1 = node.find("child1@attr1")
child2 = node.find("child2")
Generate a xml file
Using the to_xml() function that return the XmlNode as an XML string.
with open('sample.xml', 'w', encoding='utf-8') as f:
f.write(node.to_xml())
Contributing
Coming soon.
License
License :: OSI Approved :: MIT License
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 Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xml-generator-seobaeksol-0.0.1.tar.gz.
File metadata
- Download URL: xml-generator-seobaeksol-0.0.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5d908ad9f8dc8896dd4ad6e426938d0ad1fa487afcb0977cbf6cda86812a218
|
|
| MD5 |
f7558fe9aba0370b73c701a003711d70
|
|
| BLAKE2b-256 |
7308f27b7ed270ccf912ba21cf573f767b68b7c1707f2f4e2f70270a526ecf66
|
File details
Details for the file xml_generator_seobaeksol-0.0.1-py3-none-any.whl.
File metadata
- Download URL: xml_generator_seobaeksol-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bef95e3802c5250e578e2504d4a65e48e7f52902c0888b046f7b09731acad3e5
|
|
| MD5 |
0780f4e11e198064c679cf807a05691f
|
|
| BLAKE2b-256 |
a7d48b414f31320dd5dd33bcc6ea11fcf411c55cf8e67be756c413601143eaf7
|