avro.Instance

An avro.Instance object represents a AVRO document.

class avro.Instance

Proper instances of this class will be created within RaptorXML only, instantiation from script code will throw a NotImplementedError exception.

Class methods

classmethod avro.Instance.create_from_json_url(type cls, url, Schema schema, *, catalog=None, **kargs)

Returns a tuple with a avro.Instance and xml.ErrorLog object. Constructs a new avro.Instance object after parsing the AVRO content from the given url according to the AVRO schema 1.8.1 specification. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_jsonavro_valavroschema.html for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod avro.Instance.create_from_url(type cls, url, *, catalog=None, **kargs)

Returns a tuple with a avro.Instance and xml.ErrorLog object. Constructs a new avro.Instance object after parsing the AVRO content from the given url according to the AVRO schema 1.8.1 specification. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_jsonavro_valavroschema.html for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod avro.Instance.validate_buffer(type cls, buf, *, Schema schema=None, catalog=None, **kargs)

Validates the buffer buf containing a AVRO documents to the AVRO 1.8.1 specification and returns xml.ErrorLog object with the results. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_jsonavro_valavro.html for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod avro.Instance.validate_json_buffer(type cls, buf, Schema schema, *, catalog=None, **kargs)

Validates the buffer buf containing a AVRO documents to the AVRO 1.8.1 specification and returns xml.ErrorLog object with the results. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_jsonavro_valavro.html for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod avro.Instance.validate_json_url(type cls, url, Schema schema, *, catalog=None, **kargs)

Validates the AVRO binary document at the given url to the AVRO 1.8.1 specification and returns xml.ErrorLog object with the results. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_jsonavro_valavro.html for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod avro.Instance.validate_url(type cls, url, *, Schema schema=None, catalog=None, **kargs)

Validates the AVRO binary document at the given url to the AVRO 1.8.1 specification and returns xml.ErrorLog object with the results. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_jsonavro_valavro.html for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

Attributes

avro.Instance.schema

Returns the schema object used to validate this instance.

avro.Instance.uri

Returns the URI of the document (after any catalog mappings) that was used to actually open the document and read its content.

Methods

avro.Instance.save(url, *, codec='null', catalog=None, **kwargs)

Saves the instance as a binary file with the given codec (default: ‘null’) to the provided url.

avro.Instance.save_as_json(url, *, catalog=None, **kwargs)

Saves the instance as a binary file with the given codec (default: None) to the provided url.

Special methods

__bool__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__