Quick Start
Install the package and start logging messages in minutes:Logging Your First Message
GREENFLASH_API_KEY in a .env file to avoid hard-coding sensitive information.
Async Support
For better performance in async applications:[aiohttp] extra and pass DefaultAiohttpClient() for optimal async performance.
Type Safety
The SDK provides comprehensive type support for better development experience:- Requests: Use TypedDict for type-safe parameters
- Responses: Pydantic models with
.to_dict()and.to_json()methods - VS Code: Enable
python.analysis.typeCheckingMode = "basic"for inline validation
Handle Errors Gracefully
The SDK provides specific error classes for different failure scenarios:APIConnectionError- Network connection issuesRateLimitError- Too many requestsAPIStatusError- Non-2xx responses with status codesAPITimeoutError- Request timeoutAPIError- Base class for all API errors
Configure Retry Behavior
Automatically retry failed requests with intelligent backoff:- Retries on connection errors,
408,409,429, and5xxresponses - Maximum of 2 retries with exponential backoff
- Configurable globally or per request
Set Request Timeouts
Control how long to wait for responses:- Default timeout: 60 seconds
- Throws
APITimeoutErroron timeout - Configurable globally or per request
Advanced Features
Access Raw HTTP Response
Get full control over the HTTP response for custom handling:Configure Logging
Control SDK logging verbosity using environment variables:error- Only errors (default)info- General informationdebug- Detailed debugging info

