{"id":20581842,"url":"https://github.com/paddlehq/paddle-python-sdk","last_synced_at":"2025-05-12T14:47:27.300Z","repository":{"id":235424692,"uuid":"782101690","full_name":"PaddleHQ/paddle-python-sdk","owner":"PaddleHQ","description":"Python SDK for working with the Paddle API in server-side apps.","archived":false,"fork":false,"pushed_at":"2025-03-28T06:01:28.000Z","size":1192,"stargazers_count":31,"open_issues_count":4,"forks_count":6,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-24T14:47:28.401Z","etag":null,"topics":["api","paddle","python","sdk"],"latest_commit_sha":null,"homepage":"https://developer.paddle.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PaddleHQ.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-04T16:33:20.000Z","updated_at":"2025-04-18T12:24:55.000Z","dependencies_parsed_at":"2024-04-23T10:39:08.225Z","dependency_job_id":"2876a12d-671e-4083-b9cc-705f1c3c8daa","html_url":"https://github.com/PaddleHQ/paddle-python-sdk","commit_stats":null,"previous_names":["paddlehq/paddle-python-sdk"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaddleHQ%2Fpaddle-python-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaddleHQ%2Fpaddle-python-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaddleHQ%2Fpaddle-python-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaddleHQ%2Fpaddle-python-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PaddleHQ","download_url":"https://codeload.github.com/PaddleHQ/paddle-python-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253758079,"owners_count":21959524,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","paddle","python","sdk"],"created_at":"2024-11-16T06:31:36.420Z","updated_at":"2025-05-12T14:47:27.250Z","avatar_url":"https://github.com/PaddleHQ.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://img.shields.io/github/actions/workflow/status/PaddleHQ/paddle-python-sdk/publish_to_pypi.yml)](https://github.com/PaddleHQ/paddle-python-sdk/actions/?query=branch%3Amain)\n[![PyPI](https://img.shields.io/pypi/v/paddle-python-sdk.svg)](https://pypi.python.org/pypi/paddle-python-sdk)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/paddle-python-sdk.svg)](https://pypi.python.org/pypi/paddle-python-sdk/)\n[![License: Apache 2.0](https://img.shields.io/github/license/PaddleHQ/paddle-python-sdk)](http://www.apache.org/licenses/LICENSE-2.0)\n\n\n# paddle-python-sdk\n[Paddle Billing](https://www.paddle.com/billing?utm_source=dx\u0026utm_medium=paddle-python-sdk) is a complete digital product sales and subscription management platform, designed for modern software businesses. It helps you increase your revenue, retain customers, and scale your operations.\n\nThis is a [Python](https://www.python.org/) SDK that you can use to integrate Paddle Billing with applications written in Python.\n\nFor working with Paddle in your frontend, use [Paddle.js](https://developer.paddle.com/paddlejs/overview?utm_source=dx\u0026utm_medium=paddle-python-sdk). You can open checkouts, securely collect payment information, build pricing pages, and integrate with Paddle Retain.\n\n\u003e **Important:** This package works with Paddle Billing. It does not support Paddle Classic. To work with Paddle Classic, see: [Paddle Classic API reference](https://developer.paddle.com/classic/api-reference/1384a288aca7a-api-reference?utm_source=dx\u0026utm_medium=paddle-python-sdk)\n\n\n## Table of contents\n- [Requirements](#Requirements)\n- [Install](#Install)\n- [Usage](#Usage)\n- [Examples](#Examples)\n- [Resources](#Resources)\n\n## Requirements\nPython\u003e=3.11 (for native type hinting, StrEnum, trailing commas, f-strings)\n\n**Project dependencies** (automatically installed by pip):\n- requests\u003e=2.31\n- urllib3\u003e=2.1.0\n\n\n## Install\nBecause `paddle-python-sdk` is [available on PyPi](https://pypi.org/project/paddle-python-sdk/), installation is as simple as running the following `pip` command: \n\n`pip install paddle-python-sdk`\n\n\n\n## Usage\nTo authenticate, you'll need an API key. You can create and manage API keys in **Paddle \u003e Developer tools \u003e Authentication**.\n\nPass your API key while initializing a new Paddle client:\n``` python\nfrom paddle_billing import Client\n\npaddle = Client('PADDLE_API_SECRET_KEY')\n```\n\nYou can pass your Paddle API secret key into the SDK from an environment variable:\n``` python\nfrom os             import getenv\nfrom paddle_billing import Client\n\npaddle = Client(getenv('PADDLE_API_SECRET_KEY'))\n```\n\nYou can also pass an environment to work with Paddle's sandbox:\n``` python\nfrom paddle_billing import Client, Environment, Options\n\npaddle = Client('PADDLE_API_SECRET_KEY', options=Options(Environment.SANDBOX))\n```\n\nKeep in mind that API keys are separate for your sandbox and live accounts, so you'll need to generate keys for each environment.\n\n\n\n## Examples\nThere are examples included in the [examples folder](https://github.com/PaddleHQ/paddle-python-sdk/tree/main/examples). To prevent leaking errors we recommend encapsulating Paddle operations inside Try/Except blocks. For brevity, most of the examples below do not do this.\n\n### List entities\nYou can list supported entities with the `list()` method in the resource. It returns an iterator to help when working with multiple pages.\n``` python\nfrom paddle_billing import Client\n\npaddle = Client('PADDLE_API_SECRET_KEY')\n\nproducts = paddle.products.list()\n\n# list() returns an iterable, so pagination is automatically handled\nfor product in products:\n    print(f\"Product's id: {product.id}\")\n```\n\n### Get an entity\nYou can get an entity with the `get()` method in the resource. It accepts the `id` of the entity to get. The entity is returned.\n``` python\nfrom paddle_billing import Client\n\npaddle = Client('PADDLE_API_SECRET_KEY')\n\nproduct = paddle.products.get('PRODUCT_ID')\n```\n\n### Create an entity\nYou can create a supported entity with the `create()` method in the resource. It accepts the resource's corresponding `CreateOperation` e.g. `CreateProduct`. The created entity is returned.\n\n``` python\nfrom paddle_billing                               import Client\nfrom paddle_billing.Entities.Shared.TaxCategory   import TaxCategory\nfrom paddle_billing.Resources.Products.Operations import CreateProduct\n\npaddle = Client('PADDLE_API_SECRET_KEY')\n\ncreated_product = paddle.products.create(CreateProduct(\n    name         = 'My Product',\n    tax_category = TaxCategory.Standard,\n))\n```\n\n### Update an entity\nYou can update a supported entity with the `update()` method in the resource. It accepts the `id` of the entity to update and the corresponding `UpdateOperation` e.g. `UpdateProduct`. The updated entity is returned.\n``` python\nfrom paddle_billing                        import Client\nfrom paddle_billing.Resources.Products.Operations import UpdateProduct\n\npaddle = Client('PADDLE_API_SECRET_KEY')\n\n# Update the name of the product\nupdated_product = paddle.products.update('PRODUCT_ID', UpdateProduct(\n    name = 'My Improved Product'\n))\n```\n\nWhere operations require more than one `id`, the `update()` method accepts multiple arguments. For example, to update an address for a customer, pass the `customerId` and the `addressId`:\n``` python\nupdated_address = paddle.addresses.update(\n    'CUSTOMER_ID',\n    'ADDRESS_ID',\n    operation_goes_here,\n)\n```\n\n### Delete an entity\nYou can delete an entity with the `delete()` method in the resource. It accepts the `id` of the entity to delete. The deleted entity is returned.\n``` python\nfrom paddle_billing import Client\n\npaddle = Client('PADDLE_API_SECRET_KEY')\n\ndeleted_product = paddle.products.delete('PRODUCT_ID')\n```\n\n\n## Resources\n\n### Webhook signature verification\nThe SDK includes a helper class to verify webhook signatures sent by Notifications from Paddle.\n\n``` python\nfrom paddle_billing.Notifications import Secret, Verifier\n\nintegrity_check = Verifier().verify(request, Secret('WEBHOOK_SECRET_KEY'))\n```\n\nThe `verify()` method currently accepts any request object matching the `paddle_billing.Notifications.Requests.Request` protocol, and supports popular frameworks such as Flask and Django.\n\nTime drift max variance can be adjusted by passing `seconds` to `Verifier()` _(default: 5 seconds)_:\n\n```python\nintegrity_check = Verifier(seconds).verify(request, Secret('WEBHOOK_SECRET_KEY'))\n```\n\n## Learn more\n- [Paddle API reference](https://developer.paddle.com/api-reference/overview?utm_source=dx\u0026utm_medium=paddle-python-sdk)\n- [Sign up for Paddle Billing](https://login.paddle.com/signup?utm_source=dx\u0026utm_medium=paddle-python-sdk)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaddlehq%2Fpaddle-python-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaddlehq%2Fpaddle-python-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaddlehq%2Fpaddle-python-sdk/lists"}