Package pyxb :: Package binding :: Module datatypes
[hide private]
[frames] | no frames]

Module datatypes

source code

Classes supporting XMLSchema Part 2: Datatypes.

Each simple type definition component instance is paired with at most one basis.simpleTypeDefinition class, which is a subclass of a Python type augmented with facets and other constraining information. This file contains the definitions of these types.

We want the simple datatypes to be efficient Python values, but to also hold specific constraints that don't apply to the Python types. To do this, we subclass each PST. Primitive PSTs inherit from the Python type that represents them, and from a pyxb.binding.basis.simpleTypeDefinition class which adds in the constraint infrastructure. Derived PSTs inherit from the parent PST.

There is an exception to this when the Python type best suited for a derived SimpleTypeDefinition differs from the type associated with its parent STD: for example, xsd:integer has a value range that requires it be represented by a Python long, but xsd:int allows representation by a Python int. In this case, the derived PST class is structured like a primitive type, but the PST associated with the STD superclass is recorded in a class variable _XsdBaseType.

Note the strict terminology: "datatype" refers to a class which is a subclass of a Python type, while "type definition" refers to an instance of either SimpleTypeDefinition or ComplexTypeDefinition.

Classes [hide private]
  anySimpleType
XMLSchema datatype anySimpleType.
  string
XMLSchema datatype string.
  boolean
XMLSchema datatype boolean.
  decimal
XMLSchema datatype decimal.
  float
XMLSchema datatype float.
  double
XMLSchema datatype double.
  duration
XMLSchema datatype duration.
  _PyXBDateTime_base
  dateTime
XMLSchema datatype dateTime.
  time
XMLSchema datatype time.
  _PyXBDateOnly_base
  date
XMLSchema datatype date.
  gYearMonth
XMLSchema datatype gYearMonth.
  gYear
XMLSchema datatype gYear.
  gMonthDay
XMLSchema datatype gMonthDay.
  gDay
XMLSchema datatype gDay.
  gMonth
XMLSchema datatype gMonth.
  hexBinary
XMLSchema datatype hexBinary.
  base64Binary
XMLSchema datatype base64Binary.
  anyURI
XMLSchema datatype anyURI.
  QName
XMLSchema datatype QName.
  NOTATION
XMLSchema datatype NOTATION.
  normalizedString
XMLSchema datatype normalizedString.
  token
XMLSchema datatype token.
  language
XMLSchema datatype language
  NMTOKEN
XMLSchema datatype NMTOKEN.
  NMTOKENS
  Name
XMLSchema datatype Name.
  NCName
XMLSchema datatype NCName.
  ID
XMLSchema datatype ID.
  IDREF
XMLSchema datatype IDREF.
  IDREFS
XMLSchema datatype IDREFS.
  ENTITY
XMLSchema datatype ENTITY.
  ENTITIES
XMLSchema datatype ENTITIES.
  integer
XMLSchema datatype integer.
  nonPositiveInteger
XMLSchema datatype nonPositiveInteger.
  negativeInteger
XMLSchema datatype negativeInteger.
  long
XMLSchema datatype long.
  int
XMLSchema datatype int.
  short
XMLSchema datatype short.
  byte
XMLSchema datatype byte.
  nonNegativeInteger
XMLSchema datatype nonNegativeInteger.
  unsignedLong
XMLSchema datatype unsignedLong.
  unsignedInt
XMLSchema datatype unsignedInt.
  unsignedShort
XMLSchema datatype unsignedShort.
  unsignedByte
XMLSchema datatype unsignedByte.
  positiveInteger
XMLSchema datatype positiveInteger.
  anyType
XMLSchema datatype anyType.
Functions [hide private]
 
_BuildAutomaton() source code
Variables [hide private]
  _log = logging.getLogger(__name__)
  _PrimitiveDatatypes = [<class 'pyxb.binding.datatypes.string'>...
  _DerivedDatatypes = [<class 'pyxb.binding.datatypes.normalized...
  _ListDatatypes = [<class 'pyxb.binding.datatypes.NMTOKENS'>, <...
  __package__ = 'pyxb.binding'
Variables Details [hide private]

_PrimitiveDatatypes

Value:
[<class 'pyxb.binding.datatypes.string'>,
 <class 'pyxb.binding.datatypes.boolean'>,
 <class 'pyxb.binding.datatypes.decimal'>,
 <class 'pyxb.binding.datatypes.float'>,
 <class 'pyxb.binding.datatypes.double'>,
 <class 'pyxb.binding.datatypes.duration'>,
 <class 'pyxb.binding.datatypes.dateTime'>,
 <class 'pyxb.binding.datatypes.time'>,
...

_DerivedDatatypes

Value:
[<class 'pyxb.binding.datatypes.normalizedString'>,
 <class 'pyxb.binding.datatypes.token'>,
 <class 'pyxb.binding.datatypes.language'>,
 <class 'pyxb.binding.datatypes.NMTOKEN'>,
 <class 'pyxb.binding.datatypes.Name'>,
 <class 'pyxb.binding.datatypes.NCName'>,
 <class 'pyxb.binding.datatypes.ID'>,
 <class 'pyxb.binding.datatypes.IDREF'>,
...

_ListDatatypes

Value:
[<class 'pyxb.binding.datatypes.NMTOKENS'>,
 <class 'pyxb.binding.datatypes.IDREFS'>,
 <class 'pyxb.binding.datatypes.ENTITIES'>]