Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.12.0"
".": "1.13.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
9 changes: 7 additions & 2 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion src/coingecko_sdk/_version.py
Original file line number Diff line number Diff line change
@@ -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
31 changes: 21 additions & 10 deletions src/coingecko_sdk/resources/public_treasury.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

from typing import Any, cast
from typing_extensions import Literal

import httpx
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions src/coingecko_sdk/types/exchange_get_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand All @@ -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"""
64 changes: 55 additions & 9 deletions src/coingecko_sdk/types/public_treasury_get_coin_id_response.py
Original file line number Diff line number Diff line change
@@ -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"""

Expand All @@ -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]