Models API

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

Product

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

Bases: object

Model representing a product from the 1WorldSync API

__init__(data)[source]

Initialize a product from API data

Parameters:

data (dict) – Product data from the API

property item_id

Get the primary item ID

property brand_name

Get the brand name

property product_name

Get the product name

property description

Get the product description

property images

Get product images

property dimensions

Get product dimensions

__str__()[source]

String representation of the product

SearchResults

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

Bases: object

Model representing search results from the 1WorldSync API

__init__(data)[source]

Initialize search results from API data

Parameters:

data (dict) – Search 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