Skip to content

yberezkin/xsellco-api

Repository files navigation

XSELLCO-API Python Wrapper

CodeFactor pytest codecov

This project provides a Python wrapper for interacting with the Repricer.com (aka Xsellco) API, simplifying the integration of Repricer.com's API features into Python applications. It offers both synchronous and asynchronous support to accommodate different programming needs, thanks in part to the httpx library. Detailed API documentation can be found at eDesk Developers.

Getting Started

These instructions will give you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on deploying the project on a live system.

Installing

Badge

pip install xsellco_api

For Developing:

Clone the repository and install requirements-dev.txt:


Usage

The library provides both synchronous (sync) and asynchronous (async_) interfaces for interacting with the Repricer.com API. Below are examples of how to use each interface:

Synchronous Usage

from xsellco_api.sync import Repricers

repricer = Repricers(user_name='your_username', password='your_password')
repricer_data = repricer.get_report()
print(repricer_data)  # list of dictionaries

# or
# All classes support context manager usage
with Repricers(user_name='your_username', password='your_password') as repricer:
    repricer_data = repricer.get_report()
    print(repricer_data)  # list of dictionaries

Asynchronous Usage

import asyncio
from xsellco_api.async_ import AsyncRepricers

async def main():
    async with AsyncRepricers(user_name='your_username', password='your_password') as repricer:
        repricer_data = await repricer.get_report()
        print(repricer_data)

asyncio.run(main())

Deprecation Notice

Please note that the xsellco_api.api module is deprecated and will be removed in future versions. Users are encouraged to switch to the sync or async_ modules for continued support.

License

License