extend-python
Python library for the Extend API
A Python client for the Extend API, providing a simple and intuitive interface for managing virtual cards, transactions, and more.
Features
- Create and manage virtual cards
- Handle recurring card operations
- Track transactions
- Expense management
Documentation
For detailed API documentation, please visit our Stoplight documentation.
Installation
From PyPI
pip install paywithextend
From Source
git clone https://github.com/paywithextend/extend-python.git
cd extend-python
pip install -e .
Quick Start
Version 3 requires explicit environment selection and client cleanup. See the migration guide for security and compatibility changes.
import asyncio
from extend import ExtendClient
from extend.auth import BasicAuth
async def main():
# Initialize the client
async with ExtendClient(
auth=BasicAuth(
"your-api-key",
"your-api-secret",
),
environment="stage",
) as client:
response = await client.virtual_cards.get_virtual_cards()
# Handle the result in your application; avoid logging financial payloads.
# Run the async function
asyncio.run(main())
Using Custom Authorization
Both ExtendClient and APIClient accept reusable authorization strategies defined in extend.auth, enabling scenarios like JWT-based access or shared credentials across clients.
from extend import ExtendClient
from extend.auth import BearerAuth
auth = BearerAuth(jwt_token="your-jwt-token")
client = ExtendClient(auth=auth, environment="stage")
# await client.aclose() when finished, or prefer async with.
If you want to work with the lower-level APIClient directly, you can pass any Authorization implementation:
from extend.auth import BasicAuth
from extend.client import APIClient
api_client = APIClient(auth=BasicAuth("your-api-key", "your-api-secret"), environment="stage")
# await api_client.aclose() when finished.
Environment Variables
Examples may read EXTEND_API_KEY and EXTEND_API_SECRET explicitly in application code.
The SDK and test suite do not automatically load .env files.
Live tests use separate EXTEND_TEST_API_KEY / EXTEND_TEST_API_SECRET variables and
an explicitly supplied private fixture file. See Testing.
Development Setup
-
Clone the repository:
git clone https://github.com/paywithextend/extend-python.git cd extend-python
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install development dependencies:
pip install -e ".[dev]"
-
Run tests:
# Complete offline suite; no account or credentials required. python -m pytest -q make lint
Testing
The default suite verifies every resource's HTTP contract, authentication, errors, transport security, retries, and cleanup without contacting Extend. CI runs it from source and against an installed wheel on Python 3.11–3.14.
Live tests are opt-in and use explicitly provisioned resources. Writes, receipt matching, and reminders each require explicit flags. See the contributor testing guide for fixture setup and cleanup.
Contributing
We welcome contributions from the community!
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Extend API Documentation
- httpx for async HTTP requests
Endpoint availability
Server implementation, public gateway exposure, and account permissions are separate requirements. Organization, member, policy, user, and individual-label helpers may return 403 where the public gateway does not expose those routes. Receipt deletion is also unavailable on some gateways even when upload is enabled. Offline contract tests verify serialization; they do not establish deployed route availability.
Metadata
Release files for paywithextend 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| paywithextend-3.0.0.tar.gz | 19.0 kB | With provenance | Details for paywithextend-3.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| paywithextend-3.0.0-py3-none-any.whl | Python 3 | none | any | Details for paywithextend-3.0.0-py3-none-any.whl |
Total release size: 46.0 kB
Release files / paywithextend-3.0.0.tar.gz
| Download URL | paywithextend-3.0.0.tar.gz |
|---|---|
| Size | 19.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e01b3424cf90bce80e297b20161874e8707db4e6b484f2610e4a4204e4fc3758
|
|
BLAKE2b-256 checksum How to use checksums |
3813ba0215b8faf22a9882e74379589b8a1010a3290f673f2ae12b415212363d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 2, 2026.
Transparency logRelease files / paywithextend-3.0.0-py3-none-any.whl
| Download URL | paywithextend-3.0.0-py3-none-any.whl |
|---|---|
| Size | 27.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81670b2933b794d1c9ce0c029138d19fa3df5506aca44da98a9fd151c963802b
|
|
BLAKE2b-256 checksum How to use checksums |
70d5e3ea3c4081add265df6e8bafbc54a8c5eec42d4af4ace6328b77cdb12780
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 2, 2026.
Transparency logSecurity for paywithextend 3.0.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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for paywithextend-3.0.0.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 Nov 2, 2026.
Transparency logA 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.