Skip to main content

lxml-element-maker

Requirements

  • python 3.4

  • lxml 3.4.4

Install

pip install lxml-element-maker

Usage

Transforms a python structure to an xml element with lxml :

from element_maker.utils import XMLElement

structure = {'ArchiveTransferRequest':
                      [
                          [
                              {'Comment': [
                                  ['baz'], {"foo": "bar"}
                              ]
                              },
                              {'Date': [
                                  ["2014-05-12T00:00:00Z"]
                              ]
                              }
                          ],
                          {"cars": "pizza"}
                      ]
                      }
namespace = "fr:gouv:culture:archivesdefrance:seda:v1.0"
xml_element = XMLElement(namespace=self.namespace, **self.structure)()
# Test the element with an xsd schema
result = xml_element.pass_xsd("./tests/data/test.xsd")
# Or test the element with an rng schema
result2 = xml_element.pass_rng("./tests/data/test.rng")

The result is an xml :

<ArchiveTransferRequest xmlns="fr:gouv:culture:archivesdefrance:seda:v1.0" cars="pizza">
    <Comment foo="bar">baz</Comment>
    <Date>2014-05-12T00:00:00Z</Date>
</ArchiveTransferRequest>

Authors

Metadata

Release files for lxml-element-maker 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for lxml-element-maker 1.0.1
File Interpreter ABI Platform Actions
lxml_element_maker-1.0.1-py3-none-any.whl Python 3 none any Details for lxml_element_maker-1.0.1-py3-none-any.whl

Release files / lxml_element_maker-1.0.1-py3-none-any.whl

Download URL lxml_element_maker-1.0.1-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5343c2a0373ceab19c5d544f884fedf510705a53d66578c2ad07c0b629fcef4
BLAKE2b-256 checksum
How to use checksums
62d91a26789da94e06a9587554ea646bfd8f14e921ee57061129e27173cdbb95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for lxml-element-maker 1.0.1

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.

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page