Skip to content

Commit 82bfc48

Browse files
karlwaldmanclaude
andcommitted
chore: Update version to 1.5.0 and add CHANGELOG entry
Align pyproject.toml version with __init__.py (1.4.3 → 1.5.0). Document all 13 new resource modules, diesel fix, and test improvements. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 46cb786 commit 82bfc48

File tree

2 files changed

+68
-2
lines changed

2 files changed

+68
-2
lines changed

CHANGELOG.md

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,44 @@ All notable changes to the OilPriceAPI Python SDK will be documented in this fil
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.5.0] - 2026-02-11
9+
10+
### Added
11+
12+
- **Commodities Resource**: `client.commodities.list()`, `get(code)`, `categories()` for commodity catalog discovery
13+
- **Futures Resource**: `client.futures.latest()`, `historical()`, `ohlc()`, `intraday()`, `spreads()`, `curve()`, `continuous()` for futures contract data
14+
- **Storage Resource**: `client.storage.all()`, `cushing()`, `spr()`, `regional()`, `history()` for oil inventory levels
15+
- **Rig Counts Resource**: `client.rig_counts.latest()`, `current()`, `historical()`, `trends()`, `summary()` for Baker Hughes rig count data
16+
- **Bunker Fuels Resource**: `client.bunker_fuels.all()`, `port()`, `compare()`, `spreads()`, `historical()`, `export()` for marine fuel prices
17+
- **Analytics Resource**: `client.analytics.performance()`, `statistics()`, `correlation()`, `trend()`, `spread()`, `forecast()` for price analytics
18+
- **Forecasts Resource**: `client.forecasts.monthly()`, `accuracy()`, `archive()`, `get()` for EIA monthly price forecasts
19+
- **Data Quality Resource**: `client.data_quality.summary()`, `reports()`, `report()` for data quality monitoring
20+
- **Drilling Intelligence Resource**: `client.drilling.latest()`, `summary()`, `trends()`, `frac_spreads()`, `well_permits()`, `duc_wells()`, `completions()`, `wells_drilled()`, `basin()` for drilling activity data
21+
- **Energy Intelligence Resource**: `client.ei` with 7 sub-resources: `rig_counts`, `oil_inventories`, `opec_production`, `drilling_productivity`, `forecasts`, `well_permits`, `frac_focus` for comprehensive EIA data
22+
- **Webhooks Resource**: `client.webhooks.create()`, `list()`, `get()`, `update()`, `delete()`, `test()`, `events()` for webhook management
23+
- **Data Sources Resource**: `client.data_sources.list()`, `get()`, `create()`, `update()`, `delete()`, `test()`, `logs()`, `health()`, `rotate_credentials()` for data connector management
24+
- **Enhanced Alerts**: Added `test()`, `triggers()`, `analytics_history()` methods to existing alerts resource
25+
- **Data Connector Support**: `client.get_data_connector_prices()` for BYOS (Bring Your Own Subscription) prices
26+
- **Telemetry Headers**: `app_url` and `app_name` parameters for API usage attribution (10% rate limit bonus for app_url)
27+
28+
### Fixed
29+
30+
- **Diesel validation**: Empty string state codes now properly rejected with ValidationError
31+
32+
### Testing
33+
34+
- 84 new unit tests added (222 total, 0 failures)
35+
- Test coverage improved from ~40% to 60%
36+
- New test files for all 13 resource modules
37+
38+
### Breaking Changes
39+
40+
None - All new resources are additive. Existing code continues to work unchanged.
41+
842
## [1.4.3] - 2025-12-17
943

1044
### Fixed
45+
1146
- **CRITICAL: Historical Data Returns Wrong Commodity**: Fixed issue where all historical queries returned BRENT_CRUDE_USD regardless of requested commodity
1247
- Root cause: SDK was sending `commodity` parameter but API expects `by_code` parameter
1348
- Impact: ALL historical queries since v1.4.0 returned incorrect data
@@ -21,20 +56,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2156
- This fix was applied to the backend API simultaneously
2257

2358
### Added
59+
2460
- **Strict Commodity Validation**: API now validates commodity codes and returns clear error messages for invalid codes
2561
- Before: Silently accepted invalid codes like "oijfoijofwijewef" and returned BRENT data
2662
- After: Returns 400 Bad Request with list of valid codes
2763
- Error includes link to `/v1/prices/metrics` for full list of valid commodity codes
2864

