singer_sdk.schema.source.SchemaSource

class singer_sdk.schema.source.SchemaSource[source]

Abstract base class for schema sources.

__init__()[source]

Initialize the schema source with caching.

Return type:

None

abstractmethod fetch_schema(key)[source]

Retrieve a JSON schema from this source.

Parameters:

key (_TKey) – The schema component name to retrieve.

Returns:

A JSON schema dictionary.

Raises:
Return type:

dict[str, Any]

final get_schema(key, /, *, key_properties=())[source]

Convenience method to get a schema component.

Parameters:
  • key (_TKey) – The schema component name to retrieve.

  • key_properties (Sequence[str]) – The stream’s key properties.

Returns:

A JSON schema dictionary.

Raises:
  • SchemaNotFoundError – If the schema is not found or cannot be fetched.

  • SchemaNotValidError – If the schema is not a JSON object.

Return type:

Schema

final preprocess_schema(schema, *, key_properties=())[source]

Pre-process the schema before providing it to the stream.

Parameters:
  • schema (Schema) – A JSON schema.

  • key_properties (Sequence[str]) – The stream’s key properties.

Returns:

The pre-processed schema.

Return type:

Schema