ISO 8601 date time string parsing
Basic usage:
>>> import iso8601
>>> iso8601.parse_date('2007-01-25T12:00:00Z')
datetime.datetime(2007, 1, 25, 12, 0, tzinfo=<iso8601.iso8601.Utc ...>)
>>>
Regular expressions adapted from http://delete.me.uk/2005/03/iso8601.html
Parses ISO 8601 dates into datetime objects
The timezone is parsed from the date string. However it is quite common to have dates without a timezone (not strictly correct). In this case the default timezone specified in default_timezone is used. This is UTC by default.
Soapbox Configuration
SOAP protocol implementation, dispatchers and client stub.
Bases: object
Describes service aggregating informations required for dispatching and WSDL generation.
Bases: soapbox.xsd.ComplexType
SOAP Envelope Body.
Bases: soapbox.xsd.ComplexType
SOAP Envelope.
Bases: soapbox.xsd.ComplexType
SOAP Envelope Fault.
Bases: soapbox.xsd.ComplexType
SOAP Envelope Header.
Bases: soapbox.xsd.ComplexType
SOAP Envelope Body.
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType
SOAP Envelope.
Bases: soapbox.xsd.ComplexType
SOAP Envelope Fault.
Bases: soapbox.xsd.ComplexType
SOAP Envelope Header.
Bases: soapbox.xsd.String
Bases: soapbox.xsd.ComplexType
http://example.net/ws/endpoint –> ^ws/endpoint$
http://example.net/ws/endpoint –> %s/ws/endpoint
I have decided to not use dews/dexml approach to field description as it doesn’t give good distinction between element and attribute. It is not a problem when parsing a XML, but it is quite important for rendering and XSD generation. The new syntax will look like:
tail_number = xsd.Attribute(xsd.String) flight_number = xsd.Element(xsd.Integer)
which makes this distinction clear.
Render will take value/instance as parameter. More obvious would be if render just rendered current object, but this approach doesn’t work with Python simple types like string. Where you can not call ‘x’.render() so type method render must take a value as a parameter, which may same odd for complex types.
Due to render taking a value as parameter it could be implemented as a static/class method, but it is not. xsd.Element takes a class or an instance, but if class was passed it will create an instance - so a parameter-less constructor is required Reason for that is to keep API consistent. There are two syntaxes:
because instance if required in case (b) creating it from class in case (a) makes other methods independent from this two syntaxes.
For information on XML schema validation:
Bases: soapbox.xsd.Indicator
Bases: soapbox.xsd.Type
Bases: soapbox.xsd.String
Bases: soapbox.xsd.Element
Represents a field that is a XML attribute. e.g. <person name=”Jhon” surname=”Dough”>
<job>Programmer<job>
</person> name and surname are attributes. Attribute type can be only simple types.
Bases: soapbox.xsd.Group
Parent object for XSD Attribute Groups. Marker. Must be use with Ref.
Bases: soapbox.xsd.String
Bases: soapbox.xsd.SimpleType
Bases: soapbox.xsd.Short
Bases: soapbox.xsd.Indicator
Bases: soapbox.xsd.Element
Use this element when tagname should be based on class name in rendering time.
Bases: soapbox.xsd.Type
Parent for XML elements that have sub-elements.
Bases: soapbox.xsd.Type_PythonType
Python type for ComplexType, builds _meta object for every class that inherit from ComplexType.
Bases: soapbox.xsd.Ref
Direct access to element.text. Note that <> will be escaped.
Bases: soapbox.xsd.SimpleType
Example text value: 2001-10-26T21:32:52
Bases: soapbox.xsd.SimpleType
Bases: soapbox.xsd.ComplexType
Represents whole xml, is expected to have only one field the root.
Bases: soapbox.xsd.Decimal
Bases: soapbox.xsd.String
Bases: object
Basic building block, represents a XML element that can appear one or zero times in XML that should be rendered as subelement e.g. <aircraft><tail_number>LN-KKY</tail_number></aircraft> Tail number is element. For elements that can appear multiple times use ListElement.
Bases: object
Bases: soapbox.xsd.Decimal
Bases: soapbox.xsd.ComplexType
Parent object for XSD Groups. Marker. Must be use with Ref.
Bases: object
Bases: soapbox.xsd.Long
Bases: soapbox.xsd.Decimal
Bases: soapbox.xsd.SimpleType
Bases: soapbox.xsd.Element
Tag element that can appear many times in valid XML. e.g.
- <flight>
- <aircraft>G-ABCD</aircraft> <passenger>John Backus</passenger> <passenger>Kent Beck</passenger> <passenger>Larry Breed</passenger>
</flight>
passenger is an example of ListElement, the definition would look: passengers = xsd.ListElement(xsd.String, “passenger”) Note that tag name is required for this field, as the field name should be in plural form, and tag usually is not.
Bases: soapbox.xsd.Integer
Bases: object
Method description. The main information is mapping soapAction and operationName to function for dispatcher. input and output mapping informs how and which objects should be created on incoming/outgoing messages.
Bases: soapbox.xsd.String
Bases: soapbox.xsd.String
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.String
Bases: soapbox.xsd.Element
References are not fields, they point to type that has them - usually groups. With Ref fields will be rendered directly into parent object. e.g.
- class Person(xsd.Group):
- name = xsd.Element(xsd.String) surname = xsd.Element(xsd.String)
- class Job(xsd.ComplexType):
- title = xsd.Element(xsd.String) person = xsd.Ref(Person)
The valid XML will be:
- <job>
- <title>Programmer</title> <name>An</name> <surname>Brown</surname>
</job>
Note that name and surname are not wrapped with <person> tag.
Bases: object
Main object for XSD schema. This object is required for XSD and WSDLgeneration and correct namespaces as it propagates targetNamespace to all objects. Instance of this is expected to be named Schema.
Bases: soapbox.xsd.Indicator
Bases: soapbox.xsd.Int
Bases: soapbox.xsd.Type
Defines an interface for simple types.
Bases: soapbox.xsd.SimpleType
Bases: object
Allows tracking user defined class and their names, to be able to resolve string references e.g. a = xsd.Element(‘A’). Note that class names must be unique due to fact that search engine uses just class names.
Bases: soapbox.xsd.UnsignedShort
Bases: soapbox.xsd.Int
Bases: soapbox.xsd.Long
Bases: soapbox.xsd.Int
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType
Bases: soapbox.xsd.ComplexType