Skip to content

Commit f0b32dc

Browse files
authored
Merge pull request #2 from paywithextend/initial-commit
Initial commit
2 parents 222b1b0 + f066b52 commit f0b32dc

23 files changed

+2115
-0
lines changed

.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Extend API Credentials
2+
EXTEND_API_KEY=your_api_key_here
3+
EXTEND_API_SECRET=your_api_secret_here
4+
5+
# Test Configuration
6+
EXTEND_TEST_RECIPIENT=recipient@example.com
7+
EXTEND_TEST_CARDHOLDER=cardholder@example.com

.gitignore

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Python build artifacts
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
23+
# Virtual environments
24+
venv/
25+
env/
26+
ENV/
27+
test_env/
28+
.env
29+
30+
# IDE specific files
31+
.idea/
32+
.vscode/
33+
*.swp
34+
*.swo
35+
.DS_Store
36+
37+
# Test coverage
38+
.coverage
39+
htmlcov/
40+
.tox/
41+
.nox/
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Jupyter Notebook
51+
.ipynb_checkpoints
52+
*.ipynb
53+
54+
# Distribution / packaging
55+
.Python
56+
build/
57+
develop-eggs/
58+
dist/
59+
downloads/
60+
eggs/
61+
.eggs/
62+
lib/
63+
lib64/
64+
parts/
65+
sdist/
66+
var/
67+
wheels/
68+
share/python-wheels/
69+
*.egg-info/
70+
.installed.cfg
71+
*.egg
72+
MANIFEST

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.1.0] - 2024-03-24
9+
10+
### Added
11+
- Initial release
12+
- Basic virtual card operations (create, get, update, cancel, close)
13+
- Recurring card support
14+
- Transaction listing and filtering
15+
- Comprehensive test suite (unit and integration tests)
16+
- Jupyter notebook examples
17+
- Type hints and validation
18+
- Async/await support
19+
20+
### Changed
21+
- None (initial release)
22+
23+
### Deprecated
24+
- None (initial release)
25+
26+
### Removed
27+
- None (initial release)
28+
29+
### Fixed
30+
- None (initial release)
31+
32+
### Security
33+
- None (initial release)

