schema_salad.validate

Module Contents

Functions

validate(expected_schema, datum[, identifiers, ...])

avro_shortname(name)

Produce an avro friendly short name.

avro_type_name(url)

Turn a URL into an Avro-safe name.

friendly(v)

Format an Avro schema into a pretty-printed representation.

vpformat(datum)

Truncate a pretty-printed representation of a Python object to 160 characters.

validate_ex(expected_schema, datum[, identifiers, ...])

Determine if a python datum is an instance of a schema.

Attributes

INT_MIN_VALUE

INT_MAX_VALUE

LONG_MIN_VALUE

LONG_MAX_VALUE

saladp

primitives

schema_salad.validate.validate(expected_schema, datum, identifiers=None, strict=False, foreign_properties=None, vocab=None)
Parameters:
Return type:

bool

schema_salad.validate.INT_MIN_VALUE
schema_salad.validate.INT_MAX_VALUE
schema_salad.validate.LONG_MIN_VALUE
schema_salad.validate.LONG_MAX_VALUE
schema_salad.validate.avro_shortname(name)

Produce an avro friendly short name.

Parameters:

name (str) –

Return type:

str

schema_salad.validate.saladp = 'https://w3id.org/cwl/salad#'
schema_salad.validate.primitives
schema_salad.validate.avro_type_name(url)

Turn a URL into an Avro-safe name.

If the URL has no fragment, return this plain URL.

Extract either the last part of the URL fragment past the slash, otherwise the whole fragment.

Parameters:

url (str) –

Return type:

str

schema_salad.validate.friendly(v)

Format an Avro schema into a pretty-printed representation.

Parameters:

v (Any) –

Return type:

Any

schema_salad.validate.vpformat(datum)

Truncate a pretty-printed representation of a Python object to 160 characters.

Parameters:

datum (Any) –

Return type:

str

schema_salad.validate.validate_ex(expected_schema, datum, identifiers=None, strict=False, foreign_properties=None, raise_ex=True, strict_foreign_properties=False, logger=_logger, skip_foreign_properties=False, vocab=None)

Determine if a python datum is an instance of a schema.

Parameters:
Return type:

bool