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.

It ships with a code generator for XML Schema definitions and WSDL 1.1 with SOAP 1.1 bindings. It produces simple dataclasses with type hints that don’t depend on the library itself in order to reduce the learning curve for users that have to write the binding models manually.

The included xml parser and serializer are highly optimized and adaptable with handlers based on native python and lxml. The parser configuration offers the ability to skip unknown properties and to process xinclude statements.

xsData is constantly tested against the W3C XML Schema 1.1 test suite.

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 for XML Schema 1.0 and 1.1 definitions.

  • Generate data models for WSDL 1.1 and SOAP 1.1 bindings.

  • Support qualified elements/attributes, enumerations and inner classes.

  • Preserve embedded documentation and references.

  • Data binding for XML and JSON documents.

  • Pluggable code writer that supports python dataclasses and PlantUML class diagrams.

Changelog: 20.10 (2020-10-02)

  • Fixed generator adding multiple default value fields. #249

  • Fixed generator not applying nested container restrictions. #263

  • Fixed generator to avoid case insensitive class name conflicts. #269

  • Fixed generator rendering unused simple types.

  • Fixed generator unsorted libraries imports.

  • Fixed JsonParser trying to parse init=False fields. #253

  • Fixed NodeParser binding tail content more than once with mixed vars. #256

  • Added XmlWriter interface to decouple serialize from lxml. #247

  • Added native python xml content writer XmlEventWriter. ✨✨✨

  • Added lxml based content writer: LxmlEventWriter.

  • Added generator config with options to control naming cases and aliases. #265

  • Updated field xml type auto detection to be more flexible. #246

  • Updated EnumConverter to resort to canonical form matching as last resort. #273

  • Updated support for derived elements. #267

This is my favorite release so far, maybe because xsdata reached one year of development ✨✨✨ or maybe because some of the last original components finally got the rewrite they deserved.

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.10.tar.gz (729.1 kB view hashes)

Uploaded Source

Built Distribution

xsdata-20.10-py3-none-any.whl (108.8 kB view hashes)

Uploaded Python 3

Supported by

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