2965
### Breaking Changes
66+
3067
None - This is a critical bug fix. Existing code will work correctly after update.
3168

3269
### Upgrade Priority
70+
3371
**CRITICAL** - All users of `client.historical.get()` should upgrade immediately. Previous versions return completely wrong data.
3472

3573
## [1.4.2] - 2025-12-16
3674

3775
### Fixed
76+
3877
- **Historical Queries Timeout Issue**: Fixed 100% timeout rate on historical data requests
3978
- Root cause: SDK was using hardcoded `/v1/prices/past_year` endpoint for all date ranges
4079
- Solution: Implemented intelligent endpoint selection based on date range
@@ -45,6 +84,7 @@ None - This is a critical bug fix. Existing code will work correctly after updat
4584
- Performance improvement: 7x faster for 1 week queries, 3x faster for 1 month queries
4685

4786
### Added
87+
4888
- **Dynamic Timeout Management**: Automatic timeout adjustment based on query size
4989
- 1 week queries: 30 seconds (previously 30s, but now uses optimal endpoint)
5090
- 1 month queries: 60 seconds
@@ -55,25 +95,30 @@ None - This is a critical bug fix. Existing code will work correctly after updat
5595
- Historical resource automatically uses appropriate timeouts
5696

5797
### Performance
98+
5899
- 1 week historical queries: **67s → ~10s** (7x faster via `/past_week` endpoint)
59100
- 1 month historical queries: **67s → ~20s** (3x faster via `/past_month` endpoint)
60101
- 1 year historical queries: **Timeout (30s) → Success (67-85s with 120s timeout)**
61102

62103
### Testing
104+
63105
- Added 9 new tests for endpoint selection and timeout handling
64106
- All 20 existing tests pass with new changes
65107
- Test coverage for `historical.py`: 88.68% (up from ~54%)
66108

67109
### Documentation
110+
68111
- Updated `historical.get()` docstring with timeout parameter examples
69112
- Added clear examples for custom timeout usage
70113

71114
### Breaking Changes
115+
72116
None - This is a backwards-compatible bug fix. Existing code will continue to work and will automatically benefit from performance improvements.
73117

74118
## [1.4.0] - 2025-12-15
75119

76120
### Added
121+
77122
- **Price Alerts**: New `client.alerts` resource for automated price monitoring
78123
- **Alert CRUD Operations**: Complete create, read, update, delete operations
79124
- **Webhook Notifications**: HTTPS webhook support for alert triggers
@@ -86,14 +131,17 @@ None - This is a backwards-compatible bug fix. Existing code will continue to wo
86131
- `WebhookTestResponse` - Webhook test results
87132

88133
### Features
134+
89135
- **Comprehensive Validation**: Input validation for all alert parameters
90136
- **Type Safety**: Full Pydantic models with datetime handling
91137
- **Error Handling**: Specific ValidationError exceptions with field details
92138
- **Pandas Integration**: Built-in DataFrame conversion for analysis
93139
- **Documentation**: Complete docstrings with examples
94140

95141
### Supported Endpoints
142+
96143
Now supports **12 endpoints** (up from 7):
144+
97145
- `GET /v1/prices/latest` - Get latest commodity prices
98146
- `GET /v1/prices` - Get historical commodity prices
99147
- `GET /v1/commodities` - Get all commodities metadata
@@ -108,11 +156,13 @@ Now supports **12 endpoints** (up from 7):
108156
- `DELETE /v1/alerts/{id}` - Delete price alert (NEW)
109157

110158
### Testing
159+
111160
- Added comprehensive test suite for alerts resource (22 test cases)
112161
- Tests cover all CRUD operations, validation, webhook testing, and DataFrame operations
113162
- 82% coverage of alerts functionality
114163

115164
### Breaking Changes
165+
116166
None - This is a backwards-compatible feature addition.
117167

118168
### Example Usage
@@ -151,6 +201,7 @@ df = client.alerts.to_dataframe()
151201
## [1.3.0] - 2025-12-15
152202

153203
### Added
204+
154205
- **Diesel Prices Support**: New `client.diesel` resource for diesel price data
155206
- **State Average Diesel Prices**: `diesel.get_price(state)` - Get EIA state-level diesel averages (free tier)
156207
- **Station-Level Diesel Pricing**: `diesel.get_stations(lat, lng, radius)` - Get nearby diesel stations with current prices from Google Maps (paid tiers)
@@ -164,14 +215,17 @@ df = client.alerts.to_dataframe()
164215
- `DieselStationsMetadata` - Query metadata
165216

