Skip to content

Contacts

counts(*, version=None, per_platform=False)

Retrieve the number of contacts assets in the metadata catalogue.

Parameters:

Name Type Description Default
version str | None

The version of the endpoint (default is None).

None
per_platform bool

Whether to list counts per platform (default is False).

False

Returns:

Type Description
int | dict[str, int]

The number contacts assets in the metadata catalogue.

int | dict[str, int]

If the parameter per_platform is True,

int | dict[str, int]

it returns a dictionary with platform names as keys

int | dict[str, int]

and the number of contacts assets from that platform as values.

delete(*, identifier, version=None)

Delete contacts from the catalogue.

Parameters (keywords required): version (str | None): The version of the endpoint (default is None).

get_asset(identifier, *, version=None, data_format='pandas')

Retrieve metadata for a specific contacts.

Parameters:

Name Type Description Default
identifier str

The identifier of the contacts to retrieve.

required
version str | None

The version of the endpoint (default is None).

None
data_format Literal['pandas', 'json']

The desired format for the response (default is "pandas"). For "json" formats, the returned type is a json decoded type, in this case a dict.

'pandas'

Returns:

Type Description
Series | dict

The retrieved metadata for the specified contacts.

get_asset_from_platform(*, platform, platform_identifier, version=None, data_format='pandas')

Retrieve metadata for a specific contacts identified by the external platform identifier.

Parameters:

Name Type Description Default
platform str

The platform where the contacts asset is retrieved from.

required
platform_identifier str

The identifier under which the contacts is known by the platform.

required
version str | None

The version of the endpoint (default is None).

None
data_format Literal['pandas', 'json']

The desired format for the response (default is "pandas"). For "json" formats, the returned type is a json decoded type, in this case a dict.

'pandas'

Returns:

Type Description
Series | dict

The retrieved metadata for the specified contacts.

get_assets_async(identifiers, *, version=None, data_format='pandas') async

Asynchronously retrieve metadata for a list of contacts identifiers.

Parameters:

Name Type Description Default
identifiers list[str]

The list of identifiers of the contacts to retrieve.

required
version str | None

The version of the endpoint (default is None).

None
data_format Literal['pandas', 'json']

The desired format for the response (default is "pandas"). For "json" formats, the returned type is a json decoded type, in this case a list of dicts.

'pandas'

Returns:

Type Description
DataFrame | list[dict]

The retrieved metadata for the specified contacts.

get_content(*, identifier, distribution_idx=0, version=None)

Retrieve the data content of a specific contacts.

Parameters:

Name Type Description Default
identifier str

The identifier of the contacts asset.

required
distribution_idx int

The index of a specific distribution from the distribution list (default is 0).

0
version str | None

The version of the endpoint (default is None).

None

Returns:

Type Description
bytes

The data content for the specified contacts.

get_list(*, platform=None, offset=0, limit=10, version=None, data_format='pandas')

Retrieve a list of contacts from the catalogue.

Parameters:

Name Type Description Default
platform str | None

Return metadata of contacts assets of this platform (default is None).

None
offset int

The offset for pagination (default is 0).

0
limit int

The maximum number of items to retrieve (default is 10).

10
version str | None

The version of the endpoint (default is None).

None
data_format Literal['pandas', 'json']

The desired format for the response (default is "pandas"). For "json" formats, the returned type is a json decoded type, i.e. in this case a list of dicts.

'pandas'

Returns:

Type Description
DataFrame | list[dict]

The retrieved metadata in the specified format.

get_list_async(*, offset=0, limit=100, batch_size=10, version=None, data_format='pandas') async

Asynchronously retrieve a list of contacts from the catalogue in batches.

Parameters:

Name Type Description Default
offset int

The offset for pagination (default is 0).

0
limit int

The maximum number of items to retrieve (default is 10).

100
batch_size int

The number of items in a a batch.

10
version str | None

The version of the endpoint (default is None).

None
data_format Literal['pandas', 'json']

The desired format for the response (default is "pandas"). For "json" formats, the returned type is a json decoded type, in this case a list of dicts.

'pandas'

Returns:

Type Description
DataFrame | list[dict]

The retrieved metadata in the specified format.

Raises:

Type Description
ValueError

Batch size must be larger than 0.

register(*, metadata, version=None)

Register contacts in catalogue.

Parameters (keywords required):

version (str | None): The version of the endpoint (default is None).
data_format (Literal["pandas", "json"]): The desired format for the response (default is "pandas").
    For "json" formats, the returned type is a json decoded type, i.e. in this case a list of dict's.

Returns:

Name Type Description
str str | Response

identifier, if the asset is registered successfully

str | Response

requests.Response: error response, if it failed to register successfully

update(*, identifier, metadata, version=None)

Delete contacts from the catalogue.

Parameters (keywords required):

version (str | None): The version of the endpoint (default is None).
data_format (Literal["pandas", "json"]): The desired format for the response (default is "pandas").
    For "json" formats, the returned type is a json decoded type, i.e. in this case a list of dict's.