Community¶
The Community
class is an extension of the the Base class and in inherits all of the Base
class’ functionality.
Primary Methods¶
-
class
coinmetrics.community.
Community
(api_key='')¶ Coin Metrics API Community Object
-
__init__
(api_key='')¶ Initialize the Community API exactly the same way as the same way as
coinmetrics.base.Base.__init__()
. An optionalapi_key
can be supplied.- Parameters
api_key (str, optional) – API key to be used for the Pro API.
-
get_asset_info
(assets='')¶ Fetch asset(s) information. Including exchanges the asset is in, friendly name, markets, metrics, and most recent and oldest data timestamps. No specified asset will return all available asset info.
- Parameters
assets (str, optional) – Unique ID corresponding to the asset’s ticker.
- Returns
Asset information.
- Return type
list of dict
-
get_exchange_info
(exchanges='')¶ Fetch exchange(s) information. Including assets, quotes, markets, and most recent and oldest data timestamps for each. No specified exchange will return all available exchange info.
- Parameters
exchanges (str, optional) – Unique ID corresponding to the exchange.
- Returns
Exchange information.
- Return type
list of dict
-
get_metric_info
(metrics='')¶ Fetch metric(s) information. Including friendly name, dscription, category.
- Parameters
metrics (str, optional) – Unique ID corresponding to the metrics.
- Returns
Metric information.
- Return type
list of dict
-
get_market_info
(markets='')¶ Fetch market(s) information. Includes assets, quotes, and most recent and oldest data timestamps for each.
- Parameters
markets (str, optional) – Unique ID corresponding to the market.
- Returns
Market information.
- Return type
list of dict
-
get_asset_metric_data
(asset, metrics, start, end, time_agg='day')¶ Fetch metric(s) data given a specified asset, and timeframe. See: Data Dictionary.
- Parameters
asset (str) – Unique ID corresponding to the asset’s ticker.
metrics (str) – Unique ID corresponding to the metrics.
begin_timestamp (str or datetime) – Start of time inverval.
end_timestamp (str or datetime) – End of time inverval.
time_agg (str) – Interval the time is descritized into: day, hour.
- Returns
Coin Metrics API data object. See the API reference for details
- Return type
dict
-
Conveniance Methods¶
The methods are designed to provide a simple way to get a single metric, and essentially extend the coinmetrics.community.Community.get_asset_metric_data()
method.
-
class
coinmetrics.community.
Community
(api_key='') Coin Metrics API Community Object
-
get_available_data_types_for_asset
(asset)¶ An alias for
get_asset_metrics()
(backwards compatibility)
-
get_asset_data_for_time_range
(asset, metrics, start, end, time_agg='day')¶ An alias for
get_asset_metric_data()
(backwards compatibility)
-
get_active_addresses
(assets, start, end)¶ The sum count of unique addresses that were active in the network (either as a recipient or originator of a ledger change) that day. All parties in a ledger change action (recipients and originators) are counted. Individual addresses are not double-counted if previously active. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_block_count
(assets, start, end)¶ The sum count of unique addresses that were active in the network (either as a recipient or originator of a ledger change) that day. All parties in a ledger change action (recipients and originators) are counted. Individual addresses are not double-counted if previously active. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_mean_block_size
(assets, start, end)¶ The mean size (in bytes) of all blocks created that day. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_mvrv_cur
(assets, start, end)¶ The ratio of the sum USD value of the current supply to the sum “realized” USD value of the current supply. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_real_cap
(assets, start, end)¶ The sum USD value based on the USD closing price on the day that a native unit last moved (i.e., last transacted) for all native units. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_diff_mean
(assets, start, end)¶ The mean difficulty of finding a hash that meets the protocol designated requirement (i.e., the difficulty of finding a new block) that day. The requirement is unique to each applicable cryptocurrency protocol. Difficulty is adjusted periodically by the protocol as a function of how much hashing power is being deployed by miners. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_fee_mean
(assets, start, end)¶ The USD value of the mean fee per transaction that day. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_median_fee
(assets, start, end)¶ The USD value of the median fee per transaction that day. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_fee_total
(assets, start, end)¶ The sum USD value of all fees paid to miners that day. Fees do not include new issuance. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_units_issued
(assets, start, end)¶ The sum of new native units issued that day. Only those native units that are issued by a protocol-mandated continuous emission schedule are included. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_units_issued_ann_pct
(assets, start, end)¶ The percentage of new native units (continuous) issued on that day, extrapolated to one year (i.e., multiplied by 365), and divided by the current supply on that day. Also referred to as the annual inflation rate. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_units_issued_usd
(assets, start, end)¶ The sum USD value of all new native units issued that day. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_nvt_adj
(assets, start, end)¶ The ratio of the network value (or market capitalization, current supply) divided by the adjusted transfer value. Also referred to as NVT. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_nvt_adj_90
(assets, start, end)¶ The ratio of the network value (or market capitalization, current supply) to the 90-day moving average of the adjusted transfer value. Also referred to as NVT. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_price_btc
(assets, start, end)¶ The fixed closing price of the asset as of 00:00 UTC the following day (i.e., midnight UTC of the current day) denominated in USD. This price is generated by Coin Metrics’ fixing/reference rate service. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_price_usd
(assets, start, end)¶ The fixed closing price of the asset as of 00:00 UTC the following day (i.e., midnight UTC of the current day) denominated in BTC. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_cur_sply
(assets, start, end)¶ The sum of all native units ever created and visible on the ledger (i.e., issued) as of that day. For account-based protocols, only accounts with positive balances are counted. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_tx_count
(assets, start, end)¶ The sum count of transactions that day. Transactions represent a bundle of intended actions to alter the ledger initiated by a user (human or machine). See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_txtfr_count
(assets, start, end)¶ The sum count of transfers that day. Transfers represent movements of native units from one ledger entity to another distinct ledger entity. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_txtfr_val_adj
(assets, start, end)¶ The sum of native units transferred that day removing noise and certain artifacts. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_txtfr_val_adj_usd
(assets, start, end)¶ The USD value of the sum of native units transferred that day removing noise and certain artifacts. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_txtfr_val_mean
(assets, start, end)¶ The mean count of native units transferred per transaction (i.e., the mean “size” of a transaction) that day. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_txtfr_val_mean_usd
(assets, start, end)¶ The sum USD value of native units transferred divided by the count of transfers (i.e., the mean “size” in USD of a transfer) that day. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_txtfr_val_med
(assets, start, end)¶ The median count of native units transferred per transfer (i.e., the median “size” of a transfer) that day. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_txtfr_val_med_usd
(assets, start, end)¶ The median USD value transferred per transfer (i.e., the median “size” in USD of a transfer) that day. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_txtfr_val
(assets, start, end)¶ The sum of native units transferred (i.e., the aggregate “size” of all transfers) that day. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_txtfr_val_usd
(assets, start, end)¶ The sum USD value of all native units transferred (i.e., the aggregate size in USD of all transfers) that day. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_vty_ret_180d
(assets, start, end)¶ The 180D volatility, measured as the deviation of log returns See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_vty_ret_30d
(assets, start, end)¶ The 30D volatility, measured as the deviation of log returns See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
get_vty_ret_60d
(assets, start, end)¶ The 60D volatility, measured as the deviation of log returns. See: Data Dictionary.
- Parameters
See see
get_asset_metric_data()
for parameter and return details.
-
Note
The conveniance methods are not explicitly included in the coverage testing at this time.
Alias Methods¶
There are a very large number of aliases for the Conveniance Methods above, that can be found in the code under each method definition. Below is an example of the aliases for get_active_addresses()
.
# Method definition:
def get_active_addresses(self, assets, start, end):
return self.get_asset_metric_data(assets, "AdrActCnt", start, end)
# Alias definition:
active_addresses, activeaddresses, AdrActCnt = [get_active_addresses] * 3
The complete list of available aliases can be found using the following lines of code.
# Import the library
import coinmetrics
# Write out the complete method/atribute listing for the library
print(dir(coinmetrics))