skillfed

braintree

Braintree Python Library

braintree v4.46.0 2.5M downloads/30d#3,041 on PyPI
Permissive license MIT Active released

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 braintree

uv

uv add braintree

poetry

poetry add braintree

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

braintree payment gateway sdkpython payment processing integrationbraintree api clientpayment gateway python librarybraintree merchant servicesserver-side payment integration
payment-processingmerchant-integration

More WWW/HTTP packages