Metadata-Version: 2.4
Name: python-icecat
Version: 0.1.0
Summary: Python port of the GreenCore/icecat client.
Project-URL: Homepage, https://github.com/BuyIT-Comp/python-icecat
Project-URL: Repository, https://github.com/BuyIT-Comp/python-icecat
Project-URL: Issues, https://github.com/BuyIT-Comp/python-icecat/issues
Author: BuyIT-Comp
License-Expression: MIT
License-File: LICENSE
Keywords: ean,ecommerce,gtin,icecat,product-data,upc
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: requests>=2.33.1
Provides-Extra: dev
Requires-Dist: build>=1.2.2; extra == 'dev'
Requires-Dist: twine>=6.1.0; extra == 'dev'
Description-Content-Type: text/markdown

﻿# python-icecat

Icecat client for Python.

## Features

- `Icecat(username, password, http_url=...)`
- `client.openCatalog.getProduct(lang, gtin)`
- `client.openCatalog.getProductById(lang, product_id)`
- `client.openCatalog.getProductBySKU(lang, brand, sku)`
- `client.openCatalog.getProductByXMLdata(xml_data)`
- `IcecatProduct` convenience methods (`getTitle`, `getImages`, `getSpecifications`, etc.)

## Install

```bash
pip install python-icecat
```

## Quick start

```python
from icecat import Icecat

client = Icecat("your_username", "your_password")
product = client.openCatalog.getProduct("EN", "4948570114344")

print(product.getTitle())
images = product.getImages()
if images:
    print(images[0].ThumbImg)
```

## CLI usage (`main.py`)

Use credentials from args or environment:

```bash
export ICECAT_USERNAME="your_username"
export ICECAT_PASSWORD="your_password"
```

Fetch by GTIN:

```bash
python main.py --lang EN --output summary gtin 4948570114344
```

Fetch by Icecat product ID:

```bash
python main.py --lang EN --output json id 29900045
```

Fetch by vendor + SKU:

```bash
python main.py --lang EN sku iiyama X4071UHSU-B1
```

Parse local XML file (no credentials required):

```bash
python main.py --output json xml ./product.xml
```

## Public API

### Icecat

- `Icecat(username, password, http_url="data.icecat.biz/xml_s3/xml_server3.cgi")`
- Field: `openCatalog` (`OpenCatalogService`)

### OpenCatalogService

- `getProduct(lang, gtin) -> IcecatProduct`
- `getProductById(lang, product_id) -> IcecatProduct`
- `getProductBySKU(lang, brand, sku) -> IcecatProduct`
- `getProductByXMLdata(xml_data) -> IcecatProduct`

### IcecatProduct

- `getReturnCode() -> int | None`
- `getErrorMessage() -> str | None`
- `getName() -> str | None`
- `getTitle() -> str | None`
- `getReleaseDate() -> str | None`
- `getLongDescription() -> str | None`
- `getShortDescription() -> str | None`
- `getProductInfoPDFurl() -> str | None`
- `getProductManualPDFurl() -> str | None`
- `getProductUrl() -> str | None`
- `getSupplier() -> str | None`
- `getCategory() -> str | None`
- `getFamily() -> ProductFamily | None`
- `getID() -> str | None`
- `getEan() -> str | None`
- `getImages() -> list[ProductImage]`
- `getSpecifications() -> list[ProductSpecification]`
- `getMultimediaObjects() -> list[MultimediaObject]`
- `getCategoryFeatureGroups() -> list[CategoryFeatureGroup]`

### IcecatProduct types

- `ProductFamily(id: str | None, name: str | None)`
- `ProductImage(IsMain, HighImg, LowImg, ThumbImg)`
- `ProductSpecification(name, presentationValue, value, specId, specGroupId)` (all fields can be `None`)
- `MultimediaObject(contentType, thumbPic, description, keepAsURL, size, url)`
- `CategoryFeatureGroup(id: str | None, name: str | None)`
