Simple, domain-driven Python SDK for Open Dental API with full type safety
Project description
Open Dental Python SDK
A comprehensive Python SDK for the Open Dental API, providing 100% endpoint coverage, type safety, and easy integration with your Python applications.
Installation
Install the SDK using your preferred Python package manager:
pip
pip install opendental-sdk
rye
rye add opendental-sdk
uv
uv pip install opendental-sdk
Quick Start
from opendental import OpenDentalClient
# Initialize the client with your API keys
client = OpenDentalClient(
developer_key="your_developer_key_here",
customer_key="your_customer_key_here"
)
# Or use environment variables
# export OPENDENTAL_DEVELOPER_KEY=your_developer_key_here
# export OPENDENTAL_CUSTOMER_KEY=your_customer_key_here
client = OpenDentalClient()
# Get all patients
patients = client.patients.get()
# Get a specific patient
patient = client.patients.get(patient_id=123)
# Create a new patient
new_patient = client.patients.create({
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com"
})
# Update a patient
updated_patient = client.patients.update(123, {
"email": "newemail@example.com"
})
# Delete a patient
client.patients.delete(123)
Authentication
The Open Dental API requires both a Developer API Key and a Customer API Key. You can obtain these from the Open Dental Developer Portal.
Set your keys in one of the following ways:
- Environment Variables (Recommended):
export OPENDENTAL_DEVELOPER_KEY=your_developer_key
export OPENDENTAL_CUSTOMER_KEY=your_customer_key
- Direct Initialization:
client = OpenDentalClient(
developer_key="your_developer_key",
customer_key="your_customer_key"
)
Error Handling
The SDK provides comprehensive error handling:
from opendental import OpenDentalClient, OpenDentalAPIError
try:
client = OpenDentalClient()
patients = client.patients.get()
except OpenDentalAPIError as e:
print(f"API Error: {e}")
except Exception as e:
print(f"Unexpected error: {e}")
Available Resources
The SDK provides access to all Open Dental API resources:
- Patients:
client.patients - Appointments:
client.appointments - Procedures:
client.procedures - Insurance:
client.insurance - Billing:
client.billing - And many more...
Configuration
You can customize the client behavior:
client = OpenDentalClient(
developer_key="your_key",
customer_key="your_key",
base_url="https://api.opendental.com", # Custom API base URL
timeout=30 # Request timeout in seconds
)
Type Safety
The SDK includes full type annotations and supports modern Python type checking:
from opendental import OpenDentalClient
from opendental.models import Patient
client: OpenDentalClient = OpenDentalClient()
patient: Patient = client.patients.get(123)
Development
To set up the development environment:
git clone https://github.com/opendental/python-sdk
cd python-sdk/python
pip install -e ".[dev]"
Running Tests
pytest
Code Formatting
black src/
isort src/
Type Checking
mypy src/
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For support and questions:
- Check the API Documentation
- Open an issue on GitHub
- Contact Open Dental support
HIPAA Compliance
⚠️ Important: This SDK handles sensitive patient data. Ensure you have a Business Associate Agreement (BAA) in place with Open Dental and follow all HIPAA compliance requirements when using this SDK in production.
Using uv for Dependency Management
We recommend using uv for fast dependency management and environment setup.
Install uv
You can install uv with pipx:
pipx install uv
Or with Homebrew (on macOS):
brew install astral-sh/uv/uv
Create a Virtual Environment and Install Dependencies
uv venv .venv
source .venv/bin/activate
uv pip install -r requirements.txt
Or install directly from pyproject.toml:
uv pip install -r <(uv pip compile pyproject.toml)
Running Tests
uv pip install -r requirements.txt --extra dev
pytest
For more, see the uv documentation.
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 opendental_sdk-1.2.2.tar.gz.
File metadata
- Download URL: opendental_sdk-1.2.2.tar.gz
- Upload date:
- Size: 105.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78cfdbcecd5671ed2e22857fe04672b1772dfb0d66f686eda29f5e2eb8347aa9
|
|
| MD5 |
5420fa68a9e202e5dce7de8bbeb278cc
|
|
| BLAKE2b-256 |
1e85ceb2bbe7a268bf812712df660af7b4e120b710b6a1ab57b7afe8f745d76c
|
File details
Details for the file opendental_sdk-1.2.2-py3-none-any.whl.
File metadata
- Download URL: opendental_sdk-1.2.2-py3-none-any.whl
- Upload date:
- Size: 184.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a7a2b8ca115700fc6911acb910594d52a78f6ee6fa2cede56d76e9a43d2fed8
|
|
| MD5 |
510835587bbcd951e50e3c7ce3d833a6
|
|
| BLAKE2b-256 |
d4b9f464478108a283c2a1bdce1ca6c5a7c714a7046fc8a3789a5459ce54ced5
|