Python SDK v0.3.0
Install with
pip install rulebook-sdk>=0.3.0. Requires Python 3.11+.Breaking Changes
- Response envelope restructuring — All endpoints now return wrapper objects with
.dataand.metafields:exchanges.list()returnsExchangeListResponse(wasList[Exchange])exchanges.retrieve()returnsExchangeDetailResponse(wasExchangeDetail)fee_schedule_results.retrieve()returnsFeeScheduleResultResponse(wasFeeScheduleResult)fee_schedule_results.get_filters()returnsFeeScheduleResultFiltersResponse(wasFeeScheduleResultFilters)
PaginatedResponserestructuring — Pagination metadata now nested under.meta:- Access
response.meta.record_countinstead ofresponse.total_records - Access
response.meta.page_size,response.meta.total_pages,response.meta.current_pageinstead of flat fields - Backward-compatible validator handles legacy flat field shapes
- Access
ExchangeDetail.record_countremoved — record count now available viaresponse.meta.record_count
New Features
ResponseMetaandPaginationMetatypes — Standardized metadata objects withquery_time_msand pagination info- New response wrapper types with full type hints:
ExchangeListResponse,ExchangeDetailResponse,FeeScheduleResultResponse,FeeScheduleResultFiltersResponse
Migration Guide
Python SDK v0.2.0
Install with
pip install rulebook-sdk>=0.2.0. Requires Python 3.11+.Breaking Changes
FeeScheduleResult.idrenamed toFeeScheduleResult.record_id— aligns with the API response schema- Removed
FeeScheduleResult.fee_reference— field does not exist in the API response model
New Features
include_footnotes,include_definitions,include_sourceparameters onlist(),retrieve(), andget_results_by_version()(sync, async, and raw response variants)exchange_nameparameter onget_filters()to narrow filter values to specific exchanges- New response models:
Footnote,Definition,Relationships - New fields on
FeeScheduleResult:source_document,source_link,page_number,relationships
Python SDK v0.1.2
Exchanges
client.exchanges.list()— list all exchanges accessible to your accountclient.exchanges.retrieve(name)— get exchange detail with date ranges, fee types, actions, participants, and more
Fee Schedule Results
client.fee_schedule_results.list()— query fee schedules with filtering by exchange, fee type, pagination, and orderingclient.fee_schedule_results.retrieve(record_id)— get a single fee schedule result by IDclient.fee_schedule_results.get_filters()— get available filter values (exchange names, fee types)client.fee_schedule_results.get_results_by_version(version_id)— get all results for a specific extraction version
Client Features
- Sync and async clients (
RulebookandAsyncRulebook) - Typed Pydantic response models (
Exchange,ExchangeDetail,FeeScheduleResult,PaginatedResponse,FeeScheduleResultFilters) - Raw HTTP response access via
with_raw_response - Configurable timeouts, retries, and custom headers
- Immutable client copies with
with_options() - Typed exception hierarchy (
NotFoundError,AuthenticationError,RateLimitError, etc.)
API
Exchanges
GET /exchanges/— list all exchanges with name, display name, fee types, and record countGET /exchanges/{exchange_name}— exchange detail with date ranges, fee categories, actions, participants, symbol classifications, and trade types
Fee Schedule Results
GET /fee-schedule-results/— list fee schedules with filtering byexchange_name,fee_type,latest_only, pagination (page_size,page_number), and ordering (order_by,order_dir)GET /fee-schedule-results/{record_id}— retrieve a single fee schedule resultGET /fee-schedule-results/versions/{version_id}— get all results for a specific extraction versionGET /fee-schedule-results/filters/— get available filter values for building queries
Authentication & Rate Limiting
- API key authentication via
x-rulebook-api-access-keyheader - Per-key access control — only see exchanges you have access to
- Token bucket rate limiting per API key

