Skip to main content

Open-source SDK for Israeli Open Banking APIs

Project description

Israel Open Banking SDK

CI PyPI version Documentation License: MIT

An open-source Python SDK for Israeli Open Banking APIs, providing a unified interface for multiple financial service providers including Isracard, Max, and Cal.

🚀 Features

  • Multi-Provider Support: Connect to multiple Israeli financial institutions
  • PSD2 AIS Core Module: Standardized PSD2-compliant Account Information Services
  • Modular Design: Each provider in its own package for easy maintenance
  • Type Safety: Full type annotations and validation with Pydantic
  • Async Support: Both synchronous and asynchronous API clients
  • Comprehensive Error Handling: Detailed error messages and context
  • Configuration Management: Environment-based configuration
  • Extensive Testing: Full test coverage with pytest
  • Documentation: Complete API documentation with examples

🏗️ PSD2 AIS Core Module

The SDK includes a comprehensive PSD2 AIS (Account Information Services) core module based on the Berlin Group NextGenPSD2 Framework v1.3.14 specification. This provides:

  • Standardized Enums: All PSD2-specific enumerations (account status, transaction status, consent status, etc.)
  • Pydantic Models: Complete data models for all PSD2 data structures
  • Abstract Base Classes: Interface definitions for PSD2-compliant implementations
  • Exception Hierarchy: AIS-specific exception classes for proper error handling

Using the AIS Core Module

from core.ais import (
    AccountDetails, TransactionList, BookingStatus,
    Consent, ConsentStatus, AISBaseClient
)

# Use PSD2 enums for type safety
transactions = client.get_transactions(
    account_id="123",
    booking_status=BookingStatus.BOOKED,
    with_balance=True
)

# Use PSD2 models for data validation
account: AccountDetails = client.get_account_details("123")
print(f"Account: {account.name}, Balance: {account.balances}")

# Check consent status
if consent.consent_status == ConsentStatus.VALID:
    print("Consent is active")

For more details, see the AIS Core Module Documentation.

📦 Installation

Using Poetry (Recommended)

poetry add open-banking

Using pip

pip install israel-open-banking

🏃‍♂️ Quick Start

Basic Usage

from core.client import OpenBankingClient

# Initialize the client
client = OpenBankingClient()

# Get user accounts
accounts = client.get_accounts()

# Get transactions
transactions = client.get_transactions(
    account_id="12345",
    from_date="2024-01-01",
    to_date="2024-01-31"
)

Provider-Specific Usage

from isracard import IsracardClient

# Initialize Isracard client
isracard = IsracardClient()

# Get cards
cards = isracard.cards.get_cards()

# Get card transactions
transactions = isracard.cards.get_card_transactions(
    card_id="card_123",
    from_date="2024-01-01",
    to_date="2024-01-31"
)

# Manage consents
consent = isracard.consents.create_consent(
    user_id="user_123",
    permissions=["accounts", "transactions"]
)

⚙️ Configuration

The SDK uses environment variables for configuration. Copy env.example to .env and fill in your values:

# Required
OPEN_BANKING_API_BASE_URL=https://api.openbanking.gov.il
OPEN_BANKING_CLIENT_ID=your_client_id
OPEN_BANKING_CLIENT_SECRET=your_client_secret
OPEN_BANKING_REDIRECT_URI=https://your-app.com/callback

# Provider-specific
ISRACARD_API_URL=https://api.isracard.co.il/openbanking
ISRACARD_CLIENT_ID=your_isracard_client_id
ISRACARD_CLIENT_SECRET=your_isracard_client_secret

🏦 Supported Providers

Provider Status Features
Isracard ✅ Implemented Cards, Transactions, Consents, Loans
Max 🚧 Planned Credit cards, Financial services
Cal 🚧 Planned Credit cards, Banking services

📚 Documentation

🛠️ Development

Prerequisites

  • Python 3.10+
  • Poetry (for dependency management)
  • Git

Setup

# Clone the repository
git clone https://github.com/shavve/open-banking.git
cd open-banking

# Install dependencies
poetry install

# Install pre-commit hooks
pre-commit install

Running Tests

# Run all tests
poetry run pytest

# Run with coverage
poetry run pytest --cov=israel_open_banking

# Run specific test file
poetry run pytest tests/test_core.py

# Run linting
poetry run ruff check israel_open_banking/ tests/

# Run type checking
poetry run mypy israel_open_banking/

Code Quality

# Format code
poetry run black israel_open_banking/ tests/
poetry run isort israel_open_banking/ tests/

# Lint code
poetry run ruff check israel_open_banking/ tests/

# Type checking
poetry run mypy israel_open_banking/

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass (poetry run pytest)
  6. Run code quality checks (poetry run ruff check src/ tests/)
  7. Commit your changes (git commit -m 'Add amazing feature')
  8. Push to the branch (git push origin feature/amazing-feature)
  9. Open a Pull Request

Code Style

We use:

  • Black for code formatting
  • isort for import sorting
  • Ruff for linting
  • MyPy for type checking
  • Pre-commit hooks for automated checks

Testing

  • Write tests for all new functionality
  • Maintain test coverage above 80%
  • Use pytest for testing
  • Use pytest-cov for coverage reporting

📄 License

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

🆘 Support

🙏 Acknowledgments

  • Israeli Open Banking Initiative
  • All contributors and maintainers
  • The open-source community

📈 Roadmap

  • Max provider implementation
  • Cal provider implementation
  • Additional financial institutions
  • Webhook support
  • Rate limiting improvements
  • Caching layer
  • GraphQL support
  • Mobile SDK

Note: This SDK is in active development. Please check the documentation for the latest updates and breaking changes.

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

israel_open_banking-0.3.22.tar.gz (77.4 kB view details)

Uploaded Source

Built Distribution

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

israel_open_banking-0.3.22-py3-none-any.whl (354.8 kB view details)

Uploaded Python 3

File details

Details for the file israel_open_banking-0.3.22.tar.gz.

File metadata

  • Download URL: israel_open_banking-0.3.22.tar.gz
  • Upload date:
  • Size: 77.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.10.15 Darwin/24.6.0

File hashes

Hashes for israel_open_banking-0.3.22.tar.gz
Algorithm Hash digest
SHA256 ccf16162bd1e5c13f6e9ade54583c5ac59faab78e09a794c3333cec2e466ebda
MD5 9210c3a342eb2e2dfd0357543d94f152
BLAKE2b-256 f42ebf745d8a028e59b32996c163ca5ea5853f25b46a22e8569e4ae1087ef99a

See more details on using hashes here.

File details

Details for the file israel_open_banking-0.3.22-py3-none-any.whl.

File metadata

File hashes

Hashes for israel_open_banking-0.3.22-py3-none-any.whl
Algorithm Hash digest
SHA256 20c2c706eb4c1956e67ab75b225e6d6673f3ba5e3da8c1ce2944bf3da8249ac5
MD5 1c275750ea076a0a97d19e311940ef75
BLAKE2b-256 4686f0596f8f0a90dc07621d4c6de2878d0a499c3aa5bf18cc2fd47f2b7ad666

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