Lago Python Client
This is a python wrapper for Lago API
Installation
Install the lago-python-client via pip from PyPI:
$ pip install lago-python-client
Usage
from lago_python_client import Client
client = Client(api_key = 'key')
Events
from lago_python_client.models import Event
event = Event(
customer_id="5eb02857-a71e-4ea2-bcf9-57d8885990ba",
transaction_id="__UNIQUE_ID__",
code="123",
transaction_id="123",
timestamp=1650893379,
properties={"custom_field": "custom"}
)
client.events().create(event)
Customers
from lago_python_client.models import Customer
customer = Customer(
customer_id="5eb02857-a71e-4ea2-bcf9-57d8885990ba",
address_line1=None,
address_line2=None,
city=None,
country=None,
email="test@example.com",
legal_name=None,
legal_number=None,
logo_url=None,
name="test name",
phone=None,
state=None,
url=None,
vat_rate=None,
zipcode=None
)
client.customers().create(customer)
Subscriptions
from lago_python_client.models import Subscription
subscription = Subscription(
customer_id="5eb02857-a71e-4ea2-bcf9-57d8885990ba",
plan_code="code"
)
client.subscriptions().create(subscription)
params_delete = {
"customer_id": "5eb02857-a71e-4ea2-bcf9-57d8885990ba"
}
client.subscriptions().delete(params_delete)
Applied coupons
from lago_python_client.models import AppliedCoupon
applied_coupon = AppliedCoupon(
customer_id="5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
coupon_code="code",
amount_cents=123,
amount_currency="EUR"
)
client.applied_coupons().create(applied_coupon)
Applied add-ons
from lago_python_client.models import AppliedAddOn
applied_add_on = AppliedAddOn(
customer_id="5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
add_on_code="code",
amount_cents=123,
amount_currency="EUR"
)
client.applied_add_ons().create(applied_add_on)
Development
Install the dependencies
pip install .
Run tests
python3 -m unittest tests
Documentation
The Lago documentation is available at doc.getlago.com.
Contributing
The contribution documentation is available here
License
Lago Python client is distributed under AGPL-3.0.
Metadata
Release files for lago-python-client 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lago-python-client-0.1.3.tar.gz | 19.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lago_python_client-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.0 kB
Release files / lago-python-client-0.1.3.tar.gz
| Download URL | lago-python-client-0.1.3.tar.gz |
|---|---|
| Size | 19.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
619253863658fd5c2ac036f74fa28cedf03a53d0ee2afc3b6a638cb2d37c2f10
|
|
BLAKE2b-256 checksum How to use checksums |
e459ad65a8c2973b56d6fd919f3ec49c61b4569e3ebed36653f24a3a59ff3e28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Release files / lago_python_client-0.1.3-py3-none-any.whl
| Download URL | lago_python_client-0.1.3-py3-none-any.whl |
|---|---|
| Size | 25.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47dbfd66f8662c23f134f125281d77869ac9ae65a2a905888dacb03d86e4b5c6
|
|
BLAKE2b-256 checksum How to use checksums |
72d4e0969947a295ee3ef0821637716b04ebd55229b8ddd58d54b5ab06aee8e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|