Skip to main content

Python client library for the Mercado Radar API

Project description

Mercado Radar - SDK

The Mercado Radar SDK library provides convenient access to the Mercado Radar API from applications written in the Python language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses.

For more information visit the API Documentation.

Installation

You don't need the source code unless you want to modify the package for contribution. If you just want to use the package, just run:

pip install mercadoradar

Usage

The library needs to be configured with your account's secret key which you can access through suporte@mercadoradar.com.br.

  1. Set it as the MERCADORADAR_API_TOKEN environment variable before using the library:
export MERCADORADAR_API_TOKEN='YOUR_API_TOKEN'
  1. Or set mercadoradar.api_token to its value:
import mercadoradar

mercadoradar.api_token = 'YOUR_API_TOKEN'

Attribute

import mercadoradar

mercadoradar.Attribute.list(attribute_type: str, search: str = None) -> list

Attribute Type

import mercadoradar

mercadoradar.AttributeType.list(limit: int = 100, offset: int = 0) -> list

Category

import mercadoradar

mercadoradar.Category.list(limit: int = 100, offset: int = 0) -> list
mercadoradar.Category.retrieve(id: int) -> dict

Export

import mercadoradar

mercadoradar.Export.product_history(date: date) -> bytes

Product

import mercadoradar

mercadoradar.Product.list(limit: int = 100,
                          offset: int = 0,
                          attributes_ids: list = None,
                          category_ids: list = None,
                          highest_price: float = None,
                          lowest_price: float = None,
                          product_names: list = None,
                          seller_ids: list = None,
                          site_ids: list = None,
                          status: str = None) -> list

mercadoradar.Product.retrieve(id: int) -> dict

mercadoradar.Product.history(id: int,
                             limit: int = 100,
                             offset: int = 0,
                             date__gte: date = None,
                             date__lte: date = None) -> list
  • status (str): Choices are ACTIVE, OUT_OF_STOCK, URL_NOT_FOUND

Seller

import mercadoradar

mercadoradar.Seller.list(limit: int = 100, offset: int = 0) -> list

Site

import mercadoradar

mercadoradar.Site.list(limit: int = 100, offset: int = 0) -> list

Requirements

Python 3.10.*

Contribution

https://github.com/mercadoradar/mercadoradar-sdk

Licence

Copyright 2023, Mercado Radar Software Ltda

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

mercadoradar-1.0.4.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

mercadoradar-1.0.4-py3-none-any.whl (7.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page