Skip to main content

Python port of the GreenCore/icecat client.

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_icecat-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_icecat-0.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file python_icecat-0.1.0.tar.gz.

File metadata

  • Download URL: python_icecat-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.1

File hashes

Hashes for python_icecat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3b383c90be6df2e0ed44d4c15a0b5667514173d8148df614fdcf1f052fc6f64f
MD5 cfc38aa36fae5375eeb1a53712a2c0d5
BLAKE2b-256 2ee0f99eddcf66ca5c9a35a070cd64c0d340fca183d961f43b945766cc60548c

See more details on using hashes here.

File details

Details for the file python_icecat-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_icecat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4805d5ec405047eceebf8c621dbd2f06a0ad644dec0f1e393471b744028fb5d5
MD5 9195fcbe507873f33be0ea54cd92fef7
BLAKE2b-256 8ec783b8cb28ed2b34ef69da41fcc35228c9a0680fdb0698b9dc928a6d59d2d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page