Skip to main content

Wrapper for the bol.com API

Project description

https://app.travis-ci.com/dreambits/python-bol-api.svg?branch=master https://badge.fury.io/py/python-bol-api-latest.svg https://static.pepy.tech/personalized-badge/python-bol-api-latest?period=total&units=international_system&left_color=brightgreen&right_color=black&left_text=Downloads

A Python wrapper for the bol.com API forked from https://github.com/pennersr/python-bol-api This is currently under development but stable to be used. We are adding more and more features as the api has changed a lot from the time this version was created in original project

A Python wrapper for the bol.com API. Currently rather incomplete, as it offers only those methods required for my own projects so far.

Open API

Instantiate the API:

>>> from bol.openapi.api import OpenAPI
>>> api = OpenAPI('api_key')

Invoke a method:

>>> data = api.catalog.products((['1004004011187773', '1004004011231766'])

JSON data is returned “as is”:

>>> data['products'][0]['ean']
u'0093155141650'

Retailer API

Supports the BOL Api v7, documented here: https://api.bol.com/retailer/public/Retailer-API/selling-on-bolcom-processflow.html

Instantiate the API:

>>> from bol.retailer.api import RetailerAPI
>>> api = RetailerAPI()

Authenticate:

>>> api.login('client_id', 'client_secret')

Invoke a method:

>>> orders = api.orders.list()
>>> order = api.orders.get(orders[0].orderId))

Fields are derived 1:1 from the bol.com API, including lower-CamelCase conventions:

>>> order.customerDetails.shipmentDetails.streetName
'Billingstraat'

Fields are properly typed:

>>> repr(order.orderPlacedDateTime)
datetime.datetime(2020, 2, 12, 16, 6, 17, tzinfo=tzoffset(None, 3600))
>>> repr(order.orderItems[0].offerPrice)
Decimal('106.52')

Access the underlying raw (unparsed) data at any time:

>>> order.raw_data
>>> order.raw_content

Running the tests

First, make sure that you have tox installed on your system:

pip install tox

Then, just run the tox:

tox

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-bol-api-latest-1.2.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

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

python_bol_api_latest-1.2.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file python-bol-api-latest-1.2.0.tar.gz.

File metadata

  • Download URL: python-bol-api-latest-1.2.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for python-bol-api-latest-1.2.0.tar.gz
Algorithm Hash digest
SHA256 585e7bee831bbf13dc7a50b7c754dc30d606417b445d86b1344a12654f9a5c1c
MD5 11d910bb2ad7f2b63e0cbcc2cc8063a8
BLAKE2b-256 a8a2b00ca9cab894695711147c59915b01da0cc5083ea30a9ff71f0b39a7badb

See more details on using hashes here.

File details

Details for the file python_bol_api_latest-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_bol_api_latest-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42d24dadee3144bae1507c0eed115689025f5aedae4c678c1461e95754a18a0c
MD5 d9bab06afc4b90b4300903157b9f836d
BLAKE2b-256 1a55236dfe84e3de894d749544be922d5d43ad3f1a8591369470d6731ada0774

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