From f4b1b96f953ab4bf1b523405aa2948b35ae2421f Mon Sep 17 00:00:00 2001 From: Karl Waldman Date: Tue, 11 Aug 2026 08:38:53 -0400 Subject: [PATCH] fix: close claim spelling variants --- CHANGELOG.md | 8 ++++++++ EXAMPLES.md | 2 +- docs/DATAFRAMES.md | 4 ++-- docs/index.md | 2 +- oilpriceapi/async_client.py | 2 +- oilpriceapi/resources/bunker_fuels.py | 4 ++-- oilpriceapi/resources/commodities.py | 2 +- oilpriceapi/resources/data_quality.py | 6 +++--- oilpriceapi/resources/demo.py | 10 +++++----- oilpriceapi/resources/prices.py | 8 ++++---- oilpriceapi/version.py | 2 +- pyproject.toml | 2 +- scripts/clean-wheel-smoke.sh | 6 +++--- scripts/validate_storefront_claims.py | 10 +++++++++- tests/test_release_readiness.py | 2 ++ tests/test_storefront_claims.py | 11 +++++++++-- 16 files changed, 53 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a09904c..6eeaab5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.12.3] - 2026-08-11 + +### Fixed + +- Match hyphenated free-tier wording and universal catalog claims in every + readable wheel surface, and replace the remaining packaged docstrings with + current-account and runtime-response terminology. + ## [1.12.2] - 2026-08-11 ### Fixed diff --git a/EXAMPLES.md b/EXAMPLES.md index cd5f76e..f46a511 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -629,7 +629,7 @@ Ready to build with these examples? ## 📖 More Resources - **[Complete API Documentation](https://docs.oilpriceapi.com)** - Full REST API reference -- **[Available Commodities](https://docs.oilpriceapi.com/commodities)** - List of all supported commodities +- **[Available Commodities](https://docs.oilpriceapi.com/commodities)** - Query the current commodity catalog - **[GitHub Repository](https://github.com/oilpriceapi/python-sdk)** - Source code and issues - **[Support](mailto:support@oilpriceapi.com)** - Get help from our team diff --git a/docs/DATAFRAMES.md b/docs/DATAFRAMES.md index 5bef71c..695782a 100644 --- a/docs/DATAFRAMES.md +++ b/docs/DATAFRAMES.md @@ -54,8 +54,8 @@ It accepts the same `per_page` range and automatically fetches every page. ## Current prices -Calling `client.prices.to_dataframe()` with no commodity returns all current -prices and automatically follows the API's pagination headers: +Calling `client.prices.to_dataframe()` with no commodity returns the current +price records available to the account and follows the API's pagination headers: ```python df = client.prices.to_dataframe(per_page=250) diff --git a/docs/index.md b/docs/index.md index 1650f7d..ab27c9d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -49,7 +49,7 @@ prices = client.prices.get_multiple([ ]) ``` -**[View all available commodities →](https://docs.oilpriceapi.com/commodities)** +**[View the current commodity catalog →](https://docs.oilpriceapi.com/commodities)** ### Historical Data diff --git a/oilpriceapi/async_client.py b/oilpriceapi/async_client.py index f5fa8dc..42d8567 100644 --- a/oilpriceapi/async_client.py +++ b/oilpriceapi/async_client.py @@ -429,7 +429,7 @@ async def get_multiple( return prices async def get_all(self) -> List[Price]: - """Get all available prices.""" + """Get price records available to the current account.""" response = await self.client.request(method="GET", path="/v1/prices/all") if isinstance(response, dict) and "data" in response: diff --git a/oilpriceapi/resources/bunker_fuels.py b/oilpriceapi/resources/bunker_fuels.py index 0675af1..bbff4b1 100644 --- a/oilpriceapi/resources/bunker_fuels.py +++ b/oilpriceapi/resources/bunker_fuels.py @@ -22,10 +22,10 @@ def __init__(self, client): self.client = client def all(self) -> List[Dict[str, Any]]: - """Get all bunker fuel prices. + """Get the available bunker fuel price records. Returns: - List of bunker fuel prices across all ports + List of bunker fuel price records returned by the API Example: >>> bunker_prices = client.bunker_fuels.all() diff --git a/oilpriceapi/resources/commodities.py b/oilpriceapi/resources/commodities.py index 63e6eb2..7d70cd8 100644 --- a/oilpriceapi/resources/commodities.py +++ b/oilpriceapi/resources/commodities.py @@ -21,7 +21,7 @@ def __init__(self, client): self.client = client def list(self) -> List[Dict[str, Any]]: - """Get list of all available commodities. + """Get commodities available to the current account. Returns: List of commodity objects with code, name, and metadata diff --git a/oilpriceapi/resources/data_quality.py b/oilpriceapi/resources/data_quality.py index 1196fd0..7a1a723 100644 --- a/oilpriceapi/resources/data_quality.py +++ b/oilpriceapi/resources/data_quality.py @@ -22,7 +22,7 @@ def summary(self) -> Dict[str, Any]: """Get data quality summary. Returns: - Summary of data quality metrics across all commodities + Summary of data quality metrics returned by the API Example: >>> summary = client.data_quality.summary() @@ -41,10 +41,10 @@ def summary(self) -> Dict[str, Any]: return response def reports(self) -> List[Dict[str, Any]]: - """Get all data quality reports. + """Get the available data quality reports. Returns: - List of data quality reports for all commodities + List of data quality reports returned by the API Example: >>> reports = client.data_quality.reports() diff --git a/oilpriceapi/resources/demo.py b/oilpriceapi/resources/demo.py index 3ab4935..412c855 100644 --- a/oilpriceapi/resources/demo.py +++ b/oilpriceapi/resources/demo.py @@ -2,8 +2,8 @@ Demo Resource Public, no-authentication demo endpoints (``/v1/demo/*``). These power the -"time to first call" experience: a developer can fetch real free-tier prices -and the full commodity catalog without an API key. +"time to first call" experience: a developer can fetch the current demo price +set and catalog metadata without an API key. The demo endpoints ignore authentication entirely, so :class:`DemoResource` works both as an attribute of an authenticated client (``client.demo``) and @@ -68,11 +68,11 @@ def _get(self, path: str) -> Dict[str, Any]: return data def prices(self, codes: Optional[List[str]] = None) -> Dict[str, Any]: - """Get latest demo prices for free-tier commodities. + """Get the latest price records currently exposed by the demo endpoint. Args: codes: Optional list of commodity codes to request. When omitted, - the API returns all free-tier commodities. + the API returns its current demo set. Returns: The ``data`` payload: ``{"prices": [...], "meta": {...}, "examples": {...}}``. @@ -85,7 +85,7 @@ def prices(self, codes: Optional[List[str]] = None) -> Dict[str, Any]: return data def commodities(self) -> Dict[str, Any]: - """Get the full demo commodity catalog grouped by category. + """Get current demo commodity metadata grouped by category. Returns: The ``data`` payload: ``{"commodities": {category: [...]}, "meta": {...}}``. diff --git a/oilpriceapi/resources/prices.py b/oilpriceapi/resources/prices.py index 16c858c..1cd3db9 100644 --- a/oilpriceapi/resources/prices.py +++ b/oilpriceapi/resources/prices.py @@ -108,16 +108,16 @@ def get_multiple( return prices def get_all(self, per_page: int = 100) -> List[Price]: - """Get current prices for all available commodities. + """Get current price records available to the account. - Auto-paginates using X-Has-Next response headers until all records - are retrieved. + Auto-paginates using X-Has-Next response headers until the API reports + no additional records. Args: per_page: Number of records per page (default 100, matches API default) Returns: - List of Price objects for all commodities + List of Price objects returned for the current account Example: >>> all_prices = client.prices.get_all() diff --git a/oilpriceapi/version.py b/oilpriceapi/version.py index 690ef9a..5341fdb 100644 --- a/oilpriceapi/version.py +++ b/oilpriceapi/version.py @@ -5,6 +5,6 @@ Used in __init__.py, client.py, and async_client.py. """ -__version__ = "1.12.2" +__version__ = "1.12.3" SDK_VERSION = __version__ SDK_NAME = "oilpriceapi-python" diff --git a/pyproject.toml b/pyproject.toml index 8d1702a..ff203d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "oilpriceapi" -version = "1.12.2" +version = "1.12.3" description = "Official Python SDK for source-timestamped OilPriceAPI energy data" authors = [ {name = "OilPriceAPI", email = "support@oilpriceapi.com"} diff --git a/scripts/clean-wheel-smoke.sh b/scripts/clean-wheel-smoke.sh index 73a3a41..0f966f3 100755 --- a/scripts/clean-wheel-smoke.sh +++ b/scripts/clean-wheel-smoke.sh @@ -2,7 +2,6 @@ set -euo pipefail root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" -wheel="$(find "$root_dir/dist" -maxdepth 1 -name '*.whl' -print -quit)" expected_version="$( python -c ' import pathlib @@ -16,9 +15,10 @@ if match is None: print(match.group(1)) ' "$root_dir/pyproject.toml" )" +wheel="$root_dir/dist/oilpriceapi-${expected_version}-py3-none-any.whl" -if [[ -z "$wheel" ]]; then - echo "no wheel found under dist/" >&2 +if [[ ! -f "$wheel" ]]; then + echo "exact wheel not found: $wheel" >&2 exit 1 fi diff --git a/scripts/validate_storefront_claims.py b/scripts/validate_storefront_claims.py index c010813..949a66b 100644 --- a/scripts/validate_storefront_claims.py +++ b/scripts/validate_storefront_claims.py @@ -69,10 +69,18 @@ re.IGNORECASE, ), ), + ( + "universal catalog", + re.compile( + r"\ball\s+(?:(?:available|latest|bunker|fuel|current|supported|free[- ]tier)\s+){0,4}" + r"(?:prices|commodities)\b|\bfull\s+(?:demo\s+)?commodity\s+catalog(?:ue)?\b", + re.IGNORECASE, + ), + ), ( "free-tier claim", re.compile( - r"\bfree\s+tier\b|\bfree\s+api\s+key\b|" + r"\bfree[- ]tier\b|\bfree[- ]api[- ]key\b|" r"\b(?:endpoint|access)\s+is\s+free\b|\bincluded\s+in\s+all\s+tiers\b", re.IGNORECASE, ), diff --git a/tests/test_release_readiness.py b/tests/test_release_readiness.py index 6bb911e..d0034a9 100644 --- a/tests/test_release_readiness.py +++ b/tests/test_release_readiness.py @@ -33,6 +33,8 @@ def test_publish_gate_audits_and_installs_the_built_wheel() -> None: assert "continue-on-error: true" not in workflow assert "from oilpriceapi.version import SDK_VERSION" not in smoke assert "--package-root" in smoke + assert 'oilpriceapi-${expected_version}-py3-none-any.whl' in smoke + assert "-name '*.whl' -print -quit" not in smoke def test_packaging_configuration_remains_compatible_with_supported_python() -> None: diff --git a/tests/test_storefront_claims.py b/tests/test_storefront_claims.py index 911698d..abb8794 100644 --- a/tests/test_storefront_claims.py +++ b/tests/test_storefront_claims.py @@ -56,7 +56,8 @@ def test_rejects_claim_in_future_installed_package_data(tmp_path: Path) -> None: (package / "version.py").write_text('__version__ = "9.9.9"\n') (package / "py.typed").write_text("") (package / "types.pyi").write_text( - '"""Endpoint is free and included in all tiers. Available on paid tiers. ' + '"""Free-tier access includes the full commodity catalog and all latest prices. ' + 'Endpoint is free and included in all tiers. Available on paid tiers. ' 'Monthly station query limit applies."""\n' ) (package / "docs" / "catalog.json").write_text( @@ -89,7 +90,9 @@ def test_rejects_claim_in_future_installed_package_data(tmp_path: Path) -> None: assert "oilpriceapi/docs/catalog.json" in surfaces assert not any("__pycache__" in surface for surface in surfaces) assert any( - "oilpriceapi/types.pyi" in failure and "free-tier claim" in failure + "oilpriceapi/types.pyi" in failure + and "free-tier claim" in failure + and "matched 'Free-tier'" in failure for failure in failures ) assert any( @@ -100,4 +103,8 @@ def test_rejects_claim_in_future_installed_package_data(tmp_path: Path) -> None: "oilpriceapi/types.pyi" in failure and "fixed allowance" in failure for failure in failures ) + assert any( + "oilpriceapi/types.pyi" in failure and "universal catalog" in failure + for failure in failures + ) assert any("oilpriceapi/docs/catalog.json" in failure for failure in failures)