Skip to content

Adapter#

lit.sdk.data.adapter #

This module loads data adapters using either a JSON configuration or a file path to a schema.

load_adapter(team, name, options=None) #

Loads an adapter by its JSON configuration

Parameters:

Name Type Description Default
team str

The team that the adapter belongs to.

required
name str

The name of the adapter.

required
options dict | None

An optional dictionary of adapter-specific options. Defaults to None.

None

Returns:

Type Description
BaseAdapter

The loaded adapter instance.

Examples:

>>> opts = {"paths": glob.glob("/data/contoso/raw/crude*.csv.gz")}
>>> load_adapter("contoso", "refinitiv", opts)
<refinitiv.Adapter object at 0x7f3ed7193850>

load_adapter_by_project(team, name) #

Loads an adapter by its project name.

Parameters:

Name Type Description Default
team str

The team that the adapter belongs to.

required
name str

The name of the project.

required

Returns:

Type Description
BaseAdapter

The loaded adapter instance.

Examples:

>>> adapter = load_adapter_by_project("contoso", "volatility")
<refinitiv.Adapter object at 0x7f3ed7193850>

load_adapter_by_schema(team, name) #

Loads an adapter by its schema file.

Parameters:

Name Type Description Default
team str

The team that the adapter belongs to.

required
name str

The name of the schema.

required

Returns:

Type Description
BaseAdapter

The loaded adapter instance.

Examples:

>>> adapter = load_adapter_by_schema("contoso", "crude")
<refinitiv.Adapter object at 0x7f3ed7193850>