Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loyverse-0.1.0.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

loyverse-0.1.0-py3-none-any.whl (5.5 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