Python SDK Breaking Changes
Version 0.0.30 introduces breaking changes for the Python SDK. Older versions continue to work but don’t support OAuth.
API Key Authentication Syntax
The API key authentication syntax has changed to support the new security model.
Old Syntax
from fathom_python import Fathom
fathom = Fathom("your_api_key")
New Syntax
from fathom_python import models, Fathom
fathom = Fathom(security=models.Security(api_key_auth="your_api_key"))
OAuth Support
Version 0.0.30 adds OAuth support, which requires the new client structure:
from fathom_python import Fathom
# OAuth authorization URL generation
url = Fathom.get_authorization_url(
"YOUR_CLIENT_ID", # client ID
"your_redirect_url",
"public_api", # required scope
"randomState123"
)
# OAuth client initialization
token_store = Fathom.new_token_store()
fathom = Fathom(security=Fathom.with_authorization(
"YOUR_CLIENT_ID", # client_id
"YOUR_CLIENT_SECRET", # client_secret
"AUTHORIZATION_CODE_FROM_CALLBACK", # code
'your_redirect_uri',
token_store
))
Migration Guide
To migrate from an older version to 0.0.30:
-
Update imports:
# Old
from fathom_python import Fathom
# New
from fathom_python import models, Fathom
-
Update client initialization:
# Old
fathom = Fathom("your_api_key")
# New
fathom = Fathom(security=models.Security(api_key_auth="your_api_key"))
-
Update method calls (if any method signatures changed):
# Method calls remain the same
result = fathom.list_meetings()
Context Manager Usage
The new version encourages the use of context managers for proper resource management:
Old Usage
from fathom_python import Fathom
fathom = Fathom("your_api_key")
result = fathom.list_meetings()
print(result)
New Usage (Recommended)
from fathom_python import models, Fathom
with Fathom(
security=models.Security(
api_key_auth="your_api_key",
),
) as fathom:
result = fathom.list_meetings()
print(result)
Asynchronous Support
Version 0.0.30 includes improved asynchronous support:
import asyncio
from fathom_python import models, Fathom
async def main():
async with Fathom(
security=models.Security(
api_key_auth="your_api_key",
),
) as fathom:
result = await fathom.list_meetings_async()
print(result)
asyncio.run(main())
Backward Compatibility
Older versions of the SDK continue to work with API key authentication, but they don’t support OAuth features.
If you need to maintain compatibility with older code while adding OAuth support, you can:
- Pin to the old version for existing applications
- Create a new integration using version 0.0.30 for OAuth features
- Gradually migrate existing code to the new syntax
Version Pinning
We recommend pinning to a specific version to avoid unexpected breaking changes:
pip
pip install fathom-python==0.0.30
requirements.txt
pyproject.toml (Poetry)
[tool.poetry.dependencies]
fathom-python = "0.0.30"
What’s New in 0.0.30
- ✅ OAuth 2.0 support
- ✅ Improved security model
- ✅ Better Pydantic integration
- ✅ Enhanced error handling
- ✅ Context manager support
- ✅ Asynchronous operations
- ✅ Resource management improvements
- ✅ Better type hints
Environment Variables
The new version supports environment variables for configuration:
import os
from fathom_python import models, Fathom
with Fathom(
security=models.Security(
api_key_auth=os.getenv("FATHOM_API_KEY_AUTH", ""),
),
) as fathom:
result = fathom.list_meetings()
print(result)
Error Handling Improvements
The new version includes better error handling with specific error types:
from fathom_python import Fathom, errors, models
with Fathom(
security=models.Security(
api_key_auth="your_api_key",
),
) as fathom:
try:
result = fathom.list_meetings()
print(result)
except errors.FathomError as e:
print(f"API Error: {e.message}")
except errors.ResponseValidationError as e:
print(f"Validation Error: {e.message}")