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/.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/CHANGELOG.md b/CHANGELOG.md index a7d363e..016c2de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## 1.13.0 (2026-01-06) + +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)) +* **internal:** codegen related update ([cc420eb](https://github.com/coingecko/coingecko-python/commit/cc420ebc39f9ab254ef2be16bf065fc513fcd2d3)) + + +### Documentation + +* prominently feature MCP server setup in root SDK readmes ([10cb284](https://github.com/coingecko/coingecko-python/commit/10cb284cf8300229a26c6816a737ba772870d7aa)) + ## 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/LICENSE b/LICENSE index ce817c7..258ea35 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Coingecko + Copyright 2026 Coingecko Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 6979668..6d5e1d0 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,15 @@ and offers both synchronous and asynchronous clients powered by [httpx](https:// It is generated with [Stainless](https://www.stainless.com/). +## MCP Server + +Use the Coingecko MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application. + +[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40coingecko%2Fcoingecko-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjb2luZ2Vja28vY29pbmdlY2tvLW1jcCJdfQ) +[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40coingecko%2Fcoingecko-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40coingecko%2Fcoingecko-mcp%22%5D%7D) + +> Note: You may need to set environment variables in your MCP client. + ## Documentation The REST API documentation can be found on [docs.coingecko.com](https://docs.coingecko.com). The full API of this library can be found in [api.md](api.md). 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/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' 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 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]