Skip to content

BuyIT-Comp/python-icecat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

pip install python-icecat

Quick start

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:

export ICECAT_USERNAME="your_username"
export ICECAT_PASSWORD="your_password"

Fetch by GTIN:

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

Fetch by Icecat product ID:

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

Fetch by vendor + SKU:

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

Parse local XML file (no credentials required):

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)

About

Python port of the GreenCore/icecat client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages