From 0a4e127596bee226b220890acc706e6782d553ab Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 06:45:31 +0000 Subject: [PATCH 1/3] chore(internal): add `--fix` argument to lint script --- scripts/lint | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/lint b/scripts/lint index c275f19..e33efb6 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,8 +4,13 @@ set -e cd "$(dirname "$0")/.." -echo "==> Running lints" -rye run lint +if [ "$1" = "--fix" ]; then + echo "==> Running lints with --fix" + rye run fix:ruff +else + echo "==> Running lints" + rye run lint +fi echo "==> Making sure it imports" rye run python -c 'import coingecko_sdk' From 84369760ef357df8e4feb0285263b7896d081948 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Dec 2025 02:58:35 +0000 Subject: [PATCH 2/3] feat(api): api update --- .stats.yml | 4 +- .../resources/public_treasury.py | 31 ++++++--- .../types/exchange_get_response.py | 4 +- .../public_treasury_get_coin_id_response.py | 64 ++++++++++++++++--- 4 files changed, 80 insertions(+), 23 deletions(-) diff --git a/.stats.yml b/.stats.yml index f25cd48..99e1a9a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 84 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/coingecko%2Fcoingecko-a23494dedfc230f769076f4022de83a327d642db68ceadedf998921c66ff9310.yml -openapi_spec_hash: 0bcc6962d4ee8f39880019986e87e433 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/coingecko%2Fcoingecko-eb98e136b67fc13d5c247829bb39e6ca26343d39801258f26f92ea25d3f4e3ef.yml +openapi_spec_hash: 04a096ec27eeb369d224c00bccc3bb9b config_hash: f101f417dba7f9352f7573639dd5938f diff --git a/src/coingecko_sdk/resources/public_treasury.py b/src/coingecko_sdk/resources/public_treasury.py index 9052aff..7b47833 100644 --- a/src/coingecko_sdk/resources/public_treasury.py +++ b/src/coingecko_sdk/resources/public_treasury.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Any, cast from typing_extensions import Literal import httpx @@ -75,12 +76,17 @@ def get_coin_id( raise ValueError(f"Expected a non-empty value for `entity` but received {entity!r}") if not coin_id: raise ValueError(f"Expected a non-empty value for `coin_id` but received {coin_id!r}") - return self._get( - f"/{entity}/public_treasury/{coin_id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + return cast( + PublicTreasuryGetCoinIDResponse, + self._get( + f"/{entity}/public_treasury/{coin_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=cast( + Any, PublicTreasuryGetCoinIDResponse + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=PublicTreasuryGetCoinIDResponse, ) def get_entity_id( @@ -289,12 +295,17 @@ async def get_coin_id( raise ValueError(f"Expected a non-empty value for `entity` but received {entity!r}") if not coin_id: raise ValueError(f"Expected a non-empty value for `coin_id` but received {coin_id!r}") - return await self._get( - f"/{entity}/public_treasury/{coin_id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + return cast( + PublicTreasuryGetCoinIDResponse, + await self._get( + f"/{entity}/public_treasury/{coin_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=cast( + Any, PublicTreasuryGetCoinIDResponse + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=PublicTreasuryGetCoinIDResponse, ) async def get_entity_id( diff --git a/src/coingecko_sdk/types/exchange_get_response.py b/src/coingecko_sdk/types/exchange_get_response.py index b40009f..a21ac31 100644 --- a/src/coingecko_sdk/types/exchange_get_response.py +++ b/src/coingecko_sdk/types/exchange_get_response.py @@ -21,7 +21,7 @@ class ExchangeGetResponse(BaseModel): """exchange trading incentive""" image: Optional[str] = None - """exchange image url""" + """exchange image URL""" name: Optional[str] = None """exchange name""" @@ -36,7 +36,7 @@ class ExchangeGetResponse(BaseModel): """exchange trust score rank""" url: Optional[str] = None - """exchange website url""" + """exchange website URL""" year_established: Optional[float] = None """exchange established year""" diff --git a/src/coingecko_sdk/types/public_treasury_get_coin_id_response.py b/src/coingecko_sdk/types/public_treasury_get_coin_id_response.py index a7fa796..ad65ae2 100644 --- a/src/coingecko_sdk/types/public_treasury_get_coin_id_response.py +++ b/src/coingecko_sdk/types/public_treasury_get_coin_id_response.py @@ -1,13 +1,20 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional +from typing_extensions import TypeAlias from .._models import BaseModel -__all__ = ["PublicTreasuryGetCoinIDResponse", "Company"] +__all__ = [ + "PublicTreasuryGetCoinIDResponse", + "CompaniesTreasury", + "CompaniesTreasuryCompany", + "GovernmentsTreasury", + "GovernmentsTreasuryGovernment", +] -class Company(BaseModel): +class CompaniesTreasuryCompany(BaseModel): country: Optional[str] = None """company incorporated or government country""" @@ -27,17 +34,56 @@ class Company(BaseModel): """total entry value in usd""" total_holdings: Optional[float] = None - """total crypto holdings of company""" + """total crypto holdings""" -class PublicTreasuryGetCoinIDResponse(BaseModel): - companies: Optional[List[Company]] = None +class CompaniesTreasury(BaseModel): + companies: List[CompaniesTreasuryCompany] - market_cap_dominance: Optional[float] = None + market_cap_dominance: float """market cap dominance""" + total_holdings: float + """total crypto holdings of companies""" + + total_value_usd: float + """total crypto holdings value in usd""" + + +class GovernmentsTreasuryGovernment(BaseModel): + country: Optional[str] = None + """company incorporated or government country""" + + name: Optional[str] = None + """company or government name""" + + percentage_of_total_supply: Optional[float] = None + """percentage of total crypto supply""" + + symbol: Optional[str] = None + """company symbol""" + + total_current_value_usd: Optional[float] = None + """total current value of crypto holdings in usd""" + + total_entry_value_usd: Optional[float] = None + """total entry value in usd""" + total_holdings: Optional[float] = None - """total crypto holdings of companies or government""" + """total crypto holdings""" - total_value_usd: Optional[float] = None + +class GovernmentsTreasury(BaseModel): + governments: List[GovernmentsTreasuryGovernment] + + market_cap_dominance: float + """market cap dominance""" + + total_holdings: float + """total crypto holdings of governments""" + + total_value_usd: float """total crypto holdings value in usd""" + + +PublicTreasuryGetCoinIDResponse: TypeAlias = Union[CompaniesTreasury, GovernmentsTreasury] From b0876810444e7c803cf49ff7bacf769d6b7c9fc4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Dec 2025 02:59:10 +0000 Subject: [PATCH 3/3] release: 1.13.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ pyproject.toml | 2 +- src/coingecko_sdk/_version.py | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index de0960a..f94eeca 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.12.0" + ".": "1.13.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a7d363e..b17caad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 1.13.0 (2025-12-23) + +Full Changelog: [v1.12.0...v1.13.0](https://github.com/coingecko/coingecko-python/compare/v1.12.0...v1.13.0) + +### Features + +* **api:** api update ([8436976](https://github.com/coingecko/coingecko-python/commit/84369760ef357df8e4feb0285263b7896d081948)) + + +### Chores + +* **internal:** add `--fix` argument to lint script ([0a4e127](https://github.com/coingecko/coingecko-python/commit/0a4e127596bee226b220890acc706e6782d553ab)) + ## 1.12.0 (2025-12-18) Full Changelog: [v1.11.3...v1.12.0](https://github.com/coingecko/coingecko-python/compare/v1.11.3...v1.12.0) diff --git a/pyproject.toml b/pyproject.toml index 9ac0b5b..e1b6232 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "coingecko_sdk" -version = "1.12.0" +version = "1.13.0" description = "The official Python library for the coingecko API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/coingecko_sdk/_version.py b/src/coingecko_sdk/_version.py index a618cb5..a04e2ca 100644 --- a/src/coingecko_sdk/_version.py +++ b/src/coingecko_sdk/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "coingecko_sdk" -__version__ = "1.12.0" # x-release-please-version +__version__ = "1.13.0" # x-release-please-version