Utilities¶
Coin Metrics API Conversion Utilities
The functions below are not internally used by the coinmetrics
library. They are
transformations to allow data that was fetched to be more easily processed by another
process.
Usage Examples: Usage
-
coinmetrics.utils.
cm_to_pandas
(data)¶ Convert an object output from
coinmetrics.community.Community.get_asset_metric_data()
to a Pandas object for further processing.- Parameters
object (dict) – Raw data object to convert to Pandas datagram.
- Returns
Pandas dataframe form of original object.
- Return type
pandas dataframe
-
coinmetrics.utils.
normalize
(data)¶ Convert an object output from
coinmetrics.community.Community.get_asset_metric_data()
to a standard list of dictionaries for further processing.- Parameters
object (dict) – Raw data object to convert to list of dict.
- Returns
A normalized list of dictionaries
- Return type
list
-
coinmetrics.utils.
csv
(data, path)¶ Convert an object output from
coinmetrics.community.Community.get_asset_metric_data()
to a standard list of dictionaries for further processing.- Parameters
object (dict) – Raw data object to convert to Pandas datagram.
path (str, optional) – Location to save the CSV file to.