Skip to main content

Python XML Binding

Project description

https://github.com/tefra/xsdata/raw/master/docs/_static/logo.png

Naive XML Bindings for python

https://travis-ci.com/tefra/xsdata.svg?branch=master https://readthedocs.org/projects/xsdata/badge https://codecov.io/gh/tefra/xsdata/branch/master/graph/badge.svg https://img.shields.io/github/languages/top/tefra/xsdata.svg https://www.codefactor.io/repository/github/tefra/xsdata/badge https://img.shields.io/pypi/pyversions/xsdata.svg https://img.shields.io/pypi/v/xsdata.svg

xsData is a complete XML data binding library for python allowing developers to access and use XML documents as simple objects rather than using DOM.

xsData comes with a code generator that can convert XML Schema 1.0 and 1.1 definitions to simple dataclasses with type hints and as minimum footprint as possible. The generated packages have no dependency on the library itself. So simple that you can write the models on your own if you happen to use an XML document with no schema available.

The XML Parser is highly optimized and uses lxml iterparse to bind the document data to the target models. The parser accepts a configuration instance with various options like fail on unknown properties and is also thread safe which means you can take advantage of the internal model inspection caching context for even faster parsing.

The parser and serializer are constantly tested against the W3C XML Schema 1.1 test suite and passes more than 99% of the valid instance cases.

https://github.com/tefra/xsdata/raw/master/docs/_static/demo.svg

Check the documentation demos or our W3C XML Schema 1.1 test runner and the samples repo for more ✨✨✨

Features

  • Generate data models from XML Schema 1.0 and 1.1 definitions.

  • Supports qualified elements/attributes.

  • Supports enumerations and inner classes.

  • Flattening strategies to keep the code as simple as possible.

  • Preserve embedded documentation and references

  • Pluggable code writer that supports different formats

  • Output: Python Data Classes

  • Output: PlantUML class diagram

Changelog: 20.5.1 (2020-05-14)

  • Added support to fetch remote schemas.

  • Updated duplicate attribute names handling.

  • Updated code generation for enum type fields and default values.

  • Fixed issue not generating classes derived from simple types.

  • Fixed analyzer reaching the maximum recursion depth.

  • Fixed analyzer to flatten properly inner self referencing classes.

  • Moved dataclasses python conventions to jinja filters.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xsdata-20.5.1.tar.gz (161.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xsdata-20.5.1-py3-none-any.whl (62.9 kB view details)

Uploaded Python 3

File details

Details for the file xsdata-20.5.1.tar.gz.

File metadata

  • Download URL: xsdata-20.5.1.tar.gz
  • Upload date:
  • Size: 161.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.4

File hashes

Hashes for xsdata-20.5.1.tar.gz
Algorithm Hash digest
SHA256 882e95ca5d901598594f20bc728a2e5a21091b1cd2bd67a26d27766bc34ac680
MD5 fd9d3e4176a8293b72dd9fd690345a56
BLAKE2b-256 fdb1ae91ba82792b9ef0208aa1b51c2308ab67d685a1c08b8b235b34aa4730cf

See more details on using hashes here.

File details

Details for the file xsdata-20.5.1-py3-none-any.whl.

File metadata

  • Download URL: xsdata-20.5.1-py3-none-any.whl
  • Upload date:
  • Size: 62.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.4

File hashes

Hashes for xsdata-20.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ed2986762e9c0aca9da2c100720273d330eee710adabb4badd76f4b013cdbb76
MD5 88273a9fb74e0bb40c50165d02e94359
BLAKE2b-256 2cc16ba4db8c8c2ae0e2b28b4eca4ab246c8da6caf298b80229ced1394b778e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page