Python

Bridge provides a Python client for interacting with the Bridge API. This SDK simplifies API integration by providing type-safe methods, automatic authentication handling, and built-in error handling.

Features

  • Type Safety: Full Python type hints with generated types from our API specification
  • Authentication: Automatic token management and refresh handling
  • Error Handling: Comprehensive error handling with detailed error messages
  • Request/Response Validation: Built-in validation for all API requests and responses
  • Modern Python: Async/await support with Pydantic models

Installation

Install the SDK from PyPI:

$pip install usebridge-api

Quick Start

1from usebridge_api import BridgeApiClient, BridgeApiEnvironment
2
3# Initialize the client
4client = BridgeApiClient(
5 api_key="your-api-key",
6 environment=BridgeApiEnvironment.PRODUCTION, # or BridgeApiEnvironment.SANDBOX (defaults to PRODUCTION if not specified)
7)
8
9# Create a Patient
10patient = client.patients.v2.create_patient(
11 first_name="Jane",
12 last_name="Smith",
13 email="patient@example.com",
14 date_of_birth="2000-01-01",
15)

Resources