This is a Python package for the Trundler API.
Install from PyPI.
pip3 install trundlerpy
Install from GitHub.
pip3 install git+https://github.com/datawookie/trundlerpy
To run the test suite:
- Set the
TRUNDLER_KEY
environment variable. - Launch the tests with
pytest
To build the documentation:
make -C docs/ html
To access the full API you’ll need to first specify an API key. To obtain a key, please get in touch.
Storing your keys received from APIs and other sensitive information in a secure file or as an environment variable is considered best practice to avoid any potential malicious activity.
import os
key = os.getenv('TRUNDLER_KEY')
from trundlerpy import Trundler
tr = Trundler(key = key)
Use retailer()
to get a list of retailers.
tr.retailer()
You can access the details for a specific retailer.
tr.retailer(45)
Get a list of products for a specific retailer.
tr.retailer_products(5)
Products can be filtered by name, brand or SKU.
tr.retailer_products(5, product = "coffee", brand = "nespresso")
tr.retailer_products(5, sku="7630047615160")
A similar search can be applied across all retailers.
tr.products(product = "coffee")
tr.products(sku="7630047615160")
Get information on a specific product, filtering it by ID.
tr.product(530290)
Get price history data for a specific product.
tr.product_prices(530290)