Releases: OilpriceAPI/python-sdk
Releases · OilpriceAPI/python-sdk
v1.7.0 — World-class SDK Upgrade
What's New
Full Async Client
- All 16 resources now available on
AsyncOilPriceAPI(was only 2: prices + historical) - Async
iter_pages()generator for memory-efficient pagination
New Features
- Webhook signature verification —
verify_webhook_signature()with HMAC-SHA256 and constant-time comparison oilpriceCLI —oilprice price BRENT_CRUDE_USD,oilprice historical,oilprice commoditieswith--jsonoutput- Opt-in telemetry —
enable_telemetry=Trueon both sync and async clients - 429 auto-retry — honors
Retry-Afterheader (capped at 60s) instead of immediately raising
Bug Fixes
- Fixed version triple mismatch (single source in
version.py) - Fixed Python 3.8 syntax compatibility
- Fixed
await response.json()crash in async client (httpx.json()is synchronous) - Fixed
get_current_price()connection leak - Removed unused
aiohttpfrom[async]extra
Developer Experience
ValidationError,TimeoutError,ConfigurationErrornow exported from top-level- Lint/mypy now blocking in CI
- Coverage enforcement gate (
--cov-fail-under=50) - mkdocs + mkdocstrings API reference
- Shared
resource_validators.pyto reduce sync/async duplication
Full changelog: v1.6.2...v1.7.0
v1.6.0 — Currency fix + auto-pagination
Fixes
- Currency preservation in
to_dataframe(): Fixed bug where all commodities showed USD regardless of actual currency. EUR, GBP, and other currencies now correctly preserved. - Auto-pagination in
get_all()andto_dataframe(): Previously capped at one page of results. Now auto-paginates usingX-Has-Nextresponse header to fetch all available data. - New
per_pageparameter: Bothget_all()andto_dataframe()acceptper_page(default 100) to control page size.
Upgrade
pip install --upgrade oilpriceapiv1.0.0 - Production Release
OilPriceAPI Python SDK v1.0.0
First stable release of the official OilPriceAPI Python SDK.
Features
- ✅ Synchronous and asynchronous clients
- ✅ Comprehensive error handling with automatic retry logic
- ✅ Type-safe models with Pydantic v2
- ✅ Current and historical price data access
- ✅ Optional pandas DataFrame support
- ✅ Production logging and observability
- ✅ 100 passing tests with 64% coverage
- ✅ Full documentation and examples
Installation
pip install oilpriceapiQuick Start
from oilpriceapi import OilPriceAPI
# Initialize client
client = OilPriceAPI(api_key='your-api-key')
# Get current price
price = client.prices.get('BRENT_CRUDE_USD')
print(f'{price.commodity}: ${price.value}')Documentation
🤖 Generated with Claude Code