Skip to main content

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:

  1. Account Access: Manage account access permissions
  2. Account Application: Handle account applications
  3. Account Holder: Manage account holders
  4. Account Metadata: Work with account tags and metadata
  5. Account Public: Access public account information
  6. API Collection: Manage API collections
  7. API Configuration: Configure API settings
  8. API Favorite: Manage API favorites
  9. API Management: Advanced API management functions
  10. ATM: ATM management and information
  11. Branch: Branch management and information
  12. Card: Card management and operations
  13. Connector Method: Manage connector methods
  14. Consent: Handle consent operations
  15. Counterparty: Manage counterparties
  16. Counterparty Limits: Set and manage counterparty limits
  17. Counterparty Metadata: Work with counterparty metadata
  18. Customer: Customer management and information
  19. Customer Meeting: Schedule and manage customer meetings
  20. Customer Message: Send and receive customer messages
  21. Direct Debit: Manage direct debits
  22. Dynamic Endpoint: Work with dynamic endpoints
  23. Dynamic Entity: Manage dynamic entities
  24. Dynamic Message Doc: Handle dynamic message documentation
  25. Dynamic Resource Doc: Manage dynamic resource documentation
  26. Extended Account: Advanced account operations
  27. Extended Bank: Advanced bank operations
  28. FX: Foreign exchange operations
  29. KYC: Know Your Customer operations
  30. Metric: Access API metrics
  31. Product: Product management and information
  32. Role: Manage roles and entitlements
  33. Scheduled Event: Work with scheduled events
  34. Scope: Manage API scopes
  35. Standing Order: Create and manage standing orders
  36. Transaction: Transaction operations
  37. Transaction Metadata: Work with transaction metadata
  38. Transaction Request: Create and manage transaction requests
  39. User: User management and operations
  40. User Invitation: Manage user invitations
  41. View Custom: Create and manage custom views
  42. View System: Work with system views
  43. Webhook: Manage webhooks
  44. 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


Download files

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

Source Distribution

openbankproject_client-0.1.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

openbankproject_client-0.1.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file openbankproject_client-0.1.1.tar.gz.

File metadata

  • Download URL: openbankproject_client-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for openbankproject_client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 199cde60afd778b112051a20975463ce682577b3ffd1c0679d36438e32170caa
MD5 0e8b43de04ebc04fe0cca6f297f506af
BLAKE2b-256 efc7e54252ad1b9eaf5305c41c5aec7725e7b740bf5e574b58e51d1cc641ac02

See more details on using hashes here.

File details

Details for the file openbankproject_client-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for openbankproject_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0234fdcc57c045f5ac4c10c28a32c4a398951079c40f586984d7dbdb746888f
MD5 c645a29b18fc7c32acd924f4930e666c
BLAKE2b-256 67f7fea1a2629c4213b15d83c43e3e4533936211c53564c0e6d02e1f04828a7e

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