Python SDK
Install and start using the Python SDK.
Intro
The Swyfft Partner API SDK provides access to the Swyfft Partner API REST APIs.
Partner API for homeowners (HO) quoting: rate Admitted and E&S carriers for a property address in one call, then adjust coverage elements on the returned quotes.
Installation
Add the SDK to your project from its folder, with whichever package manager your project uses. Give each tool a path containing a slash, such as ../swyfft-partner-api — a bare folder name is looked up on PyPI instead, and resolves to whatever project holds that name there:
pip install <path-to-sdk>uv add <path-to-sdk>poetry add <path-to-sdk>Quick Start
Synchronous client
Construct SwyfftPartnerApiClient with keyword arguments, and call close() when you are done. Every argument is optional.
from swyfft_partner_api import SwyfftPartnerApiClient
client = SwyfftPartnerApiClient(
partner_api_key="YOUR_API_KEY", partner_api_intermediary_key="YOUR_API_KEY", environment="production"
)
client.close()Alternatively, scope it — with SwyfftPartnerApiClient(...) as client: closes the pool on exit.
Asynchronous client
AsyncSwyfftPartnerApiClient mirrors SwyfftPartnerApiClient with identical method names, and every endpoint method is a coroutine. It takes the same arguments, with some differences — for example, the transport argument is custom_async_http_client.
from asyncio import run
from swyfft_partner_api import AsyncSwyfftPartnerApiClient
async def main() -> None:
client = AsyncSwyfftPartnerApiClient(
partner_api_key="YOUR_API_KEY", partner_api_intermediary_key="YOUR_API_KEY", environment="production"
)
await client.aclose()
run(main())Alternatively, scope it — async with AsyncSwyfftPartnerApiClient(...) as client: closes the pool on exit.
