Reference

ssb_tbmd_apis package

Subpackages

ssb_tbmd_apis.tbmd_logger module

class ColoredFormatter(*args, colors=None, **kwargs)

Bases: Formatter

Colored log formatter.

Parameters:
  • args (Any)

  • colors (dict[str, str] | None)

  • kwargs (Any)

format(record)

Format the specified record as text.

Return type:

str

Parameters:

record (LogRecord)

ssb_tbmd_apis.zeep_client module

class LocalResolverTransport(cache=None, timeout=300, operation_timeout=None, session=None)

Bases: Transport

Custom transport class to load local XSD files for Zeep client.

load(url)

Load XSD files from local directory instead of fetching them from the internet.

Parameters:

url (str) – The URL of the XSD file to load.

Returns:

The content of the XSD file.

Return type:

bytes

class ZeepClientManager(wsdl)

Bases: object

Context manager for Zeep client to handle WSDL and session management.

Parameters:

wsdl (str)

class ZeepLikeClient(*args, **kwargs)

Bases: Protocol

A minimal protocol for the Zeep SOAP client.

This protocol is used to provide static type checking for code that interacts with a Zeep client without requiring full type information from the zeep library (which does not ship stubs). It only defines the subset of the client interface that is commonly used in this project.

property service: Any

Service proxy for SOAP operations.

The service property provides access to the operations defined in the WSDL. Each operation is exposed as a callable attribute on this object, which can be invoked like a normal Python function.

get_zeep_client(tbmd_service='datadok')

Get a Zeep client for the specified TBMD service.

Parameters:

tbmd_service (str) – The TBMD service to use (default is “datadok”).

Returns:

A context manager for the Zeep client.

Return type:

ZeepClientManager

Raises:

NotImplementedError – If the specified TBMD service is not implemented.

get_zeep_serialize(tbmd_service='datadok', operation='GetFileDescriptionByPath', *args)

Get serialized response from the Zeep client for the specified operation.

Parameters:
  • tbmd_service (str) – The TBMD service to use (default is “datadok”).

  • operation (str) – The operation to perform (default is “GetFileDescriptionByPath”).

  • *args (str | int) – Arguments for the operation.

Returns:

The serialized response from the Zeep client.

Return type:

OrderedDict

get_zeep_serialize_list(tbmd_service='metadb', operation='GetCodelists', *args)

Get serialized response from the Zeep client for the specified operation that returns a list.

Parameters:
  • tbmd_service (str) – The TBMD service to use (default is “datadok”).

  • operation (str) – The operation to perform (default is “GetFileDescriptionByPath”).

  • *args (str | int) – Arguments for the operation.

Returns:

The serialized response from the Zeep client.

Return type:

list[OrderedDict]