Skip to main content

Paylio Python SDK

PyPI version CI

The Paylio Python SDK provides convenient access to the Paylio API from applications written in Python.

Documentation

See the Paylio API docs.

Requirements

  • Python 3.9+

Installation

pip install paylio

Usage

import paylio

client = paylio.PaylioClient("sk_live_xxx")

# Retrieve current subscription
sub = client.subscription.retrieve("user_123")
print(sub.status)       # "active"
print(sub.plan.name)    # "Pro Plan"
print(sub.plan.amount)  # 999

List subscription history

history = client.subscription.list("user_123", page=1, page_size=10)
for item in history.items:
    print(item.plan_name, item.status)

if history.has_more:
    next_page = client.subscription.list("user_123", page=2)

Cancel a subscription

# Cancel at end of billing period (safe default)
result = client.subscription.cancel("subscription_uuid")
print(result.success)  # True

# Cancel immediately
result = client.subscription.cancel("subscription_uuid", cancel_now=True)

Context manager

with paylio.PaylioClient("sk_live_xxx") as client:
    sub = client.subscription.retrieve("user_123")

Configuration

client = paylio.PaylioClient(
    "sk_live_xxx",
    base_url="https://api.paylio.pro/flying/v1",
)

Error handling

import paylio

client = paylio.PaylioClient("sk_live_xxx")

try:
    sub = client.subscription.retrieve("user_123")
except paylio.AuthenticationError:
    print("Invalid API key")
except paylio.NotFoundError:
    print("Subscription not found")
except paylio.RateLimitError:
    print("Rate limited, try again later")
except paylio.InvalidRequestError as e:
    print(f"Bad request: {e.message}")
except paylio.APIError as e:
    print(f"API error: {e.message} (status {e.http_status})")
except paylio.APIConnectionError:
    print("Network error")

Error types

Error HTTP Status Description
AuthenticationError 401 Invalid or missing API key
InvalidRequestError 400 Bad request parameters
NotFoundError 404 Resource not found
RateLimitError 429 Rate limit exceeded
APIError 5xx Server error
APIConnectionError — Network or connection failure

All errors inherit from PaylioError.

Development

pip install -e ".[dev]"
pytest
ruff check .
mypy .

License

MIT

Metadata

Release files for paylio 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for paylio 0.1.7
File Size Uploaded Provenance
paylio-0.1.7.tar.gz 13.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for paylio 0.1.7
File Interpreter ABI Platform
paylio-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 23.0 kB

Release files / paylio-0.1.7.tar.gz

Download URL paylio-0.1.7.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9940317164e068a2224b7c564203dc8e20987617d60959840dcd76984ca20240
BLAKE2b-256 checksum
How to use checksums
12805d4e900380fb0044d94226c8668c86a4dad61ce7aae2535a2becd1b62af5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 22, 2026.

Transparency log

Release files / paylio-0.1.7-py3-none-any.whl

Download URL paylio-0.1.7-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba21e8e8ccfb23cd57e11dba6bce6015bd44e97a26f4036e6ea6a58df7f6398f
BLAKE2b-256 checksum
How to use checksums
f6fd311217bb09b25432e148ce9620c0f29480dbdee2c9620a78c16d6d928b7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 22, 2026.

Transparency log

Security for paylio 0.1.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for paylio-0.1.7.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page