Skip to main content

Python client for Google Shopping API

Project description

Package Version

Python client for Google Content API for Shopping v2.1

Installation

pip install py-google-shopping

Features

  • Handles OAuth2 sanely through ENV variables

  • Handles pagination with iterators

  • Pads and adds checksum to GTIN of products automatically

  • Works well with Django and other frameworks

Usage

Basic

export GOOGLE_SHOPPING_CLIENT_ID=my_client_id
export GOOGLE_SHOPPING_CLIENT_SECRET=my_client_secret
export GOOGLE_SHOPPING_REFRESH_TOKEN=my_refresh_token
from google_shopping import Merchant
merchant_id = '536476575676'
merchant = Merchant(merchant_id, country_code='UK')

# Get product resource
product_resource = merchant.products.get(1234)

# Get all products
products = list(merchant.products.list())

# Iterate through products (generator)
for product in merchant.products.list():
    print product.title

# Delete product resource
product = Product.objects.order_by('?').first()
merchant.products.delete(product.id)

License

License stuff is here.

Support

This version is a backport of the previous version by Nam Ngo. We’ll continue to support it! 😉

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

py-google-shopping-0.2.2.tar.gz (6.6 kB view hashes)

Uploaded Source

Built Distribution

py_google_shopping-0.2.2-py3-none-any.whl (8.1 kB view hashes)

Uploaded Python 3

Supported by

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