From f4235f35661b1b1f475712ac00194f2504dfb183 Mon Sep 17 00:00:00 2001 From: Victor Ramirez Date: Mon, 16 Dec 2024 17:31:38 +0000 Subject: [PATCH] PLAT-1338: Update Catalog documentation Add deprecation flags to catalog v1. Improve documentation. --- coinmetrics/_utils.py | 21 ++ coinmetrics/api_client.py | 220 +++++++++---------- docs/docs/api_client.md | 58 +++++ docs/processors/pydoc_markdown_processors.py | 9 + pydoc-markdown.yml | 1 + 5 files changed, 189 insertions(+), 120 deletions(-) create mode 100644 docs/processors/pydoc_markdown_processors.py diff --git a/coinmetrics/_utils.py b/coinmetrics/_utils.py index 0714d42..14d7916 100644 --- a/coinmetrics/_utils.py +++ b/coinmetrics/_utils.py @@ -126,3 +126,24 @@ def get_keys_from_catalog(d: Dict[str, str]) -> Set[str]: else: keys.append(k) return set(keys) + + +def deprecated(endpoint: Optional[str] = None) -> Callable[[Callable[..., Any]], Callable[..., Any]]: + def decorator(func: Callable[..., Any]) -> Callable[..., Any]: + message = f"Function {func.__name__} is deprecated. " + if endpoint == 'catalog': + message += "Use 'catalog-v2' and 'reference-data' instead. For more information, see: https://docs.coinmetrics.io/tutorials-and-examples/user-guides/how-to-migrate-from-catalog-v1-to-catalog-v2 " + message += "\nNote: markets are truncated to 170,000 entries. Data may be out of date." + + docstring = func.__doc__ or "" + deprecation_note = f"\n\nDeprecated: {message}\n" + func.__doc__ = deprecation_note + docstring + + @wraps(func) + def wrapper(*args: Any, **kwargs: Any) -> Any: + logger.warning(message) + return func(*args, **kwargs) + + return wrapper + + return decorator diff --git a/coinmetrics/api_client.py b/coinmetrics/api_client.py index e8dec47..1c6de05 100644 --- a/coinmetrics/api_client.py +++ b/coinmetrics/api_client.py @@ -11,7 +11,7 @@ from requests import HTTPError, Response import websocket -from coinmetrics._utils import retry, transform_url_params_values_to_str +from coinmetrics._utils import retry, transform_url_params_values_to_str, deprecated from coinmetrics import __version__ as version from coinmetrics._exceptions import CoinMetricsClientQueryParamsException from coinmetrics._typing import ( @@ -172,6 +172,7 @@ def __init__( msg=f"Current state of API Client, excluding API KEY: {state_of_client}" ) + @deprecated("catalog") def catalog_assets( self, assets: Optional[Union[List[str], str]] = None, @@ -195,9 +196,9 @@ def catalog_assets( "include": include, "exclude": exclude, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogAssetsData(self._get_data("catalog/assets", params)["data"]) + @deprecated("catalog") def catalog_asset_alerts( self, assets: Optional[Union[str, List[str]]] = None, @@ -215,11 +216,11 @@ def catalog_asset_alerts( "assets": assets, "alerts": alerts, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogAssetAlertsData( self._get_data("catalog/asset-alerts", params)["data"] ) + @deprecated("catalog") def catalog_asset_chains( self, assets: Optional[Union[str, List[str]]] = None, @@ -234,9 +235,9 @@ def catalog_asset_chains( params: Dict[str, Any] = { "assets": assets, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogAssetChainsData(self._get_data("catalog/asset-chains", params)['data']) + @deprecated("catalog") def catalog_mempool_feerates( self, assets: Optional[Union[str, List[str]]] = None, @@ -251,9 +252,9 @@ def catalog_mempool_feerates( params: Dict[str, Any] = { "assets": assets, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMempoolFeeratesData(self._get_data("catalog/mempool-feerates", params)['data']) + @deprecated("catalog") def catalog_mining_pool_tips_summaries( self, assets: Optional[Union[str, List[str]]] = None, @@ -268,10 +269,10 @@ def catalog_mining_pool_tips_summaries( params: Dict[str, Any] = { "assets": assets, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMiningPoolTipsData(self._get_data("catalog/mining-pool-tips-summary", params)['data']) + @deprecated("catalog") def catalog_transaction_tracker_assets( self, assets: Optional[Union[str, List[str]]] = None, @@ -286,10 +287,10 @@ def catalog_transaction_tracker_assets( params: Dict[str, Any] = { "assets": assets, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogTransactionTrackerData(self._get_data("catalog/transaction-tracker", params)['data']) + @deprecated("catalog") def catalog_asset_pairs( self, asset_pairs: Optional[Union[List[str], str]] = None ) -> CatalogAssetPairsData: @@ -302,9 +303,9 @@ def catalog_asset_pairs( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"pairs": asset_pairs} - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogAssetPairsData(self._get_data("catalog/pairs", params)["data"]) + @deprecated("catalog") def catalog_asset_metrics( self, metrics: Optional[Union[List[str], str]] = None, @@ -322,11 +323,11 @@ def catalog_asset_metrics( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"metrics": metrics, "reviewable": reviewable} - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMetricsData( self._get_data("catalog/asset-metrics", params)["data"] ) + @deprecated("catalog") def catalog_exchange_metrics( self, metrics: Optional[Union[List[str], str]] = None, @@ -344,11 +345,11 @@ def catalog_exchange_metrics( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"metrics": metrics, "reviewable": reviewable} - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMetricsData( self._get_data("catalog/exchange-metrics", params)["data"] ) + @deprecated("catalog") def catalog_exchange_asset_metrics( self, metrics: Optional[Union[List[str], str]] = None, @@ -366,11 +367,11 @@ def catalog_exchange_asset_metrics( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"metrics": metrics, "reviewable": reviewable} - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogExchangeAssetMetricsData( self._get_data("catalog/exchange-asset-metrics", params)["data"] ) + @deprecated("catalog") def catalog_pair_metrics( self, metrics: Optional[Union[List[str], str]] = None, @@ -388,11 +389,11 @@ def catalog_pair_metrics( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"metrics": metrics, "reviewable": reviewable} - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogPairMetricsData( self._get_data("catalog/pair-metrics", params)["data"] ) + @deprecated("catalog") def catalog_institution_metrics( self, metrics: Optional[Union[List[str], str]] = None, @@ -410,11 +411,11 @@ def catalog_institution_metrics( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"metrics": metrics, "reviewable": reviewable} - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogInstitutionMetricsData( self._get_data("catalog/institution-metrics", params)["data"] ) + @deprecated("catalog") def catalog_asset_pair_candles( self, asset_pairs: Optional[Union[List[str], str]] = None ) -> CatalogAssetPairCandlesData: @@ -427,11 +428,11 @@ def catalog_asset_pair_candles( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"pairs": asset_pairs} - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogAssetPairCandlesData( self._get_data("catalog/pair-candles", params)["data"] ) + @deprecated("catalog") def catalog_exchanges( self, exchanges: Optional[Union[List[str], str]] = None ) -> CatalogExchangesData: @@ -444,9 +445,9 @@ def catalog_exchanges( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"exchanges": exchanges} - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogExchangesData(self._get_data("catalog/exchanges", params)["data"]) + @deprecated("catalog") def catalog_exchange_assets( self, exchange_assets: Optional[Union[List[str], str]] = None ) -> CatalogExchangeAssetsData: @@ -459,11 +460,11 @@ def catalog_exchange_assets( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"exchange_assets": exchange_assets} - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogExchangeAssetsData( self._get_data("catalog/exchange-assets", params)["data"] ) + @deprecated("catalog") def catalog_indexes( self, indexes: Optional[Union[List[str], str]] = None ) -> CatalogIndexesData: @@ -476,9 +477,9 @@ def catalog_indexes( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"indexes": indexes} - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogIndexesData(self._get_data("catalog/indexes", params)["data"]) + @deprecated("catalog") def catalog_index_candles( self, indexes: Optional[Union[List[str], str]] = None ) -> CatalogMarketCandlesData: @@ -491,11 +492,11 @@ def catalog_index_candles( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"indexes": indexes} - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMarketCandlesData( self._get_data("catalog/index-candles", params)["data"] ) + @deprecated("catalog") def catalog_institutions( self, institutions: Optional[Union[List[str], str]] = None ) -> CatalogInstitutionsData: @@ -508,11 +509,11 @@ def catalog_institutions( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"institutions": institutions} - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogInstitutionsData( self._get_data("catalog/institutions", params)["data"] ) + @deprecated("catalog") def catalog_markets( self, markets: Optional[Union[List[str], str]] = None, @@ -562,9 +563,10 @@ def catalog_markets( "include": include, "exclude": exclude, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") + logger.warning("Note: catalog/markets is truncated to 170,000 markets!") return CatalogMarketsData(self._get_data("catalog/markets", params)["data"]) + @deprecated("catalog") def catalog_market_trades( self, markets: Optional[Union[List[str], str]] = None, @@ -604,11 +606,11 @@ def catalog_market_trades( "asset": asset, "symbol": symbol, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMarketTradesData( self._get_data("catalog/market-trades", params)["data"] ) + @deprecated("catalog") def catalog_metrics( self, metrics: Optional[Union[List[str], str]] = None, @@ -626,9 +628,9 @@ def catalog_metrics( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"metrics": metrics, "reviewable": reviewable} - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMetricsData(self._get_data("catalog/metrics", params)["data"]) + @deprecated("catalog") def catalog_market_metrics( self, markets: Optional[Union[List[str], str]] = None, @@ -668,11 +670,11 @@ def catalog_market_metrics( "asset": asset, "symbol": symbol, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMarketMetricsData( self._get_data("catalog/market-metrics", params)["data"] ) + @deprecated("catalog") def catalog_market_candles( self, markets: Optional[Union[List[str], str]] = None, @@ -712,11 +714,11 @@ def catalog_market_candles( "asset": asset, "symbol": symbol, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMarketCandlesData( self._get_data("catalog/market-candles", params)["data"] ) + @deprecated("catalog") def catalog_market_orderbooks( self, markets: Optional[Union[List[str], str]] = None, @@ -756,11 +758,11 @@ def catalog_market_orderbooks( "asset": asset, "symbol": symbol, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMarketOrderbooksData( self._get_data("catalog/market-orderbooks", params)["data"] ) + @deprecated("catalog") def catalog_market_quotes( self, markets: Optional[Union[List[str], str]] = None, @@ -800,11 +802,11 @@ def catalog_market_quotes( "asset": asset, "symbol": symbol, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMarketTradesData( self._get_data("catalog/market-quotes", params)["data"] ) + @deprecated("catalog") def catalog_market_funding_rates( self, markets: Optional[Union[List[str], str]] = None, @@ -844,11 +846,11 @@ def catalog_market_funding_rates( "asset": asset, "symbol": symbol, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMarketTradesData( self._get_data("catalog/market-funding-rates", params)["data"] ) + @deprecated("catalog") def catalog_market_contract_prices( self, markets: Optional[Union[str, List[str]]] = None, @@ -895,9 +897,9 @@ def catalog_market_contract_prices( "format": format, "limit": limit, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMarketContractPrices(self._get_data("catalog/market-contract-prices", params)['data']) + @deprecated("catalog") def catalog_market_implied_volatility( self, markets: Optional[Union[str, List[str]]] = None, @@ -944,9 +946,9 @@ def catalog_market_implied_volatility( "format": format, "limit": limit, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMarketImpliedVolatility(self._get_data("catalog/market-implied-volatility", params)['data']) + @deprecated("catalog") def catalog_market_greeks( self, markets: Optional[Union[List[str], str]] = None, @@ -986,11 +988,11 @@ def catalog_market_greeks( "asset": asset, "symbol": symbol, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMarketTradesData( self._get_data("catalog/market-greeks", params)["data"] ) + @deprecated("catalog") def catalog_market_open_interest( self, markets: Optional[Union[List[str], str]] = None, @@ -1030,11 +1032,11 @@ def catalog_market_open_interest( "asset": asset, "symbol": symbol, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMarketTradesData( self._get_data("catalog/market-openinterest", params)["data"] ) + @deprecated("catalog") def catalog_market_liquidations( self, markets: Optional[Union[List[str], str]] = None, @@ -1074,11 +1076,11 @@ def catalog_market_liquidations( "asset": asset, "symbol": symbol, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMarketTradesData( self._get_data("catalog/market-liquidations", params)["data"] ) + @deprecated("catalog") def catalog_full_assets( self, assets: Optional[Union[List[str], str]] = None, @@ -1103,9 +1105,9 @@ def catalog_full_assets( "include": include, "exclude": exclude, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogAssetsData(self._get_data("catalog-all/assets", params)["data"]) + @deprecated("catalog") def catalog_full_asset_metrics( self, metrics: Optional[Union[List[str], str]] = None, @@ -1123,11 +1125,11 @@ def catalog_full_asset_metrics( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"metrics": metrics, "reviewable": reviewable} - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMetricsData( self._get_data("catalog-all/asset-metrics", params)["data"] ) + @deprecated("catalog") def catalog_full_asset_alerts( self, assets: Optional[Union[str, List[str]]] = None, @@ -1145,11 +1147,11 @@ def catalog_full_asset_alerts( "assets": assets, "alerts": alerts, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogAssetAlertsData( self._get_data("catalog-all/asset-alerts", params)["data"] ) + @deprecated("catalog") def catalog_full_asset_chains( self, assets: Optional[Union[str, List[str]]] = None, @@ -1164,9 +1166,9 @@ def catalog_full_asset_chains( params: Dict[str, Any] = { "assets": assets, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogAssetChainsData(self._get_data("catalog-all/asset-chains", params)['data']) + @deprecated("catalog") def catalog_full_mempool_feerates( self, assets: Optional[Union[str, List[str]]] = None, @@ -1181,9 +1183,9 @@ def catalog_full_mempool_feerates( params: Dict[str, Any] = { "assets": assets, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMempoolFeeratesData(self._get_data("catalog-all/mempool-feerates", params)['data']) + @deprecated("catalog") def catalog_full_mining_pool_tips_summaries( self, assets: Optional[Union[str, List[str]]] = None, @@ -1198,9 +1200,9 @@ def catalog_full_mining_pool_tips_summaries( params: Dict[str, Any] = { "assets": assets, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogMiningPoolTipsData(self._get_data("catalog-all/mining-pool-tips-summary", params)['data']) + @deprecated("catalog") def catalog_full_transaction_tracker_assets( self, assets: Optional[Union[str, List[str]]] = None, @@ -1215,9 +1217,9 @@ def catalog_full_transaction_tracker_assets( params: Dict[str, Any] = { "assets": assets, } - logger.warning("catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead.") return CatalogTransactionTrackerData(self._get_data("catalog-all/transaction-tracker", params)['data']) + @deprecated("catalog") def catalog_full_asset_pairs( self, asset_pairs: Optional[Union[List[str], str]] = None, @@ -1231,13 +1233,12 @@ def catalog_full_asset_pairs( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"pairs": asset_pairs} - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogAssetPairsData( self._get_data("catalog-all/pairs", params)["data"] ) + @deprecated("catalog") def catalog_full_pair_metrics( self, metrics: Optional[Union[List[str], str]] = None, @@ -1255,13 +1256,12 @@ def catalog_full_pair_metrics( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"metrics": metrics, "reviewable": reviewable} - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogPairMetricsData( self._get_data("catalog-all/pair-metrics", params)["data"] ) + @deprecated("catalog") def catalog_full_institution_metrics( self, metrics: Optional[Union[List[str], str]] = None, @@ -1279,13 +1279,12 @@ def catalog_full_institution_metrics( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"metrics": metrics, "reviewable": reviewable} - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogInstitutionMetricsData( self._get_data("catalog-all/institution-metrics", params)["data"] ) + @deprecated("catalog") def catalog_full_asset_pair_candles( self, asset_pairs: Optional[Union[List[str], str]] = None ) -> CatalogAssetPairCandlesData: @@ -1298,13 +1297,12 @@ def catalog_full_asset_pair_candles( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"pairs": asset_pairs} - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogAssetPairCandlesData( self._get_data("catalog-all/pair-candles", params)["data"] ) + @deprecated("catalog") def catalog_full_exchanges( self, exchanges: Optional[Union[List[str], str]] = None, @@ -1319,13 +1317,12 @@ def catalog_full_exchanges( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"exchanges": exchanges} - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogExchangesData( self._get_data("catalog-all/exchanges", params)["data"] ) + @deprecated("catalog") def catalog_full_exchange_assets( self, exchange_assets: Optional[Union[List[str], str]] = None ) -> CatalogExchangeAssetsData: @@ -1338,13 +1335,12 @@ def catalog_full_exchange_assets( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"exchange_assets": exchange_assets} - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogExchangeAssetsData( self._get_data("catalog-all/exchange-assets", params)["data"] ) + @deprecated("catalog") def catalog_full_exchange_metrics( self, metrics: Optional[Union[List[str], str]] = None, @@ -1362,13 +1358,12 @@ def catalog_full_exchange_metrics( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"metrics": metrics, "reviewable": reviewable} - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogMetricsData( self._get_data("catalog-all/exchange-metrics", params)["data"] ) + @deprecated("catalog") def catalog_full_exchange_asset_metrics( self, metrics: Optional[Union[List[str], str]] = None, @@ -1386,13 +1381,12 @@ def catalog_full_exchange_asset_metrics( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"metrics": metrics, "reviewable": reviewable} - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogExchangeAssetMetricsData( self._get_data("catalog-all/exchange-asset-metrics", params)["data"] ) + @deprecated("catalog") def catalog_full_indexes( self, indexes: Optional[Union[List[str], str]] = None ) -> CatalogIndexesData: @@ -1405,11 +1399,10 @@ def catalog_full_indexes( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"indexes": indexes} - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogIndexesData(self._get_data("catalog-all/indexes", params)["data"]) + @deprecated("catalog") def catalog_full_index_candles( self, indexes: Optional[Union[List[str], str]] = None ) -> CatalogMarketCandlesData: @@ -1422,13 +1415,12 @@ def catalog_full_index_candles( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"indexes": indexes} - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogMarketCandlesData( self._get_data("catalog-all/index-candles", params)["data"] ) + @deprecated("catalog") def catalog_full_institutions( self, institutions: Optional[Union[List[str], str]] = None ) -> CatalogInstitutionsData: @@ -1441,13 +1433,12 @@ def catalog_full_institutions( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"institutions": institutions} - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogInstitutionsData( self._get_data("catalog-all/institutions", params)["data"] ) + @deprecated("catalog") def catalog_full_markets( self, markets: Optional[Union[List[str], str]] = None, @@ -1497,11 +1488,10 @@ def catalog_full_markets( "include": include, "exclude": exclude, } - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogMarketsData(self._get_data("catalog-all/markets", params)["data"]) + @deprecated("catalog") def catalog_full_market_trades( self, markets: Optional[Union[List[str], str]] = None, @@ -1541,13 +1531,12 @@ def catalog_full_market_trades( "asset": asset, "symbol": symbol, } - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogMarketTradesData( self._get_data("catalog-all/market-trades", params)["data"] ) + @deprecated("catalog") def catalog_full_metrics( self, metrics: Optional[Union[List[str], str]] = None, @@ -1565,11 +1554,10 @@ def catalog_full_metrics( :rtype: list(dict(str, any)) """ params: Dict[str, Any] = {"metrics": metrics, "reviewable": reviewable} - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogMetricsData(self._get_data("catalog-all/metrics", params)["data"]) + @deprecated("catalog") def catalog_full_market_metrics( self, markets: Optional[Union[List[str], str]] = None, @@ -1609,13 +1597,12 @@ def catalog_full_market_metrics( "asset": asset, "symbol": symbol, } - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogMarketMetricsData( self._get_data("catalog-all/market-metrics", params)["data"] ) + @deprecated("catalog") def catalog_full_market_candles( self, markets: Optional[Union[List[str], str]] = None, @@ -1655,13 +1642,12 @@ def catalog_full_market_candles( "asset": asset, "symbol": symbol, } - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogMarketCandlesData( self._get_data("catalog-all/market-candles", params)["data"] ) + @deprecated("catalog") def catalog_full_market_orderbooks( self, markets: Optional[Union[List[str], str]] = None, @@ -1701,13 +1687,12 @@ def catalog_full_market_orderbooks( "asset": asset, "symbol": symbol, } - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogMarketTradesData( self._get_data("catalog-all/market-orderbooks", params)["data"] ) + @deprecated("catalog") def catalog_full_market_quotes( self, markets: Optional[Union[List[str], str]] = None, @@ -1747,13 +1732,12 @@ def catalog_full_market_quotes( "asset": asset, "symbol": symbol, } - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogMarketTradesData( self._get_data("catalog-all/market-quotes", params)["data"] ) + @deprecated("catalog") def catalog_full_market_funding_rates( self, markets: Optional[Union[List[str], str]] = None, @@ -1793,13 +1777,12 @@ def catalog_full_market_funding_rates( "asset": asset, "symbol": symbol, } - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogMarketTradesData( self._get_data("catalog-all/market-funding-rates", params)["data"] ) + @deprecated("catalog") def catalog_full_market_contract_prices( self, markets: Optional[Union[str, List[str]]] = None, @@ -1846,9 +1829,7 @@ def catalog_full_market_contract_prices( "format": format, "limit": limit, } - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogMarketContractPrices(self._get_data("catalog-all/market-contract-prices", params)['data']) def catalog_full_contract_prices_v2( @@ -1954,9 +1935,7 @@ def catalog_full_market_implied_volatility( "format": format, "limit": limit, } - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogMarketImpliedVolatility(self._get_data("catalog-all/market-implied-volatility", params)['data']) def catalog_full_market_greeks( @@ -1998,9 +1977,7 @@ def catalog_full_market_greeks( "asset": asset, "symbol": symbol, } - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogMarketTradesData( self._get_data("catalog-all/market-greeks", params)["data"] ) @@ -2044,9 +2021,7 @@ def catalog_full_market_open_interest( "asset": asset, "symbol": symbol, } - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogMarketTradesData( self._get_data("catalog-all/market-openinterest", params)["data"] ) @@ -2090,9 +2065,7 @@ def catalog_full_market_liquidations( "asset": asset, "symbol": symbol, } - logger.warning( - "catalog/ endpoints will be deprecated in the future. Consider using /catalog-v2/ and /reference-data/ endpoints instead." - ) + return CatalogMarketTradesData( self._get_data("catalog-all/market-liquidations", params)["data"] ) @@ -4273,7 +4246,14 @@ def catalog_full_pair_candles_v2( "next_page_token": next_page_token, "format": format } - return CatalogV2DataCollection(self._get_data, "catalog-all-v2/pair-candles", params, client=self) + return CatalogV2DataCollection( + self._get_data, + "catalog-all-v2/pair-candles", + params, + iterable_col="frequencies", + iterable_key="frequency", + client=self + ) def catalog_full_index_candles_v2( self, @@ -4499,7 +4479,7 @@ def catalog_blockchain_accounts_v2( :param format: Default: "json_stream" (Python API Client). Format of the response. Supported values are json, json_stream. Setting format='json_stream' is generally more performant. page_size is ignored when format='json_stream'. :type format: Optional[str] - :return: List of blockchain-v2/accounts assets + :return: List of blockchain-v2/accounts assets using catalog-v2 :rtype: CatalogV2DataCollection """ params: Dict[str, Any] = { @@ -4531,7 +4511,7 @@ def catalog_blockchain_balance_updates_v2( :param format: Default: "json_stream" (Python API Client). Format of the response. Supported values are json, json_stream. Setting format='json_stream' is generally more performant. page_size is ignored when format='json_stream'. :type format: Optional[str] - :return: List of blockchain-v2/balance-updates assets + :return: List of blockchain-v2/balance-updates assets using catalog-v2 :rtype: CatalogV2DataCollection """ params: Dict[str, Any] = { @@ -4563,7 +4543,7 @@ def catalog_blockchain_blocks_v2( :param format: Default: "json_stream" (Python API Client). Format of the response. Supported values are json, json_stream. Setting format='json_stream' is generally more performant. page_size is ignored when format='json_stream'. :type format: Optional[str] - :return: List of blockchain-v2/blocks assets + :return: List of blockchain-v2/blocks assets using catalog-v2 :rtype: CatalogV2DataCollection """ params: Dict[str, Any] = { @@ -4595,7 +4575,7 @@ def catalog_blockchain_transactions_v2( :param format: Default: "json_stream" (Python API Client). Format of the response. Supported values are json, json_stream. Setting format='json_stream' is generally more performant. page_size is ignored when format='json_stream'. :type format: Optional[str] - :return: List of blockchain-v2/transactions assets + :return: List of blockchain-v2/transactions assets using catalog-v2 :rtype: CatalogV2DataCollection """ params: Dict[str, Any] = { @@ -4627,7 +4607,7 @@ def catalog_full_blockchain_accounts_v2( :param format: Default: "json_stream" (Python API Client). Format of the response. Supported values are json, json_stream. Setting format='json_stream' is generally more performant. page_size is ignored when format='json_stream'. :type format: Optional[str] - :return: Full list of blockchain-v2/accounts assets + :return: Full list of blockchain-v2/accounts assets using catalog-v2 :rtype: CatalogV2DataCollection """ params: Dict[str, Any] = { @@ -4659,7 +4639,7 @@ def catalog_full_blockchain_balance_updates_v2( :param format: Default: "json_stream" (Python API Client). Format of the response. Supported values are json, json_stream. Setting format='json_stream' is generally more performant. page_size is ignored when format='json_stream'. :type format: Optional[str] - :return: Full list of blockchain-v2/balance-updates assets + :return: Full list of blockchain-v2/balance-updates assets using catalog-v2 :rtype: CatalogV2DataCollection """ params: Dict[str, Any] = { @@ -4691,7 +4671,7 @@ def catalog_full_blockchain_blocks_v2( :param format: Default: "json_stream" (Python API Client). Format of the response. Supported values are json, json_stream. Setting format='json_stream' is generally more performant. page_size is ignored when format='json_stream'. :type format: Optional[str] - :return: Full list of blockchain-v2/blocks assets + :return: Full list of blockchain-v2/blocks assets using catalog-v2 :rtype: CatalogV2DataCollection """ params: Dict[str, Any] = { @@ -4723,7 +4703,7 @@ def catalog_full_blockchain_transactions_v2( :param format: Default: "json_stream" (Python API Client). Format of the response. Supported values are json, json_stream. Setting format='json_stream' is generally more performant. page_size is ignored when format='json_stream'. :type format: Optional[str] - :return: Full list of blockchain-v2/transactions assets + :return: Full list of blockchain-v2/transactions assets using catalog-v2 :rtype: CatalogV2DataCollection """ params: Dict[str, Any] = { diff --git a/docs/docs/api_client.md b/docs/docs/api_client.md index 3b5f14d..f4e5ac3 100644 --- a/docs/docs/api_client.md +++ b/docs/docs/api_client.md @@ -15,6 +15,7 @@ class CoinMetricsClient() #### catalog\_assets ```python +@deprecated("catalog") def catalog_assets( assets: Optional[Union[List[str], str]] = None, include: Optional[Union[List[str], str]] = None, @@ -38,6 +39,7 @@ Returns meta information about _available_ assets. #### catalog\_asset\_alerts ```python +@deprecated("catalog") def catalog_asset_alerts( assets: Optional[Union[str, List[str]]] = None, alerts: Optional[Union[str, @@ -58,6 +60,7 @@ def catalog_asset_alerts( #### catalog\_asset\_chains ```python +@deprecated("catalog") def catalog_asset_chains( assets: Optional[Union[str, List[str]]] = None) -> CatalogAssetChainsData @@ -76,6 +79,7 @@ def catalog_asset_chains( #### catalog\_mempool\_feerates ```python +@deprecated("catalog") def catalog_mempool_feerates( assets: Optional[Union[str, List[str]]] = None) -> CatalogMempoolFeeratesData @@ -94,6 +98,7 @@ def catalog_mempool_feerates( #### catalog\_mining\_pool\_tips\_summaries ```python +@deprecated("catalog") def catalog_mining_pool_tips_summaries( assets: Optional[Union[str, List[str]]] = None) -> CatalogMiningPoolTipsData @@ -112,6 +117,7 @@ def catalog_mining_pool_tips_summaries( #### catalog\_transaction\_tracker\_assets ```python +@deprecated("catalog") def catalog_transaction_tracker_assets( assets: Optional[Union[str, List[str]]] = None ) -> CatalogTransactionTrackerData @@ -130,6 +136,7 @@ def catalog_transaction_tracker_assets( #### catalog\_asset\_pairs ```python +@deprecated("catalog") def catalog_asset_pairs( asset_pairs: Optional[Union[List[str], str]] = None) -> CatalogAssetPairsData @@ -150,6 +157,7 @@ Returns meta information about _available_ asset-asset pairs #### catalog\_asset\_metrics ```python +@deprecated("catalog") def catalog_asset_metrics( metrics: Optional[Union[List[str], str]] = None, reviewable: Optional[bool] = None) -> CatalogMetricsData @@ -173,6 +181,7 @@ description, category, precision and assets for which a metric is available. #### catalog\_exchange\_metrics ```python +@deprecated("catalog") def catalog_exchange_metrics( metrics: Optional[Union[List[str], str]] = None, reviewable: Optional[bool] = None) -> CatalogMetricsData @@ -196,6 +205,7 @@ description, category, precision and assets for which a metric is available. #### catalog\_exchange\_asset\_metrics ```python +@deprecated("catalog") def catalog_exchange_asset_metrics( metrics: Optional[Union[List[str], str]] = None, reviewable: Optional[bool] = None) -> CatalogExchangeAssetMetricsData @@ -219,6 +229,7 @@ description, category, precision and assets for which a metric is available. #### catalog\_pair\_metrics ```python +@deprecated("catalog") def catalog_pair_metrics( metrics: Optional[Union[List[str], str]] = None, reviewable: Optional[bool] = None) -> CatalogPairMetricsData @@ -242,6 +253,7 @@ description, category, precision and assets for which a metric is available. #### catalog\_institution\_metrics ```python +@deprecated("catalog") def catalog_institution_metrics( metrics: Optional[Union[List[str], str]] = None, reviewable: Optional[bool] = None) -> CatalogInstitutionMetricsData @@ -265,6 +277,7 @@ description, category, precision and assets for which a metric is available. #### catalog\_asset\_pair\_candles ```python +@deprecated("catalog") def catalog_asset_pair_candles( asset_pairs: Optional[Union[List[str], str]] = None ) -> CatalogAssetPairCandlesData @@ -285,6 +298,7 @@ Returns meta information about _available_ asset-asset pairs #### catalog\_exchanges ```python +@deprecated("catalog") def catalog_exchanges( exchanges: Optional[Union[List[str], str]] = None) -> CatalogExchangesData @@ -305,6 +319,7 @@ Returns meta information about exchanges. #### catalog\_exchange\_assets ```python +@deprecated("catalog") def catalog_exchange_assets( exchange_assets: Optional[Union[List[str], str]] = None ) -> CatalogExchangeAssetsData @@ -325,6 +340,7 @@ Returns meta information about _available_ exchange-asset pairs #### catalog\_indexes ```python +@deprecated("catalog") def catalog_indexes( indexes: Optional[Union[List[str], str]] = None) -> CatalogIndexesData ``` @@ -344,6 +360,7 @@ Returns meta information about _available_ indexes. #### catalog\_index\_candles ```python +@deprecated("catalog") def catalog_index_candles( indexes: Optional[Union[List[str], str]] = None) -> CatalogMarketCandlesData @@ -364,6 +381,7 @@ Returns meta information about _available_ index candles. #### catalog\_institutions ```python +@deprecated("catalog") def catalog_institutions( institutions: Optional[Union[List[str], str]] = None ) -> CatalogInstitutionsData @@ -384,6 +402,7 @@ Returns meta information about _available_ institutions #### catalog\_markets ```python +@deprecated("catalog") def catalog_markets( markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, @@ -421,6 +440,7 @@ quotes, funding_rates, openinterest, liquidations. Included by default if omitte #### catalog\_market\_trades ```python +@deprecated("catalog") def catalog_market_trades( markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, @@ -452,6 +472,7 @@ Returns a list of markets with trades support along with the time ranges of avai #### catalog\_metrics ```python +@deprecated("catalog") def catalog_metrics(metrics: Optional[Union[List[str], str]] = None, reviewable: Optional[bool] = None) -> CatalogMetricsData ``` @@ -474,6 +495,7 @@ description, category, precision and assets for which a metric is available. #### catalog\_market\_metrics ```python +@deprecated("catalog") def catalog_market_metrics( markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, @@ -505,6 +527,7 @@ Returns list of _available_ markets with metrics support along woth time ranges #### catalog\_market\_candles ```python +@deprecated("catalog") def catalog_market_candles( markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, @@ -536,6 +559,7 @@ Returns list of _available_ markets with candles support along woth time ranges #### catalog\_market\_orderbooks ```python +@deprecated("catalog") def catalog_market_orderbooks( markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, @@ -567,6 +591,7 @@ Returns a list of markets with orderbooks support along with the time ranges of #### catalog\_market\_quotes ```python +@deprecated("catalog") def catalog_market_quotes( markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, @@ -598,6 +623,7 @@ Returns a list of markets with quotes support along with the time ranges of avai #### catalog\_market\_funding\_rates ```python +@deprecated("catalog") def catalog_market_funding_rates( markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, @@ -629,6 +655,7 @@ Returns a list of markets with funding rates support along with the time ranges #### catalog\_market\_contract\_prices ```python +@deprecated("catalog") def catalog_market_contract_prices( markets: Optional[Union[str, List[str]]] = None, exchange: Optional[str] = None, @@ -662,6 +689,7 @@ def catalog_market_contract_prices( #### catalog\_market\_implied\_volatility ```python +@deprecated("catalog") def catalog_market_implied_volatility( markets: Optional[Union[str, List[str]]] = None, exchange: Optional[str] = None, @@ -695,6 +723,7 @@ def catalog_market_implied_volatility( #### catalog\_market\_greeks ```python +@deprecated("catalog") def catalog_market_greeks( markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, @@ -726,6 +755,7 @@ Returns a list of markets with greeks support along with the time ranges of avai #### catalog\_market\_open\_interest ```python +@deprecated("catalog") def catalog_market_open_interest( markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, @@ -757,6 +787,7 @@ Returns a list of markets with open interest support along with the time ranges #### catalog\_market\_liquidations ```python +@deprecated("catalog") def catalog_market_liquidations( markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, @@ -788,6 +819,7 @@ Returns a list of markets with liquidations support along with the time ranges o #### catalog\_full\_assets ```python +@deprecated("catalog") def catalog_full_assets( assets: Optional[Union[List[str], str]] = None, include: Optional[Union[List[str], str]] = None, @@ -813,6 +845,7 @@ exchanges. Included by default if omitted. #### catalog\_full\_asset\_metrics ```python +@deprecated("catalog") def catalog_full_asset_metrics( metrics: Optional[Union[List[str], str]] = None, reviewable: Optional[bool] = None) -> CatalogMetricsData @@ -836,6 +869,7 @@ description, category, precision and assets for which a metric is available. #### catalog\_full\_asset\_alerts ```python +@deprecated("catalog") def catalog_full_asset_alerts( assets: Optional[Union[str, List[str]]] = None, alerts: Optional[Union[str, @@ -856,6 +890,7 @@ def catalog_full_asset_alerts( #### catalog\_full\_asset\_chains ```python +@deprecated("catalog") def catalog_full_asset_chains( assets: Optional[Union[str, List[str]]] = None) -> CatalogAssetChainsData @@ -874,6 +909,7 @@ def catalog_full_asset_chains( #### catalog\_full\_mempool\_feerates ```python +@deprecated("catalog") def catalog_full_mempool_feerates( assets: Optional[Union[str, List[str]]] = None) -> CatalogMempoolFeeratesData @@ -892,6 +928,7 @@ def catalog_full_mempool_feerates( #### catalog\_full\_mining\_pool\_tips\_summaries ```python +@deprecated("catalog") def catalog_full_mining_pool_tips_summaries( assets: Optional[Union[str, List[str]]] = None) -> CatalogMiningPoolTipsData @@ -910,6 +947,7 @@ def catalog_full_mining_pool_tips_summaries( #### catalog\_full\_transaction\_tracker\_assets ```python +@deprecated("catalog") def catalog_full_transaction_tracker_assets( assets: Optional[Union[str, List[str]]] = None ) -> CatalogTransactionTrackerData @@ -928,6 +966,7 @@ def catalog_full_transaction_tracker_assets( #### catalog\_full\_asset\_pairs ```python +@deprecated("catalog") def catalog_full_asset_pairs( asset_pairs: Optional[Union[List[str], str]] = None) -> CatalogAssetPairsData @@ -948,6 +987,7 @@ Returns meta information about _supported_ asset-asset pairs #### catalog\_full\_pair\_metrics ```python +@deprecated("catalog") def catalog_full_pair_metrics( metrics: Optional[Union[List[str], str]] = None, reviewable: Optional[bool] = None) -> CatalogPairMetricsData @@ -971,6 +1011,7 @@ description, category, precision and assets for which a metric is available. #### catalog\_full\_institution\_metrics ```python +@deprecated("catalog") def catalog_full_institution_metrics( metrics: Optional[Union[List[str], str]] = None, reviewable: Optional[bool] = None) -> CatalogInstitutionMetricsData @@ -994,6 +1035,7 @@ description, category, precision and assets for which a metric is available. #### catalog\_full\_asset\_pair\_candles ```python +@deprecated("catalog") def catalog_full_asset_pair_candles( asset_pairs: Optional[Union[List[str], str]] = None ) -> CatalogAssetPairCandlesData @@ -1014,6 +1056,7 @@ Returns meta information about _available_ asset-asset pairs #### catalog\_full\_exchanges ```python +@deprecated("catalog") def catalog_full_exchanges( exchanges: Optional[Union[List[str], str]] = None) -> CatalogExchangesData @@ -1035,6 +1078,7 @@ all supported exchanges are returned. #### catalog\_full\_exchange\_assets ```python +@deprecated("catalog") def catalog_full_exchange_assets( exchange_assets: Optional[Union[List[str], str]] = None ) -> CatalogExchangeAssetsData @@ -1055,6 +1099,7 @@ Returns meta information about _supported_ exchange-asset pairs #### catalog\_full\_exchange\_metrics ```python +@deprecated("catalog") def catalog_full_exchange_metrics( metrics: Optional[Union[List[str], str]] = None, reviewable: Optional[bool] = None) -> CatalogMetricsData @@ -1078,6 +1123,7 @@ description, category, precision and assets for which a metric is available. #### catalog\_full\_exchange\_asset\_metrics ```python +@deprecated("catalog") def catalog_full_exchange_asset_metrics( metrics: Optional[Union[List[str], str]] = None, reviewable: Optional[bool] = None) -> CatalogExchangeAssetMetricsData @@ -1101,6 +1147,7 @@ description, category, precision and assets for which a metric is available. #### catalog\_full\_indexes ```python +@deprecated("catalog") def catalog_full_indexes( indexes: Optional[Union[List[str], str]] = None) -> CatalogIndexesData ``` @@ -1120,6 +1167,7 @@ Returns meta information about _supported_ indexes. #### catalog\_full\_index\_candles ```python +@deprecated("catalog") def catalog_full_index_candles( indexes: Optional[Union[List[str], str]] = None) -> CatalogMarketCandlesData @@ -1140,6 +1188,7 @@ Returns meta information about _supported_ index candles. #### catalog\_full\_institutions ```python +@deprecated("catalog") def catalog_full_institutions( institutions: Optional[Union[List[str], str]] = None ) -> CatalogInstitutionsData @@ -1160,6 +1209,7 @@ Returns meta information about _supported_ institutions #### catalog\_full\_markets ```python +@deprecated("catalog") def catalog_full_markets(markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, exchange: Optional[str] = None, @@ -1196,6 +1246,7 @@ funding_rates, openinterest, liquidations. Included by default if omitted. #### catalog\_full\_market\_trades ```python +@deprecated("catalog") def catalog_full_market_trades( markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, @@ -1227,6 +1278,7 @@ Returns a list of all markets with trades support along with the time ranges of #### catalog\_full\_metrics ```python +@deprecated("catalog") def catalog_full_metrics( metrics: Optional[Union[List[str], str]] = None, reviewable: Optional[bool] = None) -> CatalogMetricsData @@ -1250,6 +1302,7 @@ description, category, precision and assets for which a metric is supported. #### catalog\_full\_market\_metrics ```python +@deprecated("catalog") def catalog_full_market_metrics( markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, @@ -1281,6 +1334,7 @@ Returns list of _supported_ markets with metrics support along woth time ranges #### catalog\_full\_market\_candles ```python +@deprecated("catalog") def catalog_full_market_candles( markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, @@ -1312,6 +1366,7 @@ Returns list of _available_ markets with candles support along woth time ranges #### catalog\_full\_market\_orderbooks ```python +@deprecated("catalog") def catalog_full_market_orderbooks( markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, @@ -1343,6 +1398,7 @@ Returns a list of markets with orderbooks support along with the time ranges of #### catalog\_full\_market\_quotes ```python +@deprecated("catalog") def catalog_full_market_quotes( markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, @@ -1374,6 +1430,7 @@ Returns a list of markets with quotes support along with the time ranges of avai #### catalog\_full\_market\_funding\_rates ```python +@deprecated("catalog") def catalog_full_market_funding_rates( markets: Optional[Union[List[str], str]] = None, market_type: Optional[str] = None, @@ -1405,6 +1462,7 @@ Returns a list of all markets with funding rates support along with the time ran #### catalog\_full\_market\_contract\_prices ```python +@deprecated("catalog") def catalog_full_market_contract_prices( markets: Optional[Union[str, List[str]]] = None, exchange: Optional[str] = None, diff --git a/docs/processors/pydoc_markdown_processors.py b/docs/processors/pydoc_markdown_processors.py new file mode 100644 index 0000000..daffaac --- /dev/null +++ b/docs/processors/pydoc_markdown_processors.py @@ -0,0 +1,9 @@ +from pydoc_markdown.interfaces import Processor + + +class DeprecationProcessor(Processor): + def process(self, graph): + for module in graph.modules: + for obj in module.members.values(): + if obj.decorators and 'deprecated' in obj.decorators: + obj.docstring = f"**Deprecated:** {obj.docstring or ''}" diff --git a/pydoc-markdown.yml b/pydoc-markdown.yml index 9c070e0..3c98a16 100644 --- a/pydoc-markdown.yml +++ b/pydoc-markdown.yml @@ -4,3 +4,4 @@ processors: - type: filter - type: smart - type: crossref + - python_file: docs/processors/pydoc_markdown_processors.py