Metadata-Version: 2.1
Name: python-bol-api-latest
Version: 1.2.0
Summary: Wrapper for the bol.com API
Home-page: https://dreambits.in
Author: Raymond Penners, Dreambits Technologies Pvt. Ltd.
Author-email: office@dreambits.in
Keywords: bol bol.com api wrapper
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development
Classifier: Topic :: System
Classifier: Topic :: System :: Software Distribution
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
License-File: LICENSE
License-File: AUTHORS

==============
python-bol-api
==============

.. image:: https://app.travis-ci.com/dreambits/python-bol-api.svg?branch=master
    :target: https://app.travis-ci.com/dreambits/python-bol-api

.. image:: https://badge.fury.io/py/python-bol-api-latest.svg
    :target: https://badge.fury.io/py/python-bol-api-latest

.. image:: https://static.pepy.tech/personalized-badge/python-bol-api-latest?period=total&units=international_system&left_color=brightgreen&right_color=black&left_text=Downloads
 :target: https://pepy.tech/project/python-bol-api-latest

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
