summaryrefslogtreecommitdiff
path: root/doc/overview_what.txt
blob: 58462386a7f58f6c5b6593b005b9168ed1a8de88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
What Is PyXB?
=============

PyXB is a pure `Python <http://www.python.org>`_ package that generates
Python code for classes that correspond to data structures defined by
`XMLSchema <http://www.w3.org/XML/Schema>`_.  In concept it is similar to
`JAXB <http://en.wikipedia.org/wiki/JAXB>`_ for Java and `CodeSynthesis XSD
<http://www.codesynthesis.com/products/xsd/>`_ for C++.

The major goals of PyXB are:

* Provide a generated Python interface that is "Pythonic", meaning similar
  to one that would have been hand-written:

  + Attributes and elements are Python fields (currently accessed through
    inspector/mutator methods), with name conflicts resolved in favor of
    elements
  + Elements with maxOccurs larger than 1 are stored as Python lists
  + Bindings for type extensions inherit from the binding for the base type
  + Enumeration constraints are exposed as class (constant) variables

* Support bi-directional conversion (DOM to Python and back)

* Allow easy customization of the generated bindings to provide
  functionality along with content

* Support all XMLSchema features that are in common use, including:

  + complex content models (nested all/choice/sequence)
  + cross-namespace dependencies
  + include and import directives
  + constraints on simple types

Secondary goals, some of which have been achieved in the current release, are
listed in :ref:`pyxb_vision`.

Examples of Processable Schema
------------------------------

PyXB can parse the following namespaces and create bindings for them (though
not all have been rigorously tested).  For examples of how to use PyXB with
schemas like these, see :ref:`examples`.

* The `National Digital Forecast Database <http://www.nws.noaa.gov/ndfd/>`_

::

  http://www.weather.gov/forecasts/xml/DWMLgen/schema/DWML.xsd

* `SOAP infrastructure <http://www.w3.org/TR/soap/>`_

::

  http://schemas.xmlsoap.org/soap/envelope/
  http://schemas.xmlsoap.org/soap/encoding/
  http://schemas.xmlsoap.org/wsdl/soap12/

* `Web Services Description Language <http://www.w3.org/TR/wsdl>`_

::

  http://schemas.xmlsoap.org/wsdl/
  http://schemas.xmlsoap.org/wsdl/mime/
  http://schemas.xmlsoap.org/wsdl/soap/
  http://schemas.xmlsoap.org/wsdl/http/

* `Keyhole Markup Language <http://code.google.com/apis/kml/>`_ (v 2.1)

::

  http://code.google.com/apis/kml/schema/kml21.xsd

* Others (parsed only, no testing)

::

  http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd
  http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/xenc-schema.xsd
  http://docs.oasis-open.org/security/saml/v2.0/saml-schema-assertion-2.0.xsd
  http://docs.oasis-open.org/security/saml/v2.0/saml-schema-protocol-2.0.xsd