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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file mercadoradar-1.0.4.tar.gz.

File metadata

  • Download URL: mercadoradar-1.0.4.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for mercadoradar-1.0.4.tar.gz
Algorithm Hash digest
SHA256 d7d30f0e9b3a5b8e3f37cbee3d47a5aff1cb044371d5f4104bf3e8ef7bcc2e81
MD5 fdf6ea1cd6f7e012cb1c3d3db2d17a9b
BLAKE2b-256 e13f8cba603d70ed71e91fb43d95a8c049ca4cb40764973387519f89c1433fe5

See more details on using hashes here.

File details

Details for the file mercadoradar-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for mercadoradar-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 99105ec9b0ce6a1ca308b06db660881911061bc9eeba72a9381e28c1d008ac62
MD5 82a9a4d7a433ddb2f65cba80b5c63f13
BLAKE2b-256 fd073700b00389f822e6b4b73026984dcf616e0a0dbcc92b1ed934895f7b09bb

See more details on using hashes here.

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