This directory contains reusable modules for connecting to Azure services, blockchain APIs (Alchemy), and Open Banking APIs (Barclays, etc.), as well as business logic for financial message translation and orchestration.
azure_sql.py: Azure SQL Database connection and query logickey_vault.py: Azure Key Vault secret managementlogic_app_client.py: Trigger and interact with Azure Logic Appsiso20022_parser.py,swift_mt_parser.py,iso8583_parser.py: Message parsing and translation logicalchemy_client.py: Blockchain (Ethereum) API integration via Alchemybarclays_open_banking.py: Barclays Open Banking API integration (OAuth2, payments, account info)
from modules.azure_sql import get_connection
conn = get_connection()
cursor = conn.cursor()
cursor.execute('SELECT * FROM gru_balances')
for row in cursor.fetchall():
print(row)from modules.key_vault import get_secret
api_key = get_secret('EXCHANGE_RATE_API_KEY')from modules.logic_app_client import trigger_workflow
result = trigger_workflow({"messageType": "ISO20022", "payload": {}})from modules.iso20022_parser import parse_iso20022
parsed = parse_iso20022(xml_payload)- Implements OAuth2 client credentials flow
- Endpoints for account info, payment initiation, and transaction history
- Example (Python):
import requests, os
BARCLAYS_TOKEN_URL = os.getenv('BARCLAYS_TOKEN_URL')
BARCLAYS_CLIENT_ID = os.getenv('BARCLAYS_CLIENT_ID')
BARCLAYS_CLIENT_SECRET = os.getenv('BARCLAYS_CLIENT_SECRET')
def get_barclays_token():
resp = requests.post(BARCLAYS_TOKEN_URL, data={
'grant_type': 'client_credentials',
'client_id': BARCLAYS_CLIENT_ID,
'client_secret': BARCLAYS_CLIENT_SECRET
})
return resp.json()['access_token']- Connects to Ethereum and other EVM chains for on-chain data
- Example (Python):
import requests, os
ALCHEMY_URL = f"https://eth-mainnet.g.alchemy.com/v2/{os.getenv('ALCHEMY_API_KEY')}"
def get_eth_balance(address):
resp = requests.post(ALCHEMY_URL, json={
"jsonrpc": "2.0", "id": 1, "method": "eth_getBalance", "params": [address, "latest"]
})
return int(resp.json()['result'], 16) / 1e18- Use message type and metadata to route between blockchain and banking rails
- Validate and enrich messages using ICC rules, currency registry, and exchange rates
- Store all transaction metadata in Azure SQL and log to Application Insights
For new integrations, add your SDK or connection logic as a new module in this directory and update this documentation accordingly.