CONTRIBUTING.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Contributing to Extend API Client
2+
3+
Thank you for your interest in contributing to the Extend API Client! This document provides guidelines and steps for contributing.
4+
5+
## Development Setup
6+
7+
1. Fork the repository
8+
2. Clone your fork:
9+
```bash
10+
git clone https://github.com/your-username/extend-api-client.git
11+
cd extend-api-client
12+
```
13+
3. Create a virtual environment and activate it:
14+
```bash
15+
python -m venv venv
16+
source venv/bin/activate # On Windows: venv\Scripts\activate
17+
```
18+
4. Install development dependencies:
19+
```bash
20+
pip install -e ".[dev]"
21+
```
22+
23+
## Code Style
24+
25+
This project uses:
26+
- [black](https://github.com/psf/black) for code formatting
27+
- [isort](https://github.com/pycqa/isort) for import sorting
28+
29+
Before submitting a PR, please run:
30+
```bash
31+
black .
32+
isort .
33+
```
34+
35+
## Testing
36+
37+
We have two types of tests:
38+
1. Unit tests (`tests/test_client.py`)
39+
2. Integration tests (`tests/test_integration.py`)
40+
41+
Run all tests:
42+
```bash
43+
pytest
44+
```
45+
46+
Run only unit tests:
47+
```bash
48+
pytest tests/test_client.py
49+
```
50+
51+
Run only integration tests:
52+
```bash
53+
pytest tests/test_integration.py
54+
```
55+
56+
### Integration Tests
57+
58+
Integration tests require environment variables:
59+
- `EXTEND_API_KEY`
60+
- `EXTEND_API_SECRET`
61+
- `EXTEND_TEST_RECIPIENT`
62+
- `EXTEND_TEST_CARDHOLDER`
63+
64+
## Pull Request Process
65+
66+
1. Create a new branch for your feature:
67+
```bash
68+
git checkout -b feature/your-feature-name
69+
```
70+
71+
2. Make your changes and commit them:
72+
```bash
73+
git commit -m "Description of your changes"
74+
```
75+
76+
3. Push to your fork:
77+
```bash
78+
git push origin feature/your-feature-name
79+
```
80+
81+
4. Create a Pull Request from your fork to the main repository
82+
83+
## Code Review Guidelines
84+
85+
- Ensure all tests pass
86+
- Follow the existing code style
87+
- Add tests for new functionality
88+
- Update documentation as needed
89+
- Keep commits focused and atomic
90+
91+
## Documentation
92+
93+
- Update the README.md if you add new features
94+
- Add docstrings to new functions and classes
95+
- Update the CHANGELOG.md with your changes
96+
97+
## Questions?
98+
99+
If you have any questions, feel free to:
100+
1. Open an issue
101+
2. Contact the maintainers
102+
3. Check the [Extend API Documentation](https://docs.extend.com)
103+
104+
Thank you for contributing!

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Extend Enterprises, LLC
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,138 @@
11
# extend-python
2+
23
Python library for the Extend API
4+
5+
[![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
6+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7+
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
8+
9+
A Python client for the Extend API, providing a simple and intuitive interface for managing virtual cards, transactions,
10+
and more.
11+
12+
## Features
13+
14+
- Create and manage virtual cards
15+
- Handle recurring card operations
16+
- Track transactions
17+
- Full async/await support
18+
- Type hints and validation
19+
- Comprehensive test suite
20+
21+
## Installation
22+
23+
### From PyPI
24+
25+
```bash
26+
pip install extend-api-client
27+
```
28+
29+
### From Source
30+
31+
```bash
32+
git clone https://github.com/yourusername/extend-api-client.git
33+
cd extend-api-client
34+
pip install -e .
35+
```
36+
37+
## Quick Start
38+
39+
```python
40+
import asyncio
41+
from extend import ExtendAPI
42+
43+
44+
async def main():
45+
# Initialize the client
46+
client = ExtendAPI(
47+
api_key="your-api-key",
48+
api_secret="your-api-secret"
49+
)
50+
51+
# Get all virtual cards
52+
cards = await client.get_virtual_cards()
53+
print("Virtual Cards:", cards)
54+
55+
# Get all transactions
56+
transactions = await client.get_transactions()
57+
print("Transactions:", transactions)
58+
59+
60+
# Run the async function
61+
asyncio.run(main())
62+
```
63+
64+
## Environment Variables
65+
66+
The following environment variables are required for integration tests and examples:
67+
68+
- `EXTEND_API_KEY`: Your Extend API key
69+
- `EXTEND_API_SECRET`: Your Extend API secret
70+
- `EXTEND_TEST_RECIPIENT`: Email address for test card recipient
71+
- `EXTEND_TEST_CARDHOLDER`: Email address for test cardholder
72+
73+
## Development Setup
74+
75+
1. Clone the repository:
76+
```bash
77+
git clone https://github.com/yourusername/extend-api-client.git
78+
cd extend-api-client
79+
```
80+
81+
2. Create and activate a virtual environment:
82+
```bash
83+
python -m venv venv
84+
source venv/bin/activate # On Windows: venv\Scripts\activate
85+
```
86+
87+
3. Install development dependencies:
88+
```bash
89+
pip install -e ".[dev]"
90+
```
91+
92+
4. Run tests:
93+
```bash
94+
# Run all tests
95+
pytest
96+
97+
# Run only unit tests
98+
pytest tests/test_client.py
99+
100+
# Run only integration tests
101+
pytest tests/test_integration.py
102+
```
103+
104+
5. Format code:
105+
```bash
106+
black .
107+
isort .
108+
```
109+
110+
## Testing
111+
112+
The project includes both unit tests and integration tests:
113+
114+
- Unit tests (`tests/test_client.py`): Test the client's internal logic and validation
115+
- Integration tests (`tests/test_integration.py`): Test actual API interactions
116+
- Example notebook (`notebooks/api_testing.ipynb`): Interactive examples
117+
118+
To run integration tests, make sure you have set up the required environment variables.
119+
120+
## Contributing
121+
122+
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to
123+
discuss what you would like to change.
124+
125+
1. Fork the repository
126+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
127+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
128+
4. Push to the branch (`git push origin feature/amazing-feature`)
129+
5. Open a Pull Request
130+
131+
## License
132+
133+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
134+
135+
## Acknowledgments
136+
137+
- [Extend API Documentation](https://docs.extend.com)
138+
- [httpx](https://www.python-httpx.org/) for async HTTP requests

0 commit comments

Comments
 (0)