Skip to main content

This project has changeed name to paddle-client

Github - paddle-client

PyPi - paddle-client

If you have installed the old paddle-python please remove the old paddle-python and install paddle-client to ensure you get the latest changes, paddle-python will no longer be updated

pip uninstall paddle-python
pip install paddle-client

The README below have been updated to reflect the above. If you want to see the old version please see release 0.5.1 - the last release as paddle-python



A python (3.5+) wrapper around the Paddle.com API

If you are looking at intergrating Paddle with Django check out dj-paddle

Note: This is a work in progress, not all of the Paddle endpoints have been implemented yet

Quick start

Installation

pip install paddle-client

Usage

To use the Paddle API you will need a Paddle Vendor ID and API key which can be found on Paddle's authentication page

from paddle import PaddleClient


paddle = PaddleClient(vendor_id=12345, api_key='myapikey')
paddle.list_products()

If vendor_id and api_key are not passed through when initalising Paddle will fall back and try and use environmental variables called PADDLE_VENDOR_ID and PADDLE_API_KEY

export PADDLE_VENDOR_ID=12345
export PADDLE_API_KEY="myapikey"
from paddle import PaddleClient


paddle = PaddleClient()
paddle.list_products()

Documentation

Coming soon. Please see Working endpoints below for basic usage.

Contributing

All contributions are welcome and appreciated. Please see CONTRIBUTING.md for more details including details on how to run tests etc.

Working endpoints

paddle.get_order_details(checkout_id=checkout_id)
paddle.get_user_history(email=email)
paddle.get_prices(product_ids=[product_id])
paddle.list_coupons(product_id=product_id)
paddle.create_coupon(
    coupon_type='product',
    discount_type='percentage',
    discount_amount=50,
    allowed_uses=1,
    recurring=False,
    currency='USD',
    product_ids=product_ids,
    coupon_code='50%OFF',
    description='50% off coupon over $10',
    expires=expires,
    minimum_threshold=10,
    group='paddle-python',
)
paddle.delete_coupon(coupon_code=new_coupon_code, product_id=product_id)
paddle.update_coupon(
    coupon_code=coupon_code,
    new_coupon_code='40%OFF',
    new_group='paddle-python-test',
    product_ids=[product_id],
    expires=expires,
    allowed_uses=1,
    currency='USD',
    minimum_threshold=10,
    discount_amount=40,
    recurring=True
)
paddle.list_products()
paddle.list_transactions(entity='subscription', entity_id=subscription_id)
paddle.refund_payment(order_id=order_id, amount=amount, reason=reason)
paddle.list_plans()
paddle.create_plan(
    plan_name='plan_name',
    plan_trial_days=14,
    plan_length=1,
    plan_type='month',
    main_currency_code='USD',
    initial_price_usd=50,
    recurring_price_usd=50,
)
paddle.list_subscription_users()
paddle.cancel_subscription(subscription_id=1234)
paddle.update_subscription(subscription_id=1234, pause=True)
paddle.preview_update_subscription(
    subscription_id=123,
    bill_immediately=True,
    quantity=101,
)
paddle.get_webhook_history()

Failing Endpoints

The below endpoints have been implimented but are not working correctly according to the tests. They have been commented out in paddle/paddle.py and the tests will skip is the methods do not exist

ToDo

  • Fix generate license and create pay link endpoints
  • Paddle API endpoints
  • Work out if we want to include 'alias' methods like pause_subscription
  • Get test coverage to 100%
  • Docs (auto docs?)
  • Use pytest-mock Spy to check params, json, urls etc for test requests
    • Needed to any tests which skip due to missing data
  • How to deal with the manual cleanup?
  • Pull request template
  • TravisCI?
  • Dependabot
  • Remove double call for exception error message checking - How to get the exception str from pytest.raises()? pytest-mock Spy?
  • Add pytest warnings to provide direct links to Paddle for bits that need to be cleaned up

Metadata

Release files for paddle-python 0.6.0

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

Source distribution (sdist)

Source distribution for paddle-python 0.6.0
File Size Uploaded Provenance Actions
paddle-python-0.6.0.tar.gz 16.1 kB Without provenance Details for paddle-python-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for paddle-python 0.6.0
File Interpreter ABI Platform Actions
paddle_python-0.6.0-py3-none-any.whl Python 3 none any Details for paddle_python-0.6.0-py3-none-any.whl

Total release size: 34.8 kB

Release files / paddle-python-0.6.0.tar.gz

Download URL paddle-python-0.6.0.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
aba653b3319a574a8793dc2a639e335ec981758e942bc502b3c4722ebbc27a3b
BLAKE2b-256 checksum
How to use checksums
fd2a2660e6811ed9f686406d39fb1d16dc78f15c927565a5a25f7f2077c22049
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.7.5 Darwin/18.6.0

Release files / paddle_python-0.6.0-py3-none-any.whl

Download URL paddle_python-0.6.0-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8fe5289e1fa7ca6c29695825ef6cf0a28b80ba42c437b0bb73de6f8b095c6beb
BLAKE2b-256 checksum
How to use checksums
b41235704529096bdbec13aca69f4376b20ae637b36151212aafae1239da06a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.7.5 Darwin/18.6.0

Security for paddle-python 0.6.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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