/python-lojaintegrada

A simple python API wrapper for Loja Integrada

Primary LanguagePythonMIT LicenseMIT

Loja Integrada API Wrapper

A simple Python API Wrapper for e-commerce platform Loja Integrada.

Install

Via Pip:

$ pip install lojaintegrada

Via GIT:

$ pip install git+https://git@github.com/tcosta84/python-lojaintegrada.git

Usage

from lojaintegrada import Api

api = Api('your-api-key', 'your-app-key')

for page in api.get_orders():
	for obj in page['objects']:
		order_id = obj['numero']
		order_data = api.get_order(order_id)

By default, an automatic retry will be done every time a rate limit error (throttling) occurs (http status code "429").

Using filters

You can pass keyword arguments (kwargs) for those apis that provide filters. Simple as that:

from lojaintegrada import Api

api = Api('your-api-key', 'your-app-key')

for page in api.get_orders(situacao_id=4, since_criado='2019-05-01'):
	for obj in page['objects']:
		order_id = obj['numero']
		order_data = api.get_order(order_id)

Testing

$ make test

Security

If you discover any security related issues, please email thiagodacostabr@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.