Loyverse API wrapper
Project description
The loyverse package provides a wrapper around the Loyverse API. It is intended to help Loyverse users to access their data using Python, without the need for boilerplate code. Furthermore, the package provides tools to convert the API responses into pandas DataFrames for easier manipulation.
Getting started
The package relies on a central Client object to access all available endpoints. To start a new client, the user either needs to provide the access token explicitly, or store it in the environmental variables under LOYVERSE_ACCESS_TOKEN. For how to generate your access token, please check here.
The example below shows how to initialize a client:
from loyverse import Client
# Pass API access token explicitly
client = Client(access_token='your_access_token')
# Pass API access token using environment variable LOYVERSE_ACCESS_TOKEN
client = Client()
Access an endpoint
All exposed API endpoints are available as properties of the Client class. Currently, the following endpoints are implemented:
- Customers
- Receipts
The example below shows how to retrieve receipts information for a specific date:
from datetime import datetime
from loyverse import Client
target_date = datetime(2020, 10, 31)
# Retrieve receipts data
client = Client()
response = client.receipts.get_by_date(target_date)
# Convert to dataframes
receipts, items, payments = client.receipts.to_dataframes(response)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file loyverse-0.1.0.tar.gz
.
File metadata
- Download URL: loyverse-0.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e22cba0babb6bc72883b825c4a06851bef54cb46b00f1be46ca4aef15553ee6a |
|
MD5 | e6a2b85bb783de63ce5be990d050200b |
|
BLAKE2b-256 | 174719b40ede309ee8e29382f46ef51959d284bbe64ba4c8a7d23667b7e84276 |
File details
Details for the file loyverse-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: loyverse-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8542ae56acd235e9f8ca1001054ddb5c6c41e107f0ac4eec507b2a47810c7fd5 |
|
MD5 | 56494bac26daa3feff6bc73b125ca4cc |
|
BLAKE2b-256 | be9fe06713436eaacb9f999a0d9accdaef76bb80bf6f0b29bf73ee9821ce81a9 |