Models API

The models module provides data models for the 1WorldSync Content1 API responses.

Content1Product

class oneworldsync.models.Content1Product(data)[source]

Bases: object

Model representing a product from the 1WorldSync Content1 API

__init__(data)[source]

Initialize a product from API data

Parameters:

data (dict) – Product data from the API

property information_provider_gln: str

Get the information provider GLN

property target_market: str

Get the target market

property last_modified_date: str

Get the last modified date

property brand_name: str

Get the brand name

property gpc_category: str

Get the GPC category

to_dict()[source]

Convert the product to a dictionary with all extracted data

Returns:

Dictionary representation of the product

Return type:

dict

__str__()[source]

String representation of the product

Content1ProductResults

class oneworldsync.models.Content1ProductResults(data)[source]

Bases: object

Model representing product results from the 1WorldSync Content1 API

__init__(data)[source]

Initialize product results from API data

Parameters:

data (dict) – Product results data from the API

__len__()[source]

Get the number of products in the results

__iter__()[source]

Iterate through products

__getitem__(index)[source]

Get a product by index

to_dict()[source]

Convert the product results to a dictionary

Returns:

Dictionary representation of the product results

Return type:

dict

Content1Hierarchy

class oneworldsync.models.Content1Hierarchy(data)[source]

Bases: object

Model representing a product hierarchy from the 1WorldSync Content1 API

__init__(data)[source]

Initialize a hierarchy from API data

Parameters:

data (dict) – Hierarchy data from the API

to_dict()[source]

Convert the hierarchy to a dictionary

Returns:

Dictionary representation of the hierarchy

Return type:

dict

__str__()[source]

String representation of the hierarchy

Content1HierarchyResults

class oneworldsync.models.Content1HierarchyResults(data)[source]

Bases: object

Model representing hierarchy results from the 1WorldSync Content1 API

__init__(data)[source]

Initialize hierarchy results from API data

Parameters:

data (dict) – Hierarchy results data from the API

__len__()[source]

Get the number of hierarchies in the results

__iter__()[source]

Iterate through hierarchies

__getitem__(index)[source]

Get a hierarchy by index

to_dict()[source]

Convert the hierarchy results to a dictionary

Returns:

Dictionary representation of the hierarchy results

Return type:

dict