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 v10, 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
Release files for python-bol-api-latest 1.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python_bol_api_latest-1.5.0.tar.gz | 15.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_bol_api_latest-1.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.8 kB
Release files / python_bol_api_latest-1.5.0.tar.gz
| Download URL | python_bol_api_latest-1.5.0.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9bcf3732d407b9b6865ee0813d5d588bac9c3da1da6e71c403293522a48a541
|
|
BLAKE2b-256 checksum How to use checksums |
667065e3db955803ecfd4832aeae262319ac8cc4579ab0ec49acd6f0bbb873f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / python_bol_api_latest-1.5.0-py3-none-any.whl
| Download URL | python_bol_api_latest-1.5.0-py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0944ae11d4acb04fd6f02899d17cfd500fc2c8ba8f537920874c8b71d6c862c2
|
|
BLAKE2b-256 checksum How to use checksums |
2af58e28b6bbc257f82fb76e155b2f6ec8add1974c8f457db86a217240228299
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|