A comprehensive Python client for the OpenBankProject API
Project description
OpenBankProject API Python Client
A comprehensive Python client for the OpenBankProject API v5.1.0, providing access to all available endpoints with robust error handling and authentication support.
Features
- Complete API Coverage: Access to all OpenBankProject API v5.1.0 endpoints
- Multiple Authentication Methods: Support for both DirectLogin and GatewayLogin
- Robust Error Handling: Specific exception types for different error scenarios
- Type Hints: Full type annotations for better IDE integration
- Comprehensive Documentation: Detailed docstrings and usage examples
- Modular Design: Logically organized endpoint groups for easier navigation
Installation
# Install from the package directory
pip install -e /path/to/openbankproject_client
# Or install directly from the zip file
pip install openbankproject_client.zip
Quick Start
from openbankproject_client import OpenBankProjectClient
# Initialize with DirectLogin credentials
client = OpenBankProjectClient(
base_url="https://api.openbankproject.com",
api_version="v5.1.0",
username="your_username",
password="your_password",
consumer_key="your_consumer_key"
)
# Or initialize with a pre-generated token
client = OpenBankProjectClient(
base_url="https://api.openbankproject.com",
api_version="v5.1.0",
direct_login_token="your_direct_login_token"
)
# Get a list of banks
banks = client.extended_bank.get_banks()
print(f"Found {len(banks.get('banks', []))} banks")
# Get accounts for a specific bank
accounts = client.extended_account.get_private_accounts_at_bank("your_bank_id")
print(f"Found {len(accounts.get('accounts', []))} accounts")
# Get transactions for an account
transactions = client.transaction.get_transactions_for_account(
"your_bank_id", "your_account_id", "owner"
)
print(f"Found {len(transactions.get('transactions', []))} transactions")
Authentication
The client supports two authentication methods:
DirectLogin
# Using username, password, and consumer key
client = OpenBankProjectClient(
username="your_username",
password="your_password",
consumer_key="your_consumer_key"
)
# Using a pre-generated token
client = OpenBankProjectClient(
direct_login_token="your_direct_login_token"
)
GatewayLogin
client = OpenBankProjectClient(
gateway_login_token="your_gateway_login_token"
)
Error Handling
The client provides specific exception types for different error scenarios:
from openbankproject_client import (
ApiError, AuthenticationError, ResourceNotFoundError,
ValidationError, PermissionError, ServerError
)
try:
client.extended_bank.get_banks()
except AuthenticationError as e:
print(f"Authentication error: {e}")
except ResourceNotFoundError as e:
print(f"Resource not found: {e}")
except ValidationError as e:
print(f"Validation error: {e}")
except PermissionError as e:
print(f"Permission error: {e}")
except ServerError as e:
print(f"Server error: {e}")
except ApiError as e:
print(f"API error: {e}")
Available Endpoint Categories
The client provides access to all OpenBankProject API v5.1.0 endpoints, organized into logical categories:
- Account Access: Manage account access permissions
- Account Application: Handle account applications
- Account Holder: Manage account holders
- Account Metadata: Work with account tags and metadata
- Account Public: Access public account information
- API Collection: Manage API collections
- API Configuration: Configure API settings
- API Favorite: Manage API favorites
- API Management: Advanced API management functions
- ATM: ATM management and information
- Branch: Branch management and information
- Card: Card management and operations
- Connector Method: Manage connector methods
- Consent: Handle consent operations
- Counterparty: Manage counterparties
- Counterparty Limits: Set and manage counterparty limits
- Counterparty Metadata: Work with counterparty metadata
- Customer: Customer management and information
- Customer Meeting: Schedule and manage customer meetings
- Customer Message: Send and receive customer messages
- Direct Debit: Manage direct debits
- Dynamic Endpoint: Work with dynamic endpoints
- Dynamic Entity: Manage dynamic entities
- Dynamic Message Doc: Handle dynamic message documentation
- Dynamic Resource Doc: Manage dynamic resource documentation
- Extended Account: Advanced account operations
- Extended Bank: Advanced bank operations
- FX: Foreign exchange operations
- KYC: Know Your Customer operations
- Metric: Access API metrics
- Product: Product management and information
- Role: Manage roles and entitlements
- Scheduled Event: Work with scheduled events
- Scope: Manage API scopes
- Standing Order: Create and manage standing orders
- Transaction: Transaction operations
- Transaction Metadata: Work with transaction metadata
- Transaction Request: Create and manage transaction requests
- User: User management and operations
- User Invitation: Manage user invitations
- View Custom: Create and manage custom views
- View System: Work with system views
- Webhook: Manage webhooks
- WebUI Props: Configure web UI properties
Examples
See the examples.py file for comprehensive usage examples covering all major endpoint categories.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openbankproject_client-0.1.2.tar.gz.
File metadata
- Download URL: openbankproject_client-0.1.2.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
013f501acfa4b5b8bba758218b7e35e1a5312e3a35f0ce554988ac4b4e48f008
|
|
| MD5 |
24afbfd54aa98a584cb7ddf5aa69f478
|
|
| BLAKE2b-256 |
bef3cd6f12f861e48bf2b9eb8e47391099d550798af57714dfa9810c6c84540b
|
File details
Details for the file openbankproject_client-0.1.2-py3-none-any.whl.
File metadata
- Download URL: openbankproject_client-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d120f88e7c5f9ebf32a6a4c231aee0907e362d2285caa25e0026e57a15c0313c
|
|
| MD5 |
84ade8a542af999a4d8ac07d72d5086b
|
|
| BLAKE2b-256 |
8c9412aeb193d9eadf1effa53f1564b5d420343e43069cd9402c698a919fd417
|