pardata.schema.SchemaCollection

class pardata.schema.SchemaCollection(url_or_path, *, tls_verification=True)

Bases: abc.ABC

Abstract class that provides functionality to load and export a schema collection.

Parameters
  • url_or_path (Union[str, os.PathLike]) – URL or path to a schema file.

  • tls_verification (Union[bool, str, os.PathLike]) – When set to True, verify the remote link is https and whether the TLS certificate is valid. When set to a path to a file, use this file as a CA bundle file. When set to False, allow http links and do not verify any TLS certificates. Ignored if url_or_path is a local path.

Raises
  • ValueError – An error occurred when parsing url_or_path as either a URL or path.

  • InsecureConnectionError – The connection is insecure. See tls_verification for more details.

Return type

None

Methods

export_schema(*keys)

Returns a copy of a loaded schema collection.

Attributes

retrieved_url_or_path

The URL or path from which the schema was retrieved.