# schema_salad.validate

## Attributes

`INT_MIN_VALUE` |
`INT_MAX_VALUE` |
`LONG_MIN_VALUE` |
`LONG_MAX_VALUE` |
`saladp` |
`primitives` |

## 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.

## Module Contents

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

    - expected_schema (schema_salad.avro.schema.Schema)

    - datum (Any)

    - identifiers (list[str] | None)

    - strict (bool)

    - foreign_properties (set[str] | None)

    - vocab (collections.abc.Mapping[str, str] | None)

  Return type:

    bool

schema_salad.validate.INT_MIN_VALUE: Final = -2147483648

schema_salad.validate.INT_MAX_VALUE: Final = 2147483647

schema_salad.validate.LONG_MIN_VALUE: Final = -9223372036854775808

schema_salad.validate.LONG_MAX_VALUE: Final = 9223372036854775807

schema_salad.validate.avro_shortname(name)

  Produce an avro friendly short name.

  Parameters:

    name (str)

  Return type:

    str

schema_salad.validate.saladp: Final = 'https://w3id.org/cwl/salad#'

schema_salad.validate.primitives: Final

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:

    - expected_schema (schema_salad.avro.schema.Schema)

    - datum (Any)

    - identifiers (list[str] | None)

    - strict (bool)

    - foreign_properties (set[str] | None)

    - raise_ex (bool)

    - strict_foreign_properties (bool)

    - logger (logging.Logger)

    - skip_foreign_properties (bool)

    - vocab (collections.abc.Mapping[str, str] | None)

  Return type:

    bool