Skip to main content

Python client for the Extend API

Project description

extend-python

Python library for the Extend API

Python Version License: MIT Code style: black Documentation

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

import asyncio
from extend import ExtendClient


async def main():
    # Initialize the client
    client = ExtendClient(
        api_key="your-api-key",
        api_secret="your-api-secret"
    )

    # Get all virtual cards
    response = await client.virtual_cards.get_virtual_cards()
    print("Virtual Cards:", response["virtualCards"])

    # Get all transactions
    response = await client.transactions.get_transactions()
    print("Transactions:", response["report"]["transactions"])


# Run the async function
asyncio.run(main())

Environment Variables

The following environment variables are required for integration tests and examples:

  • EXTEND_API_KEY: Your Extend API key
  • EXTEND_API_SECRET: Your Extend API secret
  • EXTEND_TEST_RECIPIENT: Email address for test card recipient
  • EXTEND_TEST_CARDHOLDER: Email address for test cardholder

Development Setup

  1. Clone the repository:

    git clone https://github.com/paywithextend/extend-python.git
    cd extend-python
    
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install development dependencies:

    pip install -e ".[dev]"
    
  4. Run tests:

    # Run all tests
    pytest
    
    # Run only unit tests
    pytest tests/test_client.py
    
    # Run only integration tests
    pytest tests/test_integration.py
    

Testing

The project includes both unit tests and integration tests:

  • Unit tests (tests/test_client.py): Test the client's internal logic and validation
  • Integration tests (tests/test_integration.py): Test actual API interactions
  • Example notebook (notebooks/api_testing.ipynb): Interactive examples

To run integration tests, make sure you have set up the required environment variables.

Contributing

We welcome contributions from the community!

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paywithextend-1.2.1.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paywithextend-1.2.1-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file paywithextend-1.2.1.tar.gz.

File metadata

  • Download URL: paywithextend-1.2.1.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for paywithextend-1.2.1.tar.gz
Algorithm Hash digest
SHA256 2e1b0f773857e38f0dbcfcd4b503188a413f64631915127035bb96d5b1a1f400
MD5 3cc9e20595aa2bfe3c35d3416fc5d5ba
BLAKE2b-256 c3803e53bc83a19ad2aa041cd165ae84631287bc919b2fee58b4a90ac6c12d43

See more details on using hashes here.

File details

Details for the file paywithextend-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: paywithextend-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for paywithextend-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b5cf22eaea5fd0a0a22b76d7917a3ffae77ddd632950cc63eb7494ab97c8afc
MD5 43d486668d3860860641072d444b3057
BLAKE2b-256 ec448e003a3cf4b6bf95eaba4f9dad5a7eaff3a4b23add4986ba251b7e30ea51

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page