cryptodatapy.util.datacatalog

Classes

DataCatalog

Data catalog which makes it easy to find, extract, use, and share CryptoDataPy datasets.

Module Contents

class cryptodatapy.util.datacatalog.DataCatalog

Data catalog which makes it easy to find, extract, use, and share CryptoDataPy datasets.

Parameters:

data_sources (str) – Name and url of available data sources.

data_sources: Dict
static get_tickers_metadata(tickers: str | List[str] | None = None, country_id_2: str | None = None, country_id_3: str | None = None, country_name: str | None = None, agg: str | None = None, cat: str | None = None, subcat: str | None = None, mkt_type: str | None = None, quote_ccy: str | None = None, as_list=False)

Gets ticker metadata. Excludes individual equity and cryptoasset tickers.

Parameters:
  • tickers (str or list, optional, default None) – Tickers for which to get metadata.

  • country_id_2 (str, optional, default None) – Country code for which to filter tickers, ISO 3166-1 alpha-2 format.

  • country_id_3 (str, optional, default None) – Country code for which to filter tickers, ISO 3166-1 alpha-3 format.

  • country_name (str, optional, default None) – Country name for which to filer tickers.

  • agg (str, {'DM', 'EM', 'WL', 'Euro zone'}, optional, default None) – Country aggregate.

  • cat (str, {'crypto', 'fx', 'cmdty', 'eqty', 'rates', 'bonds', 'credit', 'macro', 'alt'}) – Tickers category.

  • subcat (str, { 'spot rate', 'index', 'effective exchange rate', 'yield', 'swap rate', 'real yield',) –

    ‘inflation’, ‘spread’, ‘etf’, ‘vol’, ‘reit’, ‘industrial metals’, ‘grains’, ‘energy’, ‘softs’,

    ’livestock’, ‘precious metals’, ‘growth’, ‘unemployment’, ‘money’, ‘credit’, ‘property’}, optional, default None

    Tickers subcategory.

  • mkt_type (str, {'spot', 'etf', 'perpetual_future', 'future', 'swap', 'option'}, optional, default None) – Market type, e.g. ‘spot ‘, ‘future’, ‘perpetual_future’, ‘option’.

  • quote_ccy (str, optional, default None) – Quote currency for base asset, e.g. ‘GBP’ for EURGBP, ‘USD’ for BTCUSD (bitcoin in dollars), etc.

  • as_list (bool, default False) – Returns requested tickers as list.

Returns:

tickers_df – DataFrame with requested tickers metadata.

Return type:

pd.DataFrame

static search_tickers(by_col: str | None = None, keyword: str | None = None)

Searches for tickers metadata.

Parameters:
  • by_col (str, optional, default None) – Column by which to search.

  • keyword (str, optional, default None) – Keyword for which to search.

Returns:

tickers_df – DataFrame with requested tickers metadata.

Return type:

pd.DataFrame

static get_fields_metadata(fields: str | List[str] | None = None, name: str | None = None, cat: str | None = None, subcat: str | None = None, as_list=False)

Gets fields metadata.

Parameters:
  • fields (str or list, optional, default None) – Field ids for which to get metadata.

  • name (str, optional, default None) – Name of fields for which to get metadata.

  • cat (str, {'all', 'market', 'on-chain', 'off-chain'}, optional, default None) – Fields category, i.e. type of data.

  • subcat (str, optional, default None) – Fields subcategory.

  • as_list (bool, False) – Returns requested fields as list.

Returns:

fields_df – DataFrame with requested fields metadata.

Return type:

pd.DataFrame

static search_fields(by_col: str | None = None, keyword: str | None = None)

Searches for fields metadata.

Parameters:
  • by_col (str, optional, default None) – Column by which to search.

  • keyword (str, optional, default None) – Keyword for which to search.

Returns:

fields_df – DataFrame with fields metadata.

Return type:

pd.DataFrame

static scrape_stablecoins(source: str = 'coingecko', rank_by: str = 'mkt_cap', as_list=False) pandas.DataFrame | list

Web scrapes stablecoin information from websites.

Parameters:
  • source (str, {'coinmarketcap', 'coingecko'}, default 'coingecko') – Website from which to scrape list of stablecoins.

  • rank_by (str, default 'mkt_cap') – Metrics by which to rank stablecoins.

  • as_list (bool, default False) – Return stablecoins tickers as list.

Returns:

sc – DataFrame with stablecoin info or list of stablecoin tickers.

Return type:

Pd.Dataframe or list