braintree
Braintree Python Library
What it is and what it does
Braintree is the official Python SDK for integrating with Braintree's payment gateway, a PayPal-owned payment processor. It abstracts the HTTP API into Python objects and methods, handling authentication, request formatting, and response parsing so you can focus on payment logic rather than protocol details. The library depends only on requests, keeping its footprint minimal.
Typical use involves configuring credentials once at startup, then calling methods like Transaction.sale() or Customer.create() to perform payment operations. It's designed for server-side integration where you control the merchant credentials; client-side payment flows use separate client tokens and nonces generated through Braintree's client SDKs.
Use it for:
- Process one-time credit card payments or recurring billing through Braintree's merchant account
- Create and manage customer profiles and payment methods stored in Braintree's vault
- Handle payment webhooks and transaction status queries from your backend
- Integrate Braintree payments into a Django, Flask, or FastAPI application
- Build a subscription or SaaS billing system using Braintree's recurring transaction features
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python bindings to the Braintree payment gateway, enabling server-side integration with Braintree's payment processing and merchant services.
Yes, if you use Braintree for payments. It's the official SDK with low friction, active maintenance, permissive licensing, and no known vulnerabilities. Install it only if your application actually integrates with Braintree; it's not a general-purpose payment library.
Install
braintree on PyPI
pip
pip install braintreeuv
uv add braintreepoetry
poetry add braintreeInstalling braintree
Before you install
Low install friction with a single dependency on requests. Active maintenance with a release 2 days old signals ongoing support.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install braintree
import braintree
braintree.Configuration.configure(
braintree.Environment.Sandbox,
merchant_id='your_merchant_id',
public_key='your_public_key',
private_key='your_private_key'
)
result = braintree.Transaction.sale({
'amount': '10.00',
'payment_method_nonce': 'nonce_from_client'
})
Verify before relying
- Whether the package supports Python versions older than 3.5 despite classifiers listing 3.5 as the minimum
- Current state of the GitHub repository and community activity level
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — requests |
| Maintenance | actively maintained — 2 days since the last release |
| First released | |
| Downloads | 2,492,160/month — #3,041 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: braintree-4.46.0-py2.py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
razorpayPython client library for the Razorpay payment…
permissive · top 5,000 on PyPI
types-braintreeProvides type hints for the braintree payment…
permissive · top 15,000 on PyPI
AdyenProvides official Python bindings for Adyen's…
permissive · top 5,000 on PyPI
beanstreamProvides a Python client library for the…
permissive · top 15,000 on PyPI
wechatpayv3SDK for integrating WeChat Pay API v3 into…
permissive · top 5,000 on PyPI
google-shopping-merchant-productsPython client library for Google Shopping…
permissive · top 15,000 on PyPI
mercadopagoProvides Python bindings to integrate Mercado…
permissive · top 15,000 on PyPI
paytmchecksumGenerates and verifies checksums for Paytm…
permissive · top 15,000 on PyPI
yookassaPython client library for integrating YooKassa…
permissive · top 15,000 on PyPI
breez-sdk-sparkPython bindings for the Breez Spark SDK,…
permissive · top 15,000 on PyPI