Wrapper for the bol.com API
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python_bol_api_latest-1.4.0.tar.gz
.
File metadata
- Download URL: python_bol_api_latest-1.4.0.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
b49ee37b312ba2a1f8ae85f91155eabf10a026c7a62e1ac8ebc85ceed4cd628e
|
|
MD5 |
57ee0f23c9f36a3f63c9695926469582
|
|
BLAKE2b-256 |
d4462a6b55b3b14c3e4b6358253f2c450e8f338fcea7cd39fea030e159792cdf
|
File details
Details for the file python_bol_api_latest-1.4.0-py3-none-any.whl
.
File metadata
- Download URL: python_bol_api_latest-1.4.0-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
fd332d637425d0b247c058578ca432740a01db2a76c0c71a40f695528844c1e5
|
|
MD5 |
6eba7ef9dbbd5ece3a279764dd400fb5
|
|
BLAKE2b-256 |
6c9d25e04d6dabf37f20b48f6b42ba87d883f6ac5d4895d35b1260bc7ac16ec9
|