messari.nfts.upshot package
Submodules
messari.nfts.upshot.helpers module
This module is dedicated to helpers for the Upshot class
- messari.nfts.upshot.helpers.format_df(df_in: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame
format a typical DF from Upshot, replace date & drop duplicates
- Parameters
- df_in: pd.DataFrame
input DataFrame
- Returns
- DataFrame
formated pandas DataFrame
messari.nfts.upshot.upshot module
This module is meant to contain the Upshot class
- class messari.nfts.upshot.upshot.Upshot
Bases:
messari.dataloader.DataLoader
This class is a wrapper around the Upshot API
Methods
get_asset
(contract_address[, asset_id, ...])retrieve upshot asset data
get_asset_events
(contract_address, asset_id)retrieve the event history for a given asset
get_pricing
(contract_address, asset_id[, ...])Returns all the price history for given asset(s) Parameters ---------- contract_address: str, List single address in or list of addresses in asset_id: int, List single asset id in or list of asset ids in from_time: int unix time for starting time to_time: int unix time for ending time confidence: str Only return pricings above the provided confidence level. 0.1 is the minimum and 1 is the highest, with a default level of 0.1 source: str A pricing can be one of the following types: - MARKET: open-market transactions (always a confidence level of 1) - UPSHOT: sourced from Upshot's proprietary machine learning models.
get_pricing_current
(contract_address, asset_id)Returns an asset's most recent price information.
get_response
(endpoint_url[, params, headers])Gets response from endpoint and checks for HTTP errors when requesting data.
set_api_dict
(api_dict)Sets a new dictionary to be used as an API key pair
set_taxonomy_dict
(taxonomy_dict)Sets a new dictionary to be used for taxonomy translations
translate
(input_slugs)Wrapper around messari.utils.validate_input, validate input & check if it's supported by DeFi Llama
- get_asset(contract_address: Union[str, List], asset_id: Optional[Union[int, List]] = None, limit: Optional[int] = None, offset: int = 0) pandas.core.frame.DataFrame
retrieve upshot asset data
- Parameters
- contract_address: str, List
single address in or list of addresses in
- asset_id: int, List
single asset id in or list of asset ids in
- limit: int
if no asset_id is given, set number of assets to get from contracts
- offset: int
for pagination
- Returns
- DataFrame
DataFrame containing information about asset(s)
- get_asset_events(contract_address: Union[str, List], asset_id: Union[int, List], market_type: Optional[str] = None, event_type=None) pandas.core.frame.DataFrame
retrieve the event history for a given asset
- Parameters
- contract_address: str, List
single address in or list of addresses in
- asset_id: int, List
single asset id in or list of asset ids in
- market_type: str
- filter the events based on the market in which it occurred
‘PRIMARY’
‘SECONDARY’
- event_type: str
- Filter events by the event type:
‘BID’
‘ASK’
‘SALE’
‘TRANSFER’
- Returns
- DataFrame
DataFrame containing events for given asset(s)
- get_pricing(contract_address: Union[str, List], asset_id: Union[int, List], from_time: Optional[int] = None, to_time: Optional[int] = None, confidence: Optional[str] = None, source: str = 'UPSHOT') pandas.core.frame.DataFrame
Returns all the price history for given asset(s) Parameters ———-
- contract_address: str, List
single address in or list of addresses in
- asset_id: int, List
single asset id in or list of asset ids in
- from_time: int
unix time for starting time
- to_time: int
unix time for ending time
- confidence: str
Only return pricings above the provided confidence level. 0.1 is the minimum and 1 is the highest, with a default level of 0.1
- source: str
- A pricing can be one of the following types:
MARKET: open-market transactions (always a confidence level of 1)
UPSHOT: sourced from Upshot’s proprietary machine learning models
- Returns
- DataFrame
timeseries DataFrame with price history
- get_pricing_current(contract_address: Union[str, List], asset_id: Union[int, List], confidence: Optional[str] = None, source: str = 'UPSHOT') pandas.core.frame.DataFrame
Returns an asset’s most recent price information.
- Parameters
- contract_address: str, List
single address in or list of addresses in
- asset_id: int, List
single asset id in or list of asset ids in
- confidence: str
Only return pricings above the provided confidence level. 0.1 is the minimum and 1 is the highest, with a default level of 0.1
- source: str
- A pricing can be one of the following types:
MARKET: open-market transactions (always a confidence level of 1)
UPSHOT: sourced from Upshot’s proprietary machine learning models
- Returns
- DataFrame
DataFrame containing recent price information
Module contents
Module to handle initialization, imports, for Upshot class