166217
### Features
218+
167219
- **Input Validation**: Comprehensive validation for coordinates, state codes, and radius
168220
- **Error Handling**: Specific errors for tier restrictions (403) and rate limits (429)
169221
- **Type Safety**: Full Pydantic models for all diesel operations
170222
- **Pandas Integration**: Built-in DataFrame conversion for analysis
171223
- **Documentation**: Complete docstrings with examples
172224

173225
### Supported Endpoints
226+
174227
Now supports **7 endpoints** (up from 5):
228+
175229
- `GET /v1/prices/latest` - Get latest commodity prices
176230
- `GET /v1/prices` - Get historical commodity prices
177231
- `GET /v1/commodities` - Get all commodities metadata
@@ -181,11 +235,13 @@ Now supports **7 endpoints** (up from 5):
181235
- `POST /v1/diesel-prices/stations` - Get nearby diesel stations (NEW)
182236

183237
### Testing
238+
184239
- Added comprehensive test suite for diesel resource (18 test cases)
185240
- Tests cover input validation, error handling, and DataFrame operations
186241
- 100% coverage of diesel functionality
187242

188243
### Breaking Changes
244+
189245
None - This is a backwards-compatible feature addition.
190246

191247
### Example Usage
@@ -212,6 +268,7 @@ print(df[["state", "price", "updated_at"]])
212268
## [1.0.0] - 2025-09-29
213269

214270
### Added
271+
215272
- 🎉 Initial release of OilPriceAPI Python SDK
216273
- ✅ Synchronous client (`OilPriceAPI`)
217274
- ✅ Asynchronous client (`AsyncOilPriceAPI`)
@@ -229,6 +286,7 @@ print(df[["state", "price", "updated_at"]])
229286
- ✅ Documentation and examples
230287

231288
### Features
289+
232290
- **Current Prices**: Get latest commodity prices
233291
- **Historical Data**: Fetch past prices with flexible date ranges
234292
- **Multi-commodity**: Support for Brent, WTI, Natural Gas, and more
@@ -239,19 +297,22 @@ print(df[["state", "price", "updated_at"]])
239297
- **Type Safety**: Full Pydantic validation
240298

241299
### Security
300+
242301
- Environment variable-based API key management
243302
- No hardcoded credentials
244303
- HTTPS-only communication
245304
- Safe error messages that don't leak secrets
246305

247306
### Documentation
307+
248308
- Comprehensive README with examples
249309
- API reference documentation
250310
- Security policy (SECURITY.md)
251311
- Contributing guidelines (CONTRIBUTING.md)
252312
- Example scripts and notebooks
253313

254314
### Supported Python Versions
315+
255316
- Python 3.8+
256317
- Python 3.9
257318
- Python 3.10
@@ -263,6 +324,7 @@ print(df[["state", "price", "updated_at"]])
263324
## [Unreleased]
264325

265326
### Planned
327+
266328
- CLI tool (`oilprice` command)
267329
- WebSocket support for real-time prices
268330
- Advanced caching with Redis
@@ -285,19 +347,23 @@ pip install -e ".[dev]"
285347
```
286348

287349
### Breaking Changes
350+
288351
None - this is the initial release.
289352

290353
### Deprecations
354+
291355
None.
292356

293357
### Migration Guide
358+
294359
N/A for initial release.
295360

296361
---
297362

298363
## Links
364+
299365
- [PyPI Package](https://pypi.org/project/oilpriceapi/)
300366
- [GitHub Repository](https://github.com/oilpriceapi/python-sdk)
301367
- [Documentation](https://docs.oilpriceapi.com/sdk/python)
302368
- [API Documentation](https://docs.oilpriceapi.com)
303-
- [Website](https://oilpriceapi.com)
369+
- [Website](https://oilpriceapi.com)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "oilpriceapi"
7-
version = "1.4.3"
7+
version = "1.5.0"
88
description = "Official Python SDK for OilPriceAPI - Real-time and historical oil prices"
99
authors = [
1010
{name = "OilPriceAPI", email = "support@oilpriceapi.com"}

0 commit comments

Comments
 (0)