mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-14 05:14:19 +00:00
Merge branch 'develop' into feature/openbb-sdk-v4
This commit is contained in:
4
examples/README.md
vendored
4
examples/README.md
vendored
@@ -59,3 +59,7 @@ This notebook demonstrates how to fetch and work with options chains data.
|
||||
- Calculate and visualize the Net Delta Exposure, in dollars, by strike and expiration.
|
||||
- Visualize the term structure of the implied volatility skew.
|
||||
- Get tables with multiple single-leg options strategies.
|
||||
|
||||
### googleColabInstallation
|
||||
|
||||
This notebook demonstrates how to install the OpenBB SDK within Google Colab.
|
||||
|
||||
2491
examples/googleColabInstallation.ipynb
vendored
Normal file
2491
examples/googleColabInstallation.ipynb
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -1,212 +0,0 @@
|
||||
"""Twitter Model"""
|
||||
__docformat__ = "numpy"
|
||||
|
||||
import logging
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Optional
|
||||
|
||||
import pandas as pd
|
||||
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
|
||||
|
||||
from openbb_terminal.core.session.current_user import get_current_user
|
||||
from openbb_terminal.decorators import check_api_key, log_start_end
|
||||
from openbb_terminal.helper_funcs import clean_tweet, get_data, request
|
||||
from openbb_terminal.rich_config import console
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
analyzer = SentimentIntensityAnalyzer()
|
||||
|
||||
|
||||
@log_start_end(log=logger)
|
||||
@check_api_key(["API_TWITTER_BEARER_TOKEN"])
|
||||
def load_analyze_tweets(
|
||||
symbol: str,
|
||||
limit: int = 100,
|
||||
start_date: Optional[str] = "",
|
||||
end_date: Optional[str] = "",
|
||||
) -> pd.DataFrame:
|
||||
"""Load tweets from twitter API and analyzes using VADER.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
symbol: str
|
||||
Ticker symbol to search twitter for
|
||||
limit: int
|
||||
Number of tweets to analyze
|
||||
start_date: Optional[str]
|
||||
If given, the start time to get tweets from
|
||||
end_date: Optional[str]
|
||||
If given, the end time to get tweets from
|
||||
|
||||
Returns
|
||||
-------
|
||||
df_tweet: pd.DataFrame
|
||||
Dataframe of tweets and sentiment
|
||||
"""
|
||||
params = {
|
||||
"query": rf"(\${symbol}) (lang:en)",
|
||||
"max_results": str(limit),
|
||||
"tweet.fields": "created_at,lang",
|
||||
}
|
||||
|
||||
if start_date:
|
||||
# Assign from and to datetime parameters for the API
|
||||
params["start_time"] = start_date
|
||||
if end_date:
|
||||
params["end_time"] = end_date
|
||||
|
||||
# Request Twitter API
|
||||
response = request(
|
||||
"https://api.twitter.com/2/tweets/search/recent",
|
||||
params=params, # type: ignore
|
||||
headers={
|
||||
"authorization": "Bearer "
|
||||
+ get_current_user().credentials.API_TWITTER_BEARER_TOKEN
|
||||
},
|
||||
)
|
||||
|
||||
# Create dataframe
|
||||
df_tweets = pd.DataFrame()
|
||||
|
||||
# Check that the API response was successful
|
||||
if response.status_code == 200:
|
||||
tweets = []
|
||||
for tweet in response.json()["data"]:
|
||||
row = get_data(tweet)
|
||||
tweets.append(row)
|
||||
df_tweets = pd.DataFrame(tweets)
|
||||
elif response.status_code == 401:
|
||||
console.print("Twitter API Key provided is incorrect\n")
|
||||
return pd.DataFrame()
|
||||
elif response.status_code == 400:
|
||||
console.print(
|
||||
"""
|
||||
Status Code 400.
|
||||
This means you are requesting data from beyond the API's 7 day limit"""
|
||||
)
|
||||
return pd.DataFrame()
|
||||
elif response.status_code == 403:
|
||||
console.print(
|
||||
f"""
|
||||
Status code 403.
|
||||
It seems you're twitter credentials are invalid - {response.text}
|
||||
"""
|
||||
)
|
||||
return pd.DataFrame()
|
||||
else:
|
||||
console.print(
|
||||
f"""
|
||||
Status code {response.status_code}.
|
||||
Something went wrong - {response.text}
|
||||
"""
|
||||
)
|
||||
return pd.DataFrame()
|
||||
|
||||
sentiments = []
|
||||
pos = []
|
||||
neg = []
|
||||
neu = []
|
||||
|
||||
for s_tweet in df_tweets["text"].to_list():
|
||||
tweet = clean_tweet(s_tweet, symbol)
|
||||
sentiments.append(analyzer.polarity_scores(tweet)["compound"])
|
||||
pos.append(analyzer.polarity_scores(tweet)["pos"])
|
||||
neg.append(analyzer.polarity_scores(tweet)["neg"])
|
||||
neu.append(analyzer.polarity_scores(tweet)["neu"])
|
||||
# Add sentiments to tweets dataframe
|
||||
df_tweets["sentiment"] = sentiments
|
||||
df_tweets["positive"] = pos
|
||||
df_tweets["negative"] = neg
|
||||
df_tweets["neutral"] = neu
|
||||
|
||||
return df_tweets
|
||||
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def get_sentiment(
|
||||
symbol: str,
|
||||
n_tweets: int = 15,
|
||||
n_days_past: int = 2,
|
||||
) -> pd.DataFrame:
|
||||
"""Get sentiments from symbol.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
symbol: str
|
||||
Stock ticker symbol to get sentiment for
|
||||
n_tweets: int
|
||||
Number of tweets to get per hour
|
||||
n_days_past: int
|
||||
Number of days to extract tweets for
|
||||
|
||||
Returns
|
||||
-------
|
||||
df_sentiment: pd.DataFrame
|
||||
Dataframe of sentiment
|
||||
"""
|
||||
# Date format string required by twitter
|
||||
dt_format = "%Y-%m-%dT%H:%M:%SZ"
|
||||
|
||||
# Algorithm to extract
|
||||
dt_recent = datetime.utcnow() - timedelta(seconds=20)
|
||||
dt_old = dt_recent - timedelta(days=n_days_past)
|
||||
console.print(
|
||||
f"From {dt_recent.date()} retrieving {n_tweets*24} tweets ({n_tweets} tweets/hour)"
|
||||
)
|
||||
|
||||
df_tweets = pd.DataFrame(
|
||||
columns=[
|
||||
"created_at",
|
||||
"text",
|
||||
"sentiment",
|
||||
"positive",
|
||||
"negative",
|
||||
"neutral",
|
||||
]
|
||||
)
|
||||
while True:
|
||||
# Iterate until we haven't passed the old number of days
|
||||
if dt_recent < dt_old:
|
||||
break
|
||||
# Update past datetime
|
||||
dt_past = dt_recent - timedelta(minutes=60)
|
||||
|
||||
temp = load_analyze_tweets(
|
||||
symbol,
|
||||
n_tweets,
|
||||
start_date=dt_past.strftime(dt_format),
|
||||
end_date=dt_recent.strftime(dt_format),
|
||||
)
|
||||
|
||||
if (isinstance(temp, pd.DataFrame) and temp.empty) or (
|
||||
not isinstance(temp, pd.DataFrame) and not temp
|
||||
):
|
||||
return pd.DataFrame()
|
||||
|
||||
df_tweets = pd.concat([df_tweets, temp])
|
||||
|
||||
if dt_past.day < dt_recent.day:
|
||||
console.print(
|
||||
f"From {dt_past.date()} retrieving {n_tweets*24} tweets ({n_tweets} tweets/hour)"
|
||||
)
|
||||
|
||||
# Update recent datetime
|
||||
dt_recent = dt_past
|
||||
|
||||
# Sort tweets per date
|
||||
df_tweets.sort_index(ascending=False, inplace=True)
|
||||
df_tweets["cumulative_compound"] = df_tweets["sentiment"].cumsum()
|
||||
df_tweets["prob_sen"] = 1
|
||||
|
||||
# df_tweets.to_csv(r'notebooks/tweets.csv', index=False)
|
||||
df_tweets.reset_index(inplace=True)
|
||||
df_tweets["Month"] = pd.to_datetime(df_tweets["created_at"]).apply(
|
||||
lambda x: x.month
|
||||
)
|
||||
df_tweets["Day"] = pd.to_datetime(df_tweets["created_at"]).apply(lambda x: x.day)
|
||||
df_tweets["date"] = pd.to_datetime(df_tweets["created_at"])
|
||||
df_tweets = df_tweets.sort_values(by="date")
|
||||
df_tweets["cumulative_compound"] = df_tweets["sentiment"].cumsum()
|
||||
|
||||
return df_tweets
|
||||
@@ -1,197 +0,0 @@
|
||||
"""Twitter view."""
|
||||
__docformat__ = "numpy"
|
||||
|
||||
import logging
|
||||
import os
|
||||
from typing import Optional, Union
|
||||
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
from dateutil import parser as dparse
|
||||
|
||||
from openbb_terminal import OpenBBFigure, theme
|
||||
from openbb_terminal.common.behavioural_analysis import twitter_model
|
||||
from openbb_terminal.decorators import log_start_end
|
||||
from openbb_terminal.helper_funcs import export_data, get_closing_price
|
||||
from openbb_terminal.rich_config import console
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def display_inference(
|
||||
symbol: str, limit: int = 100, export: str = "", sheet_name: Optional[str] = None
|
||||
):
|
||||
"""Prints Inference sentiment from past n tweets.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
symbol: str
|
||||
Stock ticker symbol
|
||||
limit: int
|
||||
Number of tweets to analyze
|
||||
sheet_name: str
|
||||
Optionally specify the name of the sheet the data is exported to.
|
||||
export: str
|
||||
Format to export tweet dataframe
|
||||
"""
|
||||
df_tweets = twitter_model.load_analyze_tweets(symbol, limit)
|
||||
|
||||
if (isinstance(df_tweets, pd.DataFrame) and df_tweets.empty) or (
|
||||
not isinstance(df_tweets, pd.DataFrame) and not df_tweets
|
||||
):
|
||||
return
|
||||
|
||||
# Parse tweets
|
||||
dt_from = dparse.parse(df_tweets["created_at"].values[-1])
|
||||
dt_to = dparse.parse(df_tweets["created_at"].values[0])
|
||||
console.print(f"From: {dt_from.strftime('%Y-%m-%d %H:%M:%S')}")
|
||||
console.print(f"To: {dt_to.strftime('%Y-%m-%d %H:%M:%S')}")
|
||||
|
||||
console.print(f"{len(df_tweets)} tweets were analyzed.")
|
||||
dt_delta = dt_to - dt_from
|
||||
n_freq = dt_delta.total_seconds() / len(df_tweets)
|
||||
console.print(f"Frequency of approx 1 tweet every {round(n_freq)} seconds.")
|
||||
|
||||
pos = df_tweets["positive"]
|
||||
neg = df_tweets["negative"]
|
||||
|
||||
percent_pos = len(np.where(pos > neg)[0]) / len(df_tweets)
|
||||
percent_neg = len(np.where(pos < neg)[0]) / len(df_tweets)
|
||||
total_sent = np.round(np.sum(df_tweets["sentiment"]), 2)
|
||||
mean_sent = np.round(np.mean(df_tweets["sentiment"]), 2)
|
||||
console.print(f"The summed compound sentiment of {symbol} is: {total_sent}")
|
||||
console.print(f"The average compound sentiment of {symbol} is: {mean_sent}")
|
||||
console.print(
|
||||
f"Of the last {len(df_tweets)} tweets, {100*percent_pos:.2f} % had a higher positive sentiment"
|
||||
)
|
||||
console.print(
|
||||
f"Of the last {len(df_tweets)} tweets, {100*percent_neg:.2f} % had a higher negative sentiment"
|
||||
)
|
||||
|
||||
export_data(
|
||||
export,
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
"infer",
|
||||
df_tweets,
|
||||
sheet_name,
|
||||
)
|
||||
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def display_sentiment(
|
||||
symbol: str,
|
||||
n_tweets: int = 15,
|
||||
n_days_past: int = 2,
|
||||
compare: bool = False,
|
||||
export: str = "",
|
||||
sheet_name: Optional[str] = None,
|
||||
external_axes: bool = False,
|
||||
) -> Union[OpenBBFigure, None]:
|
||||
"""Plots sentiments from symbol
|
||||
|
||||
Parameters
|
||||
----------
|
||||
symbol: str
|
||||
Stock ticker symbol to get sentiment for
|
||||
n_tweets: int
|
||||
Number of tweets to get per hour
|
||||
n_days_past: int
|
||||
Number of days to extract tweets for
|
||||
compare: bool
|
||||
Show corresponding change in stock price
|
||||
sheet_name: str
|
||||
Optionally specify the name of the sheet the data is exported to.
|
||||
export: str
|
||||
Format to export tweet dataframe
|
||||
external_axes: bool, optional
|
||||
Whether to return the figure object or not, by default False
|
||||
"""
|
||||
|
||||
df_tweets = twitter_model.get_sentiment(symbol, n_tweets, n_days_past)
|
||||
|
||||
if df_tweets.empty:
|
||||
return None
|
||||
|
||||
if compare:
|
||||
plots_kwargs = dict(
|
||||
rows=3,
|
||||
cols=1,
|
||||
shared_xaxes=True,
|
||||
vertical_spacing=0.05,
|
||||
row_heights=[0.2, 0.6, 0.2],
|
||||
)
|
||||
else:
|
||||
plots_kwargs = dict(
|
||||
rows=2,
|
||||
cols=1,
|
||||
shared_xaxes=True,
|
||||
vertical_spacing=0.05,
|
||||
row_heights=[0.6, 0.4],
|
||||
)
|
||||
|
||||
fig = OpenBBFigure.create_subplots(**plots_kwargs) # type: ignore
|
||||
|
||||
fig.add_scatter(
|
||||
x=pd.to_datetime(df_tweets["created_at"]),
|
||||
y=df_tweets["cumulative_compound"].values,
|
||||
row=1,
|
||||
col=1,
|
||||
)
|
||||
|
||||
fig.set_yaxis_title("<br>Cumulative<br>VADER Sentiment", row=1, col=1)
|
||||
|
||||
for _, day_df in df_tweets.groupby(by="Day"):
|
||||
day_df["time"] = pd.to_datetime(day_df["created_at"])
|
||||
day_df = day_df.sort_values(by="time")
|
||||
fig.add_scatter(
|
||||
x=day_df["time"],
|
||||
y=day_df["sentiment"].cumsum(),
|
||||
row=1,
|
||||
col=1,
|
||||
)
|
||||
fig.add_bar(
|
||||
x=df_tweets["date"],
|
||||
y=df_tweets["positive"],
|
||||
row=2,
|
||||
col=1,
|
||||
marker_color=theme.up_color,
|
||||
)
|
||||
|
||||
fig.add_bar(
|
||||
x=df_tweets["date"],
|
||||
y=-1 * df_tweets["negative"],
|
||||
row=2,
|
||||
col=1,
|
||||
marker_color=theme.down_color,
|
||||
)
|
||||
fig.set_yaxis_title("VADER Polarity Scores", row=2, col=1)
|
||||
|
||||
if compare:
|
||||
# get stock end price for each corresponding day if compare == True
|
||||
closing_price_df = get_closing_price(symbol, n_days_past)
|
||||
fig.add_scatter(
|
||||
x=closing_price_df["Date"],
|
||||
y=closing_price_df["Close"],
|
||||
name=pd.to_datetime(closing_price_df["Date"]).iloc[0].strftime("%Y-%m-%d"),
|
||||
row=3,
|
||||
col=1,
|
||||
)
|
||||
fig.set_yaxis_title("Stock Price", row=3, col=1)
|
||||
|
||||
fig.update_layout(
|
||||
title=f"Twitter's {symbol} total compound sentiment over time is {round(np.sum(df_tweets['sentiment']), 2)}",
|
||||
xaxis=dict(type="date"),
|
||||
showlegend=False,
|
||||
)
|
||||
|
||||
export_data(
|
||||
export,
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
"sentiment",
|
||||
df_tweets,
|
||||
sheet_name,
|
||||
fig,
|
||||
)
|
||||
|
||||
return fig.show(external=external_axes)
|
||||
@@ -42,8 +42,6 @@ class StocksController(model.StocksRoot):
|
||||
`getdd`: Get due diligence posts from list of subreddits [Source: reddit].\n
|
||||
`headlines`: Gets Sentiment analysis provided by FinBrain's API [Source: finbrain].\n
|
||||
`headlines_chart`: Plots Sentiment analysis from FinBrain. Prints table if raw is True. [Source: FinBrain]\n
|
||||
`infer`: Load tweets from twitter API and analyzes using VADER.\n
|
||||
`infer_chart`: Prints Inference sentiment from past n tweets.\n
|
||||
`mentions`: Get interest over time from google api [Source: google].\n
|
||||
`mentions_chart`: Plots weekly bars of stock's interest over time. other users watchlist. [Source: Google].\n
|
||||
`messages`: Get last messages for a given ticker [Source: stocktwits].\n
|
||||
@@ -55,8 +53,6 @@ class StocksController(model.StocksRoot):
|
||||
`regions`: Get interest by region from google api [Source: google].\n
|
||||
`regions_chart`: Plots bars of regions based on stock's interest. [Source: Google].\n
|
||||
`rise`: Get top rising related queries with this stock's query [Source: google].\n
|
||||
`sentiment`: Get sentiments from symbol.\n
|
||||
`sentiment_chart`: Plots sentiments from symbol\n
|
||||
`snews`: Get headlines sentiment using VADER model over time. [Source: Finnhub]\n
|
||||
`snews_chart`: Display stock price and headlines sentiment using VADER model over time. [Source: Finnhub]\n
|
||||
`stalker`: Gets messages from given user [Source: stocktwits].\n
|
||||
|
||||
@@ -285,10 +285,6 @@ class CryptoDeFi(Category):
|
||||
)
|
||||
self.newsletters = lib.crypto_defi_substack_model.get_newsletters
|
||||
self.newsletters_chart = lib.crypto_defi_substack_view.display_newsletters
|
||||
self.pairs = lib.crypto_defi_graph_model.get_uniswap_pool_recently_added
|
||||
self.pairs_chart = lib.crypto_defi_graph_view.display_recently_added
|
||||
self.pools = lib.crypto_defi_graph_model.get_uni_pools_by_volume
|
||||
self.pools_chart = lib.crypto_defi_graph_view.display_uni_pools
|
||||
self.sinfo = lib.crypto_defi_terramoney_fcd_model.get_staking_account_info
|
||||
self.sinfo_chart = (
|
||||
lib.crypto_defi_terramoney_fcd_view.display_account_staking_info
|
||||
@@ -301,14 +297,8 @@ class CryptoDeFi(Category):
|
||||
self.sreturn_chart = (
|
||||
lib.crypto_defi_terramoney_fcd_view.display_staking_returns_history
|
||||
)
|
||||
self.stats = lib.crypto_defi_graph_model.get_uniswap_stats
|
||||
self.stats_chart = lib.crypto_defi_graph_view.display_uni_stats
|
||||
self.stvl = lib.crypto_defi_llama_model.get_defi_tvl
|
||||
self.stvl_chart = lib.crypto_defi_llama_view.display_defi_tvl
|
||||
self.swaps = lib.crypto_defi_graph_model.get_last_uni_swaps
|
||||
self.swaps_chart = lib.crypto_defi_graph_view.display_last_uni_swaps
|
||||
self.tokens = lib.crypto_defi_graph_model.get_uni_tokens
|
||||
self.tokens_chart = lib.crypto_defi_graph_view.display_uni_tokens
|
||||
self.validators = lib.crypto_defi_terramoney_fcd_model.get_validators
|
||||
self.validators_chart = lib.crypto_defi_terramoney_fcd_view.display_validators
|
||||
self.vaults = lib.crypto_defi_coindix_model.get_defi_vaults
|
||||
|
||||
@@ -42,7 +42,6 @@ class KeysRoot(Category):
|
||||
`stocksera`: Set Stocksera key.\n
|
||||
`tokenterminal`: Set Token Terminal key.\n
|
||||
`tradier`: Set Tradier key\n
|
||||
`twitter`: Set Twitter key\n
|
||||
`ultima`: Set Ultima Insights key\n
|
||||
`walert`: Set Walert key\n
|
||||
"""
|
||||
@@ -84,6 +83,5 @@ class KeysRoot(Category):
|
||||
self.stocksera = lib.keys_model.set_stocksera_key
|
||||
self.tokenterminal = lib.keys_model.set_tokenterminal_key
|
||||
self.tradier = lib.keys_model.set_tradier_key
|
||||
self.twitter = lib.keys_model.set_twitter_key
|
||||
self.ultima = lib.keys_model.set_ultima_key
|
||||
self.walert = lib.keys_model.set_walert_key
|
||||
|
||||
@@ -42,8 +42,6 @@ class StocksBehavioralAnalysis(Category):
|
||||
`getdd`: Get due diligence posts from list of subreddits [Source: reddit].\n
|
||||
`headlines`: Gets Sentiment analysis provided by FinBrain's API [Source: finbrain].\n
|
||||
`headlines_chart`: Plots Sentiment analysis from FinBrain. Prints table if raw is True. [Source: FinBrain]\n
|
||||
`infer`: Load tweets from twitter API and analyzes using VADER.\n
|
||||
`infer_chart`: Prints Inference sentiment from past n tweets.\n
|
||||
`mentions`: Get interest over time from google api [Source: google].\n
|
||||
`mentions_chart`: Plots weekly bars of stock's interest over time. other users watchlist. [Source: Google].\n
|
||||
`messages`: Get last messages for a given ticker [Source: stocktwits].\n
|
||||
@@ -55,8 +53,6 @@ class StocksBehavioralAnalysis(Category):
|
||||
`regions`: Get interest by region from google api [Source: google].\n
|
||||
`regions_chart`: Plots bars of regions based on stock's interest. [Source: Google].\n
|
||||
`rise`: Get top rising related queries with this stock's query [Source: google].\n
|
||||
`sentiment`: Get sentiments from symbol.\n
|
||||
`sentiment_chart`: Plots sentiments from symbol\n
|
||||
`snews`: Get headlines sentiment using VADER model over time. [Source: Finnhub]\n
|
||||
`snews_chart`: Display stock price and headlines sentiment using VADER model over time. [Source: Finnhub]\n
|
||||
`stalker`: Gets messages from given user [Source: stocktwits].\n
|
||||
@@ -74,8 +70,6 @@ class StocksBehavioralAnalysis(Category):
|
||||
self.getdd = lib.stocks_ba_reddit_model.get_due_dilligence
|
||||
self.headlines = lib.stocks_ba_finbrain_model.get_sentiment
|
||||
self.headlines_chart = lib.stocks_ba_finbrain_view.display_sentiment_analysis
|
||||
self.infer = lib.stocks_ba_twitter_model.load_analyze_tweets
|
||||
self.infer_chart = lib.stocks_ba_twitter_view.display_inference
|
||||
self.mentions = lib.stocks_ba_google_model.get_mentions
|
||||
self.mentions_chart = lib.stocks_ba_google_view.display_mentions
|
||||
self.messages = lib.stocks_ba_stocktwits_model.get_messages
|
||||
@@ -87,8 +81,6 @@ class StocksBehavioralAnalysis(Category):
|
||||
self.regions = lib.stocks_ba_google_model.get_regions
|
||||
self.regions_chart = lib.stocks_ba_google_view.display_regions
|
||||
self.rise = lib.stocks_ba_google_model.get_rise
|
||||
self.sentiment = lib.stocks_ba_twitter_model.get_sentiment
|
||||
self.sentiment_chart = lib.stocks_ba_twitter_view.display_sentiment
|
||||
self.snews = lib.stocks_ba_finnhub_model.get_headlines_sentiment
|
||||
self.snews_chart = (
|
||||
lib.stocks_ba_finnhub_view.display_stock_price_headlines_sentiment
|
||||
|
||||
@@ -121,8 +121,6 @@ from openbb_terminal.common.behavioural_analysis import (
|
||||
reddit_view as stocks_ba_reddit_view,
|
||||
stocktwits_model as stocks_ba_stocktwits_model,
|
||||
stocktwits_view as stocks_ba_stocktwits_view,
|
||||
twitter_model as stocks_ba_twitter_model,
|
||||
twitter_view as stocks_ba_twitter_view,
|
||||
)
|
||||
|
||||
|
||||
@@ -170,8 +168,6 @@ from openbb_terminal.cryptocurrency.defi import (
|
||||
coindix_view as crypto_defi_coindix_view,
|
||||
cryptosaurio_model as crypto_defi_cryptosaurio_model,
|
||||
cryptosaurio_view as crypto_defi_cryptosaurio_view,
|
||||
graph_model as crypto_defi_graph_model,
|
||||
graph_view as crypto_defi_graph_view,
|
||||
llama_model as crypto_defi_llama_model,
|
||||
llama_view as crypto_defi_llama_view,
|
||||
smartstake_model as crypto_defi_smartstake_model,
|
||||
|
||||
8
openbb_terminal/core/sdk/trail_map.csv
vendored
8
openbb_terminal/core/sdk/trail_map.csv
vendored
@@ -75,15 +75,10 @@ crypto.defi.gov_proposals,crypto_defi_terramoney_fcd_model.get_proposals,crypto_
|
||||
crypto.defi.ldapps,crypto_defi_llama_model.get_defi_protocols,crypto_defi_llama_view.display_defi_protocols
|
||||
crypto.defi.luna_supply,crypto_defi_smartstake_model.get_luna_supply_stats,crypto_defi_smartstake_view.display_luna_circ_supply_change
|
||||
crypto.defi.newsletters,crypto_defi_substack_model.get_newsletters,crypto_defi_substack_view.display_newsletters
|
||||
crypto.defi.pairs,crypto_defi_graph_model.get_uniswap_pool_recently_added,crypto_defi_graph_view.display_recently_added
|
||||
crypto.defi.pools,crypto_defi_graph_model.get_uni_pools_by_volume,crypto_defi_graph_view.display_uni_pools
|
||||
crypto.defi.sinfo,crypto_defi_terramoney_fcd_model.get_staking_account_info,crypto_defi_terramoney_fcd_view.display_account_staking_info
|
||||
crypto.defi.sratio,crypto_defi_terramoney_fcd_model.get_staking_ratio_history,crypto_defi_terramoney_fcd_view.display_staking_ratio_history
|
||||
crypto.defi.sreturn,crypto_defi_terramoney_fcd_model.get_staking_returns_history,crypto_defi_terramoney_fcd_view.display_staking_returns_history
|
||||
crypto.defi.stats,crypto_defi_graph_model.get_uniswap_stats,crypto_defi_graph_view.display_uni_stats
|
||||
crypto.defi.stvl,crypto_defi_llama_model.get_defi_tvl,crypto_defi_llama_view.display_defi_tvl
|
||||
crypto.defi.swaps,crypto_defi_graph_model.get_last_uni_swaps,crypto_defi_graph_view.display_last_uni_swaps
|
||||
crypto.defi.tokens,crypto_defi_graph_model.get_uni_tokens,crypto_defi_graph_view.display_uni_tokens
|
||||
crypto.defi.validators,crypto_defi_terramoney_fcd_model.get_validators,crypto_defi_terramoney_fcd_view.display_validators
|
||||
crypto.defi.vaults,crypto_defi_coindix_model.get_defi_vaults,crypto_defi_coindix_view.display_defi_vaults
|
||||
crypto.disc.categories_keys,crypto_disc_pycoingecko_model.get_categories_keys,
|
||||
@@ -317,7 +312,6 @@ keys.smartstake,keys_model.set_smartstake_key,
|
||||
keys.stocksera,keys_model.set_stocksera_key,
|
||||
keys.tokenterminal,keys_model.set_tokenterminal_key,
|
||||
keys.tradier,keys_model.set_tradier_key,
|
||||
keys.twitter,keys_model.set_twitter_key,
|
||||
keys.ultima,keys_model.set_ultima_key,
|
||||
keys.walert,keys_model.set_walert_key,
|
||||
login,sdk_session.login,
|
||||
@@ -389,7 +383,6 @@ stocks.ba.bullbear,stocks_ba_stocktwits_model.get_bullbear,
|
||||
stocks.ba.cnews,stocks_ba_finnhub_model.get_company_news,
|
||||
stocks.ba.getdd,stocks_ba_reddit_model.get_due_dilligence,
|
||||
stocks.ba.headlines,stocks_ba_finbrain_model.get_sentiment,stocks_ba_finbrain_view.display_sentiment_analysis
|
||||
stocks.ba.infer,stocks_ba_twitter_model.load_analyze_tweets,stocks_ba_twitter_view.display_inference
|
||||
stocks.ba.mentions,stocks_ba_google_model.get_mentions,stocks_ba_google_view.display_mentions
|
||||
stocks.ba.messages,stocks_ba_stocktwits_model.get_messages,
|
||||
stocks.ba.ns,stocks_ba_news_sentiment_model.get_data,stocks_ba_news_sentiment_view.display_articles_data
|
||||
@@ -398,7 +391,6 @@ stocks.ba.queries,stocks_ba_google_model.get_queries,
|
||||
stocks.ba.redditsent,stocks_ba_reddit_model.get_posts_about,
|
||||
stocks.ba.regions,stocks_ba_google_model.get_regions,stocks_ba_google_view.display_regions
|
||||
stocks.ba.rise,stocks_ba_google_model.get_rise,
|
||||
stocks.ba.sentiment,stocks_ba_twitter_model.get_sentiment,stocks_ba_twitter_view.display_sentiment
|
||||
stocks.ba.snews,stocks_ba_finnhub_model.get_headlines_sentiment,stocks_ba_finnhub_view.display_stock_price_headlines_sentiment
|
||||
stocks.ba.stalker,stocks_ba_stocktwits_model.get_stalker,
|
||||
stocks.ba.text_sent,stocks_ba_reddit_model.get_sentiment,
|
||||
|
||||
|
@@ -12,8 +12,6 @@ from openbb_terminal.cryptocurrency.defi import (
|
||||
coindix_model,
|
||||
coindix_view,
|
||||
cryptosaurio_view,
|
||||
graph_model,
|
||||
graph_view,
|
||||
llama_model,
|
||||
llama_view,
|
||||
smartstake_view,
|
||||
@@ -45,11 +43,6 @@ class DefiController(BaseController):
|
||||
"stvl",
|
||||
"dtvl",
|
||||
"newsletter",
|
||||
"tokens",
|
||||
"pairs",
|
||||
"pools",
|
||||
"swaps",
|
||||
"stats",
|
||||
"vaults",
|
||||
"sinfo",
|
||||
"validators",
|
||||
@@ -76,11 +69,6 @@ class DefiController(BaseController):
|
||||
mt = MenuText("crypto/defi/")
|
||||
mt.add_cmd("newsletter")
|
||||
mt.add_cmd("vaults")
|
||||
mt.add_cmd("tokens")
|
||||
mt.add_cmd("stats")
|
||||
mt.add_cmd("pairs")
|
||||
mt.add_cmd("pools")
|
||||
mt.add_cmd("swaps")
|
||||
mt.add_cmd("ldapps")
|
||||
mt.add_cmd("gdapps")
|
||||
mt.add_cmd("stvl")
|
||||
@@ -551,299 +539,9 @@ class DefiController(BaseController):
|
||||
else None,
|
||||
)
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def call_tokens(self, other_args: List[str]):
|
||||
"""Process tokens command"""
|
||||
parser = argparse.ArgumentParser(
|
||||
add_help=False,
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
prog="tokens",
|
||||
description="""
|
||||
Display tokens trade-able on Uniswap DEX
|
||||
[Source: https://thegraph.com/en/]
|
||||
""",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--skip",
|
||||
dest="skip",
|
||||
type=check_positive,
|
||||
help="Number of records to skip",
|
||||
default=0,
|
||||
choices=range(1, 1000),
|
||||
metavar="SKIP",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--limit",
|
||||
dest="limit",
|
||||
type=check_positive,
|
||||
help="Number of records to display",
|
||||
default=20,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-s",
|
||||
"--sort",
|
||||
dest="sortby",
|
||||
type=str,
|
||||
help="Sort by given column. Default: index",
|
||||
default="index",
|
||||
choices=graph_model.TOKENS_FILTERS,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-r",
|
||||
"--reverse",
|
||||
action="store_true",
|
||||
dest="reverse",
|
||||
default=False,
|
||||
help=(
|
||||
"Data is sorted in descending order by default. "
|
||||
"Reverse flag will sort it in an ascending way. "
|
||||
"Only works when raw data is displayed."
|
||||
),
|
||||
)
|
||||
ns_parser = self.parse_known_args_and_warn(
|
||||
parser, other_args, EXPORT_ONLY_RAW_DATA_ALLOWED
|
||||
)
|
||||
if ns_parser:
|
||||
graph_view.display_uni_tokens(
|
||||
skip=ns_parser.skip,
|
||||
limit=ns_parser.limit,
|
||||
sortby=ns_parser.sortby,
|
||||
ascend=ns_parser.reverse,
|
||||
export=ns_parser.export,
|
||||
sheet_name=" ".join(ns_parser.sheet_name)
|
||||
if ns_parser.sheet_name
|
||||
else None,
|
||||
)
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def call_stats(self, other_args: List[str]):
|
||||
"""Process stats command"""
|
||||
parser = argparse.ArgumentParser(
|
||||
add_help=False,
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
prog="stats",
|
||||
description="""
|
||||
Display base statistics about Uniswap DEX.
|
||||
[Source: https://thegraph.com/en/]
|
||||
""",
|
||||
)
|
||||
|
||||
ns_parser = self.parse_known_args_and_warn(
|
||||
parser, other_args, EXPORT_ONLY_RAW_DATA_ALLOWED
|
||||
)
|
||||
|
||||
if ns_parser:
|
||||
graph_view.display_uni_stats(
|
||||
export=ns_parser.export,
|
||||
sheet_name=" ".join(ns_parser.sheet_name)
|
||||
if ns_parser.sheet_name
|
||||
else None,
|
||||
)
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def call_pairs(self, other_args: List[str]):
|
||||
"""Process pairs command"""
|
||||
parser = argparse.ArgumentParser(
|
||||
add_help=False,
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
prog="pairs",
|
||||
description="""
|
||||
Displays Lastly added pairs on Uniswap DEX.
|
||||
[Source: https://thegraph.com/en/]
|
||||
""",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-l",
|
||||
"--limit",
|
||||
dest="limit",
|
||||
type=check_positive,
|
||||
help="Number of records to display",
|
||||
default=10,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-v",
|
||||
"--vol",
|
||||
dest="vol",
|
||||
type=check_positive,
|
||||
help="Minimum trading volume",
|
||||
default=100,
|
||||
choices=range(1, 1000),
|
||||
metavar="VOL",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-tx",
|
||||
"--tx",
|
||||
dest="tx",
|
||||
type=check_positive,
|
||||
help="Minimum number of transactions",
|
||||
default=100,
|
||||
choices=range(1, 1000),
|
||||
metavar="TX",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--days",
|
||||
dest="days",
|
||||
type=check_positive,
|
||||
help="Number of days the pair has been active,",
|
||||
default=10,
|
||||
choices=range(1, 1000),
|
||||
metavar="DAY",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-s",
|
||||
"--sort",
|
||||
dest="sortby",
|
||||
type=str,
|
||||
help="Sort by given column. Default: created",
|
||||
default="created",
|
||||
choices=graph_model.PAIRS_FILTERS,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-r",
|
||||
"--reverse",
|
||||
action="store_true",
|
||||
dest="reverse",
|
||||
default=False,
|
||||
help=(
|
||||
"Data is sorted in descending order by default. "
|
||||
"Reverse flag will sort it in an ascending way. "
|
||||
"Only works when raw data is displayed."
|
||||
),
|
||||
)
|
||||
ns_parser = self.parse_known_args_and_warn(
|
||||
parser, other_args, EXPORT_ONLY_RAW_DATA_ALLOWED
|
||||
)
|
||||
|
||||
if ns_parser:
|
||||
graph_view.display_recently_added(
|
||||
limit=ns_parser.limit,
|
||||
days=ns_parser.days,
|
||||
min_volume=ns_parser.vol,
|
||||
min_tx=ns_parser.tx,
|
||||
sortby=ns_parser.sortby,
|
||||
ascend=ns_parser.reverse,
|
||||
export=ns_parser.export,
|
||||
sheet_name=" ".join(ns_parser.sheet_name)
|
||||
if ns_parser.sheet_name
|
||||
else None,
|
||||
)
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def call_pools(self, other_args: List[str]):
|
||||
"""Process pools command"""
|
||||
parser = argparse.ArgumentParser(
|
||||
add_help=False,
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
prog="pairs",
|
||||
description="""
|
||||
Display uniswap pools by volume.
|
||||
[Source: https://thegraph.com/en/]
|
||||
""",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-l",
|
||||
"--limit",
|
||||
dest="limit",
|
||||
type=check_positive,
|
||||
help="Number of records to display",
|
||||
default=10,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-s",
|
||||
"--sort",
|
||||
dest="sortby",
|
||||
type=str,
|
||||
help="Sort by given column. Default: volumeUSD",
|
||||
default="volumeUSD",
|
||||
choices=graph_model.POOLS_FILTERS,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-r",
|
||||
"--reverse",
|
||||
action="store_true",
|
||||
dest="reverse",
|
||||
default=False,
|
||||
help=(
|
||||
"Data is sorted in descending order by default. "
|
||||
"Reverse flag will sort it in an ascending way. "
|
||||
"Only works when raw data is displayed."
|
||||
),
|
||||
)
|
||||
ns_parser = self.parse_known_args_and_warn(
|
||||
parser, other_args, EXPORT_ONLY_RAW_DATA_ALLOWED
|
||||
)
|
||||
|
||||
if ns_parser:
|
||||
graph_view.display_uni_pools(
|
||||
limit=ns_parser.limit,
|
||||
sortby=ns_parser.sortby,
|
||||
ascend=ns_parser.reverse,
|
||||
export=ns_parser.export,
|
||||
sheet_name=" ".join(ns_parser.sheet_name)
|
||||
if ns_parser.sheet_name
|
||||
else None,
|
||||
)
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def call_swaps(self, other_args: List[str]):
|
||||
"""Process swaps command"""
|
||||
parser = argparse.ArgumentParser(
|
||||
add_help=False,
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
prog="pairs",
|
||||
description="""
|
||||
Display last swaps done on Uniswap DEX.
|
||||
[Source: https://thegraph.com/en/]
|
||||
""",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-l",
|
||||
"--limit",
|
||||
dest="limit",
|
||||
type=check_positive,
|
||||
help="Number of records to display",
|
||||
default=10,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-s",
|
||||
"--sort",
|
||||
dest="sortby",
|
||||
type=str,
|
||||
help="Sort by given column. Default: timestamp",
|
||||
default="Datetime",
|
||||
choices=graph_model.SWAPS_FILTERS,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-r",
|
||||
"--reverse",
|
||||
action="store_true",
|
||||
dest="reverse",
|
||||
default=False,
|
||||
help=(
|
||||
"Data is sorted in descending order by default. "
|
||||
"Reverse flag will sort it in an ascending way. "
|
||||
"Only works when raw data is displayed."
|
||||
),
|
||||
)
|
||||
ns_parser = self.parse_known_args_and_warn(
|
||||
parser, other_args, EXPORT_ONLY_RAW_DATA_ALLOWED
|
||||
)
|
||||
|
||||
if ns_parser:
|
||||
graph_view.display_last_uni_swaps(
|
||||
limit=ns_parser.limit,
|
||||
sortby=ns_parser.sortby,
|
||||
ascend=ns_parser.reverse,
|
||||
export=ns_parser.export,
|
||||
sheet_name=" ".join(ns_parser.sheet_name)
|
||||
if ns_parser.sheet_name
|
||||
else None,
|
||||
)
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def call_vaults(self, other_args: List[str]):
|
||||
"""Process swaps command"""
|
||||
"""Process vaults command"""
|
||||
parser = argparse.ArgumentParser(
|
||||
add_help=False,
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
|
||||
@@ -1,356 +0,0 @@
|
||||
"""The Graph model"""
|
||||
__docformat__ = "numpy"
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
|
||||
import pandas as pd
|
||||
|
||||
from openbb_terminal.cryptocurrency.dataframe_helpers import (
|
||||
lambda_very_long_number_formatter,
|
||||
)
|
||||
from openbb_terminal.decorators import log_start_end
|
||||
from openbb_terminal.helper_funcs import request
|
||||
from openbb_terminal.rich_config import console
|
||||
|
||||
# pylint: disable=unsupported-assignment-operation
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
# pylint: disable=unsupported-assignment-operation
|
||||
|
||||
UNI_URL = "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2"
|
||||
|
||||
SWAPS_FILTERS = ["Datetime", "USD", "From", "To"]
|
||||
|
||||
POOLS_FILTERS = [
|
||||
"volumeUSD",
|
||||
"token0.name",
|
||||
"token0.symbol",
|
||||
"token1.name",
|
||||
"token1.symbol",
|
||||
"volumeUSD",
|
||||
"txCount",
|
||||
]
|
||||
|
||||
TOKENS_FILTERS = [
|
||||
"index",
|
||||
"symbol",
|
||||
"name",
|
||||
"tradeVolumeUSD",
|
||||
"totalLiquidity",
|
||||
"txCount",
|
||||
]
|
||||
|
||||
PAIRS_FILTERS = [
|
||||
"created",
|
||||
"pair",
|
||||
"token0",
|
||||
"token1",
|
||||
"volumeUSD",
|
||||
"txCount",
|
||||
"totalSupply",
|
||||
]
|
||||
|
||||
# TODO: convert USD values to int. otherwise sort by these columns won't work
|
||||
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def query_graph(url: str, query: str) -> dict:
|
||||
"""Helper methods for querying graphql api. [Source: https://thegraph.com/en/]
|
||||
|
||||
Parameters
|
||||
----------
|
||||
url: str
|
||||
Endpoint url
|
||||
query: str
|
||||
Graphql query
|
||||
|
||||
Returns
|
||||
-------
|
||||
dict:
|
||||
Dictionary with response data
|
||||
"""
|
||||
|
||||
response = request(url, method="POST", json={"query": query})
|
||||
if response.status_code == 200:
|
||||
return response.json()["data"]
|
||||
return {}
|
||||
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def get_uni_tokens(
|
||||
skip: int = 0, limit: int = 100, sortby: str = "index", ascend: bool = False
|
||||
) -> pd.DataFrame:
|
||||
"""Get list of tokens trade-able on Uniswap DEX. [Source: https://thegraph.com/en/]
|
||||
|
||||
Parameters
|
||||
----------
|
||||
skip: int
|
||||
Skip n number of records.
|
||||
limit: int
|
||||
Show n number of records.
|
||||
sortby: str
|
||||
The column to sort by
|
||||
ascend: bool
|
||||
Whether to sort in ascending order
|
||||
|
||||
Returns
|
||||
-------
|
||||
pd.DataFrame
|
||||
Uniswap tokens with trading volume, transaction count, liquidity.
|
||||
"""
|
||||
|
||||
limit = min(limit, 1000)
|
||||
query = f"""
|
||||
{{
|
||||
tokens(first: {limit}, skip:{skip}) {{
|
||||
symbol
|
||||
name
|
||||
tradeVolumeUSD
|
||||
totalLiquidity
|
||||
txCount
|
||||
}}
|
||||
}}
|
||||
"""
|
||||
|
||||
data = query_graph(UNI_URL, query)
|
||||
if not data:
|
||||
return pd.DataFrame()
|
||||
df = pd.DataFrame(data["tokens"]).reset_index()
|
||||
return df.sort_values(by=sortby, ascending=ascend)
|
||||
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def get_uniswap_stats() -> pd.DataFrame:
|
||||
"""Get base statistics about Uniswap DEX. [Source: https://thegraph.com/en/]
|
||||
|
||||
uniswapFactory id: 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f - ethereum address on which Uniswap Factory
|
||||
smart contract was deployed. The factory contract is deployed once from the off-chain source code, and it contains
|
||||
functions that make it possible to create exchange contracts for any ERC20 token that does not already have one.
|
||||
It also functions as a registry of ERC20 tokens that have been added to the system, and the exchange with which they
|
||||
are associated. More: https://docs.uniswap.org/protocol/V1/guides/connect-to-uniswap
|
||||
We use 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f address to fetch all smart contracts that were
|
||||
created with usage of this factory.
|
||||
|
||||
|
||||
Returns
|
||||
-------
|
||||
pd.DataFrame
|
||||
Uniswap DEX statistics like liquidity, volume, number of pairs, number of transactions.
|
||||
"""
|
||||
|
||||
query = """
|
||||
{
|
||||
uniswapFactory(id: "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f"){
|
||||
totalVolumeUSD
|
||||
totalLiquidityUSD
|
||||
pairCount
|
||||
txCount
|
||||
totalLiquidityUSD
|
||||
totalLiquidityETH
|
||||
}
|
||||
}
|
||||
"""
|
||||
data = query_graph(UNI_URL, query)
|
||||
if not data:
|
||||
return pd.DataFrame()
|
||||
df = pd.Series(data["uniswapFactory"]).reset_index()
|
||||
df.columns = ["Metric", "Value"]
|
||||
df["Value"] = df["Value"].apply(lambda x: lambda_very_long_number_formatter(x))
|
||||
return df
|
||||
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def get_uniswap_pool_recently_added(
|
||||
last_days: int = 14,
|
||||
min_volume: int = 100,
|
||||
min_liquidity: int = 0,
|
||||
min_tx: int = 100,
|
||||
) -> pd.DataFrame:
|
||||
"""Get lastly added trade-able pairs on Uniswap with parameters like:
|
||||
* number of days the pair has been active,
|
||||
* minimum trading volume,
|
||||
* minimum liquidity,
|
||||
* number of transactions.
|
||||
|
||||
[Source: https://thegraph.com/en/]
|
||||
|
||||
Parameters
|
||||
----------
|
||||
last_days: int
|
||||
How many days back to look for added pairs.
|
||||
min_volume: int
|
||||
Minimum volume
|
||||
min_liquidity: int
|
||||
Minimum liquidity
|
||||
min_tx: int
|
||||
Minimum number of transactions done in given pool.
|
||||
|
||||
Returns
|
||||
-------
|
||||
pd.DataFrame
|
||||
Lastly added pairs on Uniswap DEX.
|
||||
"""
|
||||
|
||||
days = int(
|
||||
(datetime.datetime.now() - datetime.timedelta(days=last_days)).timestamp()
|
||||
)
|
||||
query = f"""
|
||||
{{
|
||||
pairs(first: 1000,
|
||||
where: {{createdAtTimestamp_gt: "{days}", volumeUSD_gt: "{min_volume}", reserveUSD_gt: "{min_liquidity}",
|
||||
txCount_gt: "{min_tx}" }},
|
||||
orderBy: createdAtTimestamp, orderDirection: desc) {{
|
||||
token0 {{
|
||||
symbol
|
||||
name
|
||||
}}
|
||||
token1 {{
|
||||
symbol
|
||||
name
|
||||
}}
|
||||
reserveUSD
|
||||
volumeUSD
|
||||
createdAtTimestamp
|
||||
totalSupply
|
||||
txCount
|
||||
}}
|
||||
}}
|
||||
"""
|
||||
|
||||
data = query_graph(UNI_URL, query)
|
||||
if not data:
|
||||
return pd.DataFrame()
|
||||
|
||||
df = pd.json_normalize(data["pairs"])
|
||||
df["createdAtTimestamp"] = df["createdAtTimestamp"].apply(
|
||||
lambda x: datetime.datetime.fromtimestamp(int(x))
|
||||
)
|
||||
|
||||
df["pair"] = df["token0.symbol"] + "/" + df["token1.symbol"]
|
||||
df.rename(
|
||||
columns={
|
||||
"createdAtTimestamp": "created",
|
||||
"token0.name": "token0",
|
||||
"token1.name": "token1",
|
||||
},
|
||||
inplace=True,
|
||||
)
|
||||
return df[
|
||||
[
|
||||
"created",
|
||||
"pair",
|
||||
"token0",
|
||||
"token1",
|
||||
"volumeUSD",
|
||||
"txCount",
|
||||
"totalSupply",
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def get_uni_pools_by_volume() -> pd.DataFrame:
|
||||
"""Get uniswap pools by volume. [Source: https://thegraph.com/en/]
|
||||
|
||||
Returns
|
||||
-------
|
||||
pd.DataFrame
|
||||
Trade-able pairs listed on Uniswap by top volume.
|
||||
"""
|
||||
|
||||
query = """
|
||||
{
|
||||
pairs(first: 1000, where: {reserveUSD_gt: "1000", volumeUSD_gt: "10000"},
|
||||
orderBy: volumeUSD, orderDirection: desc) {
|
||||
token0 {
|
||||
symbol
|
||||
name
|
||||
}
|
||||
token1 {
|
||||
symbol
|
||||
name
|
||||
}
|
||||
volumeUSD
|
||||
txCount
|
||||
}
|
||||
}
|
||||
"""
|
||||
data = query_graph(UNI_URL, query)
|
||||
if not data:
|
||||
return pd.DataFrame()
|
||||
df = pd.json_normalize(data["pairs"])
|
||||
return df[
|
||||
[
|
||||
"token0.name",
|
||||
"token0.symbol",
|
||||
"token1.name",
|
||||
"token1.symbol",
|
||||
"volumeUSD",
|
||||
"txCount",
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def get_last_uni_swaps(
|
||||
limit: int = 100, sortby: str = "timestamp", ascend: bool = False
|
||||
) -> pd.DataFrame:
|
||||
"""Get the last 100 swaps done on Uniswap [Source: https://thegraph.com/en/]
|
||||
|
||||
Parameters
|
||||
----------
|
||||
limit: int
|
||||
Number of swaps to return. Maximum possible number: 1000.
|
||||
sortby: str
|
||||
Key by which to sort data. The table can be sorted by every of its columns
|
||||
(see https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2).
|
||||
ascend: bool
|
||||
Flag to sort data descending
|
||||
|
||||
Returns
|
||||
-------
|
||||
pd.DataFrame
|
||||
Last 100 swaps on Uniswap
|
||||
"""
|
||||
|
||||
limit = min(limit, 1000)
|
||||
|
||||
query = f"""
|
||||
{{
|
||||
swaps(first: {limit}, orderBy: timestamp, orderDirection: desc) {{
|
||||
timestamp
|
||||
pair {{
|
||||
token0 {{
|
||||
symbol
|
||||
}}
|
||||
token1 {{
|
||||
symbol
|
||||
}}
|
||||
}}
|
||||
amountUSD
|
||||
}}
|
||||
}}
|
||||
"""
|
||||
|
||||
data = query_graph(UNI_URL, query)
|
||||
if not data:
|
||||
return pd.DataFrame()
|
||||
df = pd.json_normalize(data["swaps"])
|
||||
|
||||
df["timestamp"] = df["timestamp"].apply(
|
||||
lambda x: datetime.datetime.fromtimestamp(int(x))
|
||||
)
|
||||
df["amountUSD"] = df["amountUSD"].apply(lambda x: round(float(x), 2))
|
||||
to_rename = {
|
||||
"timestamp": "Datetime",
|
||||
"amountUSD": "USD",
|
||||
"pair.token0.symbol": "From",
|
||||
"pair.token1.symbol": "To",
|
||||
}
|
||||
df = df.rename(columns=to_rename)
|
||||
if sortby in df.columns:
|
||||
df = df.sort_values(by=sortby, ascending=ascend)
|
||||
else:
|
||||
console.print(f"[red]Dataframe does not have column {sortby}[/red]\n")
|
||||
return df
|
||||
@@ -1,280 +0,0 @@
|
||||
"""The Graph view"""
|
||||
__docformat__ = "numpy"
|
||||
|
||||
import logging
|
||||
import os
|
||||
from typing import Optional
|
||||
|
||||
from openbb_terminal import rich_config
|
||||
from openbb_terminal.core.session.current_user import get_current_user
|
||||
from openbb_terminal.cryptocurrency.dataframe_helpers import (
|
||||
lambda_very_long_number_formatter,
|
||||
)
|
||||
from openbb_terminal.cryptocurrency.defi import graph_model
|
||||
from openbb_terminal.decorators import log_start_end
|
||||
from openbb_terminal.helper_funcs import export_data, print_rich_table
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def display_uni_tokens(
|
||||
skip: int = 0,
|
||||
limit: int = 20,
|
||||
sortby: str = "index",
|
||||
ascend: bool = False,
|
||||
export: str = "",
|
||||
sheet_name: Optional[str] = None,
|
||||
) -> None:
|
||||
"""Prints table showing tokens trade-able on Uniswap DEX.
|
||||
[Source: https://thegraph.com/en/]
|
||||
|
||||
Parameters
|
||||
----------
|
||||
skip: int
|
||||
Number of records to skip
|
||||
limit: int
|
||||
Number of records to display
|
||||
sortby: str
|
||||
Key by which to sort data
|
||||
ascend: bool
|
||||
Flag to sort data descending
|
||||
export : str
|
||||
Export dataframe data to csv,json,xlsx file
|
||||
"""
|
||||
|
||||
df = graph_model.get_uni_tokens(skip=skip)
|
||||
df_data = df.copy()
|
||||
|
||||
# Converting these to float
|
||||
df["tradeVolumeUSD"] = df["tradeVolumeUSD"].astype(float)
|
||||
df["totalLiquidity"] = df["totalLiquidity"].astype(float)
|
||||
df["txCount"] = df["txCount"].astype(float)
|
||||
|
||||
df = df.sort_values(by=sortby, ascending=ascend)
|
||||
|
||||
if rich_config.USE_COLOR and not get_current_user().preferences.USE_INTERACTIVE_DF:
|
||||
df[["totalLiquidity", "tradeVolumeUSD"]] = df[
|
||||
["totalLiquidity", "tradeVolumeUSD"]
|
||||
].applymap(lambda x: lambda_very_long_number_formatter(x))
|
||||
|
||||
print_rich_table(
|
||||
df,
|
||||
headers=list(df.columns),
|
||||
show_index=False,
|
||||
title="UniSwarp DEX Trade-able Tokens",
|
||||
export=bool(export),
|
||||
limit=limit,
|
||||
)
|
||||
|
||||
export_data(
|
||||
export,
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
"tokens",
|
||||
df_data,
|
||||
sheet_name,
|
||||
)
|
||||
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def display_uni_stats(export: str = "", sheet_name: Optional[str] = None) -> None:
|
||||
"""Prints table showing base statistics about Uniswap DEX. [Source: https://thegraph.com/en/]
|
||||
[Source: https://thegraph.com/en/]
|
||||
|
||||
Parameters
|
||||
----------
|
||||
|
||||
export : str
|
||||
Export dataframe data to csv,json,xlsx file
|
||||
"""
|
||||
|
||||
df = graph_model.get_uniswap_stats()
|
||||
df_data = df.copy()
|
||||
|
||||
print_rich_table(
|
||||
df,
|
||||
headers=list(df.columns),
|
||||
show_index=False,
|
||||
title="Uniswap DEX Base Statistics",
|
||||
export=bool(export),
|
||||
)
|
||||
|
||||
export_data(
|
||||
export,
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
"stats",
|
||||
df_data,
|
||||
sheet_name,
|
||||
)
|
||||
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def display_recently_added(
|
||||
limit: int = 20,
|
||||
days: int = 7,
|
||||
min_volume: int = 20,
|
||||
min_liquidity: int = 0,
|
||||
min_tx: int = 100,
|
||||
sortby: str = "created",
|
||||
ascend: bool = False,
|
||||
export: str = "",
|
||||
sheet_name: Optional[str] = None,
|
||||
) -> None:
|
||||
"""Prints table showing Lastly added pairs on Uniswap DEX.
|
||||
[Source: https://thegraph.com/en/]
|
||||
|
||||
Parameters
|
||||
----------
|
||||
limit: int
|
||||
Number of records to display
|
||||
days: int
|
||||
Number of days the pair has been active,
|
||||
min_volume: int
|
||||
Minimum trading volume,
|
||||
min_liquidity: int
|
||||
Minimum liquidity
|
||||
min_tx: int
|
||||
Minimum number of transactions
|
||||
sortby: str
|
||||
Key by which to sort data
|
||||
ascend: bool
|
||||
Flag to sort data descending
|
||||
export : str
|
||||
Export dataframe data to csv,json,xlsx file
|
||||
"""
|
||||
|
||||
df = graph_model.get_uniswap_pool_recently_added(
|
||||
last_days=days,
|
||||
min_volume=min_volume,
|
||||
min_liquidity=min_liquidity,
|
||||
min_tx=min_tx,
|
||||
)
|
||||
df_data = df.copy()
|
||||
|
||||
# Converting these to float
|
||||
df["volumeUSD"] = df["volumeUSD"].astype(float)
|
||||
df["txCount"] = df["txCount"].astype(float)
|
||||
df["totalSupply"] = df["totalSupply"].astype(float)
|
||||
|
||||
df = df.sort_values(by=sortby, ascending=ascend)
|
||||
|
||||
df[["volumeUSD", "totalSupply"]] = df[["volumeUSD", "totalSupply"]].applymap(
|
||||
lambda x: lambda_very_long_number_formatter(x)
|
||||
)
|
||||
|
||||
print_rich_table(
|
||||
df,
|
||||
headers=list(df.columns),
|
||||
show_index=False,
|
||||
title="Latest Added Pairs on Uniswap DEX",
|
||||
export=bool(export),
|
||||
limit=limit,
|
||||
)
|
||||
|
||||
export_data(
|
||||
export,
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
"pairs",
|
||||
df_data,
|
||||
sheet_name,
|
||||
)
|
||||
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def display_uni_pools(
|
||||
limit: int = 20,
|
||||
sortby: str = "volumeUSD",
|
||||
ascend: bool = True,
|
||||
export: str = "",
|
||||
sheet_name: Optional[str] = None,
|
||||
) -> None:
|
||||
"""Prints table showing uniswap pools by volume.
|
||||
[Source: https://thegraph.com/en/]
|
||||
|
||||
Parameters
|
||||
----------
|
||||
limit: int
|
||||
Number of records to display
|
||||
sortby: str
|
||||
Key by which to sort data. The table can be sorted by every of its columns
|
||||
(see https://bit.ly/3ORagr1 then press ctrl-enter or execute the query).
|
||||
ascend: bool
|
||||
Flag to sort data descending
|
||||
export : str
|
||||
Export dataframe data to csv,json,xlsx file
|
||||
"""
|
||||
|
||||
df = graph_model.get_uni_pools_by_volume()
|
||||
|
||||
# Converting these to float
|
||||
df["volumeUSD"] = df["volumeUSD"].astype(float)
|
||||
df["txCount"] = df["txCount"].astype(float)
|
||||
|
||||
df = df.sort_values(by=sortby, ascending=ascend)
|
||||
|
||||
df["volumeUSD"] = df["volumeUSD"].apply(
|
||||
lambda x: lambda_very_long_number_formatter(x)
|
||||
)
|
||||
df_data = df.copy()
|
||||
|
||||
print_rich_table(
|
||||
df,
|
||||
headers=list(df.columns),
|
||||
show_index=False,
|
||||
title="Uniswap Pools",
|
||||
export=bool(export),
|
||||
limit=limit,
|
||||
)
|
||||
|
||||
export_data(
|
||||
export,
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
"pools",
|
||||
df_data,
|
||||
sheet_name,
|
||||
)
|
||||
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def display_last_uni_swaps(
|
||||
limit: int = 10,
|
||||
sortby: str = "timestamp",
|
||||
ascend: bool = False,
|
||||
export: str = "",
|
||||
sheet_name: Optional[str] = None,
|
||||
) -> None:
|
||||
"""Prints table showing last swaps done on Uniswap
|
||||
[Source: https://thegraph.com/en/]
|
||||
|
||||
Parameters
|
||||
----------
|
||||
limit: int
|
||||
Number of records to display
|
||||
sortby: str
|
||||
Key by which to sort data. The table can be sorted by every of its columns
|
||||
(see https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2).
|
||||
ascend: bool
|
||||
Flag to sort data descending
|
||||
export : str
|
||||
Export dataframe data to csv,json,xlsx file
|
||||
"""
|
||||
|
||||
df = graph_model.get_last_uni_swaps(limit=limit, sortby=sortby, ascend=ascend)
|
||||
|
||||
print_rich_table(
|
||||
df,
|
||||
headers=list(df.columns),
|
||||
show_index=False,
|
||||
title="Last Uniswap Swaps",
|
||||
export=bool(export),
|
||||
)
|
||||
|
||||
export_data(
|
||||
export,
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
"swaps",
|
||||
df,
|
||||
sheet_name,
|
||||
)
|
||||
510
openbb_terminal/economy/datasets/cpi.csv
vendored
510
openbb_terminal/economy/datasets/cpi.csv
vendored
@@ -1,256 +1,256 @@
|
||||
title,country,frequency,units,series_id
|
||||
Consumer Price Index for Australia,australia,annual,growth_previous,CPALTT01AUA657N
|
||||
Consumer Price Index for Australia,australia,annual,growth_same,CPALTT01AUA659N
|
||||
Consumer Price Index for Australia,australia,quarterly,growth_previous,CPALTT01AUQ657N
|
||||
Consumer Price Index for Australia,australia,quarterly,growth_same,CPALTT01AUQ659N
|
||||
Consumer Price Index for Austria,austria,annual,growth_previous,CPALTT01ATA657N
|
||||
Consumer Price Index for Austria,austria,annual,growth_same,CPALTT01ATA659N
|
||||
Consumer Price Index for Austria,austria,monthly,growth_previous,CPALTT01ATM657N
|
||||
Consumer Price Index for Austria,austria,monthly,growth_same,CPALTT01ATM659N
|
||||
Consumer Price Index for Austria,austria,quarterly,growth_previous,CPALTT01ATQ657N
|
||||
Consumer Price Index for Austria,austria,quarterly,growth_same,CPALTT01ATQ659N
|
||||
Consumer Price Index for Belgium,belgium,annual,growth_previous,CPALTT01BEA657N
|
||||
Consumer Price Index for Belgium,belgium,annual,growth_same,CPALTT01BEA659N
|
||||
Consumer Price Index for Belgium,belgium,monthly,growth_previous,CPALTT01BEM657N
|
||||
Consumer Price Index for Belgium,belgium,monthly,growth_same,CPALTT01BEM659N
|
||||
Consumer Price Index for Belgium,belgium,quarterly,growth_previous,CPALTT01BEQ657N
|
||||
Consumer Price Index for Belgium,belgium,quarterly,growth_same,CPALTT01BEQ659N
|
||||
Consumer Price Index for Brazil,brazil,annual,growth_previous,CPALTT01BRA657N
|
||||
Consumer Price Index for Brazil,brazil,annual,growth_same,CPALTT01BRA659N
|
||||
Consumer Price Index for Brazil,brazil,monthly,growth_previous,CPALTT01BRM657N
|
||||
Consumer Price Index for Brazil,brazil,monthly,growth_same,CPALTT01BRM659N
|
||||
Consumer Price Index for Brazil,brazil,quarterly,growth_previous,CPALTT01BRQ657N
|
||||
Consumer Price Index for Brazil,brazil,quarterly,growth_same,CPALTT01BRQ659N
|
||||
Consumer Price Index for Canada,canada,annual,index_2015,CPALCY01CAA661N
|
||||
Consumer Price Index for Canada,canada,monthly,index_2015,CPALCY01CAM661N
|
||||
Consumer Price Index for Canada,canada,quarterly,index_2015,CPALCY01CAQ661N
|
||||
Consumer Price Index for Canada,canada,annual,growth_previous,CPALTT01CAA657N
|
||||
Consumer Price Index for Canada,canada,annual,growth_same,CPALTT01CAA659N
|
||||
Consumer Price Index for Canada,canada,monthly,growth_previous,CPALTT01CAM657N
|
||||
Consumer Price Index for Canada,canada,monthly,growth_same,CPALTT01CAM659N
|
||||
Consumer Price Index for Canada,canada,quarterly,growth_previous,CPALTT01CAQ657N
|
||||
Consumer Price Index for Canada,canada,quarterly,growth_same,CPALTT01CAQ659N
|
||||
Consumer Price Index for Chile,chile,annual,growth_previous,CPALTT01CLA657N
|
||||
Consumer Price Index for Chile,chile,annual,growth_same,CPALTT01CLA659N
|
||||
Consumer Price Index for Chile,chile,monthly,growth_previous,CPALTT01CLM657N
|
||||
Consumer Price Index for Chile,chile,monthly,growth_same,CPALTT01CLM659N
|
||||
Consumer Price Index for Chile,chile,quarterly,growth_previous,CPALTT01CLQ657N
|
||||
Consumer Price Index for Chile,chile,quarterly,growth_same,CPALTT01CLQ659N
|
||||
Consumer Price Index for China,china,annual,growth_previous,CPALTT01CNA657N
|
||||
Consumer Price Index for China,china,monthly,growth_same,CPALTT01CNM657N
|
||||
Consumer Price Index for China,china,monthly,growth_previous,CPALTT01CNM659N
|
||||
Consumer Price Index for China,china,quarterly,growth_same,CPALTT01CNQ657N
|
||||
Consumer Price Index for China,china,quarterly,growth_previous,CPALTT01CNQ659N
|
||||
Consumer Price Index for Denmark,denmark,annual,growth_same,CPALTT01DKA657N
|
||||
Consumer Price Index for Denmark,denmark,annual,growth_previous,CPALTT01DKA659N
|
||||
Consumer Price Index for Denmark,denmark,monthly,growth_same,CPALTT01DKM657N
|
||||
Consumer Price Index for Denmark,denmark,monthly,growth_previous,CPALTT01DKM659N
|
||||
Consumer Price Index for Denmark,denmark,quarterly,growth_same,CPALTT01DKQ657N
|
||||
Consumer Price Index for Denmark,denmark,quarterly,growth_previous,CPALTT01DKQ659N
|
||||
Consumer Price Index for Estonia,estonia,annual,growth_same,CPALTT01EEA657N
|
||||
Consumer Price Index for Estonia,estonia,annual,growth_previous,CPALTT01EEA659N
|
||||
Consumer Price Index for Estonia,estonia,annual,index_2015,CPALTT01EEA661N
|
||||
Consumer Price Index for Estonia,estonia,monthly,growth_previous,CPALTT01EEM657N
|
||||
Consumer Price Index for Estonia,estonia,monthly,growth_same,CPALTT01EEM659N
|
||||
Consumer Price Index for Estonia,estonia,monthly,index_2015,CPALTT01EEM661N
|
||||
Consumer Price Index for Estonia,estonia,quarterly,growth_same,CPALTT01EEQ657N
|
||||
Consumer Price Index for Estonia,estonia,quarterly,growth_previous,CPALTT01EEQ659N
|
||||
Consumer Price Index for Estonia,estonia,quarterly,index_2015,CPALTT01EEQ661N
|
||||
Consumer Price Index for Finland,finland,annual,growth_previous,CPALTT01FIA657N
|
||||
Consumer Price Index for Finland,finland,annual,growth_same,CPALTT01FIA659N
|
||||
Consumer Price Index for Finland,finland,monthly,growth_previous,CPALTT01FIM657N
|
||||
Consumer Price Index for Finland,finland,monthly,growth_same,CPALTT01FIM659N
|
||||
Consumer Price Index for Finland,finland,quarterly,growth_previous,CPALTT01FIQ657N
|
||||
Consumer Price Index for Finland,finland,quarterly,growth_same,CPALTT01FIQ659N
|
||||
Consumer Price Index for France,france,annual,growth_previous,CPALTT01FRA657N
|
||||
Consumer Price Index for France,france,annual,growth_same,CPALTT01FRA659N
|
||||
Consumer Price Index for France,france,monthly,growth_previous,CPALTT01FRM657N
|
||||
Consumer Price Index for France,france,monthly,growth_same,CPALTT01FRM659N
|
||||
Consumer Price Index for France,france,quarterly,growth_previous,CPALTT01FRQ657N
|
||||
Consumer Price Index for France,france,quarterly,growth_same,CPALTT01FRQ659N
|
||||
Consumer Price Index for Germany,germany,annual,growth_same,CPALTT01DEA657N
|
||||
Consumer Price Index for Germany,germany,annual,growth_previous,CPALTT01DEA659N
|
||||
Consumer Price Index for Germany,germany,monthly,growth_same,CPALTT01DEM657N
|
||||
Consumer Price Index for Germany,germany,monthly,growth_previous,CPALTT01DEM659N
|
||||
Consumer Price Index for Germany,germany,quarterly,growth_same,CPALTT01DEQ657N
|
||||
Consumer Price Index for Germany,germany,quarterly,growth_previous,CPALTT01DEQ659N
|
||||
Consumer Price Index for Greece,greece,annual,growth_previous,CPALTT01GRA657N
|
||||
Consumer Price Index for Greece,greece,annual,growth_same,CPALTT01GRA659N
|
||||
Consumer Price Index for Greece,greece,monthly,growth_previous,CPALTT01GRM657N
|
||||
Consumer Price Index for Greece,greece,monthly,growth_same,CPALTT01GRM659N
|
||||
Consumer Price Index for Greece,greece,quarterly,growth_previous,CPALTT01GRQ657N
|
||||
Consumer Price Index for Greece,greece,quarterly,growth_same,CPALTT01GRQ659N
|
||||
Consumer Price Index for Hungary,hungary,annual,growth_previous,CPALTT01HUA657N
|
||||
Consumer Price Index for Hungary,hungary,annual,growth_same,CPALTT01HUA659N
|
||||
Consumer Price Index for Hungary,hungary,monthly,growth_previous,CPALTT01HUM657N
|
||||
Consumer Price Index for Hungary,hungary,monthly,growth_same,CPALTT01HUM659N
|
||||
Consumer Price Index for Hungary,hungary,quarterly,growth_previous,CPALTT01HUQ657N
|
||||
Consumer Price Index for Hungary,hungary,quarterly,growth_same,CPALTT01HUQ659N
|
||||
Consumer Price Index for Iceland,iceland,annual,growth_previous,CPALTT01ISA657N
|
||||
Consumer Price Index for Iceland,iceland,annual,growth_same,CPALTT01ISA659N
|
||||
Consumer Price Index for Iceland,iceland,monthly,growth_previous,CPALTT01ISM657N
|
||||
Consumer Price Index for Iceland,iceland,monthly,growth_same,CPALTT01ISM659N
|
||||
Consumer Price Index for Iceland,iceland,quarterly,growth_previous,CPALTT01ISQ657N
|
||||
Consumer Price Index for Iceland,iceland,quarterly,growth_same,CPALTT01ISQ659N
|
||||
Consumer Price Index for India,india,annual,growth_previous,CPALTT01INA657N
|
||||
Consumer Price Index for India,india,annual,growth_same,CPALTT01INA659N
|
||||
Consumer Price Index for India,india,monthly,growth_previous,CPALTT01INM657N
|
||||
Consumer Price Index for India,india,monthly,growth_same,CPALTT01INM659N
|
||||
Consumer Price Index for India,india,quarterly,growth_previous,CPALTT01INQ657N
|
||||
Consumer Price Index for India,india,quarterly,growth_same,CPALTT01INQ659N
|
||||
Consumer Price Index for Indonesia,indonesia,annual,growth_previous,CPALTT01IDA657N
|
||||
Consumer Price Index for Indonesia,indonesia,annual,growth_same,CPALTT01IDA659N
|
||||
Consumer Price Index for Indonesia,indonesia,monthly,growth_previous,CPALTT01IDM657N
|
||||
Consumer Price Index for Indonesia,indonesia,monthly,growth_same,CPALTT01IDM659N
|
||||
Consumer Price Index for Indonesia,indonesia,quarterly,growth_previous,CPALTT01IDQ657N
|
||||
Consumer Price Index for Indonesia,indonesia,quarterly,growth_same,CPALTT01IDQ659N
|
||||
Consumer Price Index for Ireland,ireland,annual,growth_previous,CPALTT01IEA657N
|
||||
Consumer Price Index for Ireland,ireland,annual,growth_same,CPALTT01IEA659N
|
||||
Consumer Price Index for Ireland,ireland,monthly,growth_previous,CPALTT01IEM657N
|
||||
Consumer Price Index for Ireland,ireland,monthly,growth_same,CPALTT01IEM659N
|
||||
Consumer Price Index for Ireland,ireland,quarterly,growth_previous,CPALTT01IEQ657N
|
||||
Consumer Price Index for Ireland,ireland,quarterly,growth_same,CPALTT01IEQ659N
|
||||
Consumer Price Index for Israel,israel,annual,growth_previous,CPALTT01ILA657N
|
||||
Consumer Price Index for Israel,israel,annual,growth_same,CPALTT01ILA659N
|
||||
Consumer Price Index for Israel,israel,monthly,growth_previous,CPALTT01ILM657N
|
||||
Consumer Price Index for Israel,israel,monthly,growth_same,CPALTT01ILM659N
|
||||
Consumer Price Index for Israel,israel,quarterly,growth_previous,CPALTT01ILQ657N
|
||||
Consumer Price Index for Israel,israel,quarterly,growth_same,CPALTT01ILQ659N
|
||||
Consumer Price Index for Italy,italy,annual,growth_previous,CPALTT01ITA657N
|
||||
Consumer Price Index for Italy,italy,annual,growth_same,CPALTT01ITA659N
|
||||
Consumer Price Index for Italy,italy,monthly,growth_previous,CPALTT01ITM657N
|
||||
Consumer Price Index for Italy,italy,monthly,growth_same,CPALTT01ITM659N
|
||||
Consumer Price Index for Italy,italy,quarterly,growth_previous,CPALTT01ITQ657N
|
||||
Consumer Price Index for Italy,italy,quarterly,growth_same,CPALTT01ITQ659N
|
||||
Consumer Price Index for Japan,japan,monthly,index_2015,CPALCY01JPM661N
|
||||
Consumer Price Index for Japan,japan,quarterly,index_2015,CPALCY01JPQ661N
|
||||
Consumer Price Index for Japan,japan,monthly,growth_previous,CPALTT01JPM657N
|
||||
Consumer Price Index for Japan,japan,monthly,growth_same,CPALTT01JPM659N
|
||||
Consumer Price Index for Japan,japan,monthly,index_2015,CPALTT01JPM661S
|
||||
Consumer Price Index for Japan,japan,quarterly,growth_same,CPALTT01JPQ657N
|
||||
Consumer Price Index for Japan,japan,quarterly,growth_previous,CPALTT01JPQ659N
|
||||
Consumer Price Index for Japan,japan,quarterly,index_2015,CPALTT01JPQ661S
|
||||
Consumer Price Index for Luxembourg,luxembourg,annual,growth_previous,CPALTT01LUA657N
|
||||
Consumer Price Index for Luxembourg,luxembourg,annual,growth_same,CPALTT01LUA659N
|
||||
Consumer Price Index for Luxembourg,luxembourg,monthly,growth_previous,CPALTT01LUM657N
|
||||
Consumer Price Index for Luxembourg,luxembourg,monthly,growth_same,CPALTT01LUM659N
|
||||
Consumer Price Index for Luxembourg,luxembourg,quarterly,growth_previous,CPALTT01LUQ657N
|
||||
Consumer Price Index for Luxembourg,luxembourg,quarterly,growth_same,CPALTT01LUQ659N
|
||||
Consumer Price Index for Mexico,mexico,annual,index_2015,CPALCY01MXA661N
|
||||
Consumer Price Index for Mexico,mexico,monthly,index_2015,CPALCY01MXM661N
|
||||
Consumer Price Index for Mexico,mexico,quarterly,index_2015,CPALCY01MXQ661N
|
||||
Consumer Price Index for Mexico,mexico,annual,growth_previous,CPALTT01MXA657N
|
||||
Consumer Price Index for Mexico,mexico,annual,growth_same,CPALTT01MXA659N
|
||||
Consumer Price Index for Mexico,mexico,monthly,growth_previous,CPALTT01MXM657N
|
||||
Consumer Price Index for Mexico,mexico,monthly,growth_same,CPALTT01MXM659N
|
||||
Consumer Price Index for Mexico,mexico,quarterly,growth_previous,CPALTT01MXQ657N
|
||||
Consumer Price Index for Mexico,mexico,quarterly,growth_same,CPALTT01MXQ659N
|
||||
Consumer Price Index for New Zealand,new_zealand,annual,index_2015,CPALCY01NZA661N
|
||||
Consumer Price Index for New Zealand,new_zealand,quarterly,index_2015,CPALCY01NZQ661N
|
||||
Consumer Price Index for New Zealand,new_zealand,annual,growth_previous,CPALTT01NZA657N
|
||||
Consumer Price Index for New Zealand,new_zealand,annual,growth_same,CPALTT01NZA659N
|
||||
Consumer Price Index for New Zealand,new_zealand,quarterly,growth_previous,CPALTT01NZQ657N
|
||||
Consumer Price Index for New Zealand,new_zealand,quarterly,growth_same,CPALTT01NZQ659N
|
||||
Consumer Price Index for Norway,norway,annual,growth_previous,CPALTT01NOA657N
|
||||
Consumer Price Index for Norway,norway,annual,growth_same,CPALTT01NOA659N
|
||||
Consumer Price Index for Norway,norway,monthly,growth_previous,CPALTT01NOM657N
|
||||
Consumer Price Index for Norway,norway,monthly,growth_same,CPALTT01NOM659N
|
||||
Consumer Price Index for Norway,norway,quarterly,growth_previous,CPALTT01NOQ657N
|
||||
Consumer Price Index for Norway,norway,quarterly,growth_same,CPALTT01NOQ659N
|
||||
Consumer Price Index for Poland,poland,annual,growth_previous,CPALTT01PLA657N
|
||||
Consumer Price Index for Poland,poland,annual,growth_same,CPALTT01PLA659N
|
||||
Consumer Price Index for Poland,poland,monthly,growth_previous,CPALTT01PLM657N
|
||||
Consumer Price Index for Poland,poland,monthly,growth_same,CPALTT01PLM659N
|
||||
Consumer Price Index for Poland,poland,quarterly,growth_previous,CPALTT01PLQ657N
|
||||
Consumer Price Index for Poland,poland,quarterly,growth_same,CPALTT01PLQ659N
|
||||
Consumer Price Index for Portugal,portugal,annual,growth_previous,CPALTT01PTA657N
|
||||
Consumer Price Index for Portugal,portugal,annual,growth_same,CPALTT01PTA659N
|
||||
Consumer Price Index for Portugal,portugal,monthly,growth_previous,CPALTT01PTM657N
|
||||
Consumer Price Index for Portugal,portugal,monthly,growth_same,CPALTT01PTM659N
|
||||
Consumer Price Index for Portugal,portugal,quarterly,growth_previous,CPALTT01PTQ657N
|
||||
Consumer Price Index for Portugal,portugal,quarterly,growth_same,CPALTT01PTQ659N
|
||||
Consumer Price Index for Slovenia,slovenia,annual,growth_previous,CPALTT01SIA657N
|
||||
Consumer Price Index for Slovenia,slovenia,annual,growth_same,CPALTT01SIA659N
|
||||
Consumer Price Index for Slovenia,slovenia,monthly,growth_previous,CPALTT01SIM657N
|
||||
Consumer Price Index for Slovenia,slovenia,monthly,growth_same,CPALTT01SIM659N
|
||||
Consumer Price Index for Slovenia,slovenia,quarterly,growth_previous,CPALTT01SIQ657N
|
||||
Consumer Price Index for Slovenia,slovenia,quarterly,growth_same,CPALTT01SIQ659N
|
||||
Consumer Price Index for South Africa,south_africa,annual,growth_previous,CPALTT01ZAA657N
|
||||
Consumer Price Index for South Africa,south_africa,annual,growth_same,CPALTT01ZAA659N
|
||||
Consumer Price Index for South Africa,south_africa,monthly,growth_previous,CPALTT01ZAM657N
|
||||
Consumer Price Index for South Africa,south_africa,monthly,growth_same,CPALTT01ZAM659N
|
||||
Consumer Price Index for South Africa,south_africa,quarterly,growth_previous,CPALTT01ZAQ657N
|
||||
Consumer Price Index for South Africa,south_africa,quarterly,growth_same,CPALTT01ZAQ659N
|
||||
Consumer Price Index for Spain,spain,annual,growth_previous,CPALTT01ESA657N
|
||||
Consumer Price Index for Spain,spain,annual,growth_same,CPALTT01ESA659N
|
||||
Consumer Price Index for Spain,spain,monthly,growth_previous,CPALTT01ESM657N
|
||||
Consumer Price Index for Spain,spain,monthly,growth_same,CPALTT01ESM659N
|
||||
Consumer Price Index for Spain,spain,quarterly,growth_previous,CPALTT01ESQ657N
|
||||
Consumer Price Index for Spain,spain,quarterly,growth_same,CPALTT01ESQ659N
|
||||
Consumer Price Index for Sweden,sweden,annual,growth_previous,CPALTT01SEA657N
|
||||
Consumer Price Index for Sweden,sweden,annual,growth_same,CPALTT01SEA659N
|
||||
Consumer Price Index for Sweden,sweden,monthly,growth_previous,CPALTT01SEM657N
|
||||
Consumer Price Index for Sweden,sweden,monthly,growth_same,CPALTT01SEM659N
|
||||
Consumer Price Index for Sweden,sweden,quarterly,growth_previous,CPALTT01SEQ657N
|
||||
Consumer Price Index for Sweden,sweden,quarterly,growth_same,CPALTT01SEQ659N
|
||||
Consumer Price Index for Switzerland,switzerland,annual,growth_previous,CPALTT01CHA657N
|
||||
Consumer Price Index for Switzerland,switzerland,annual,growth_same,CPALTT01CHA659N
|
||||
Consumer Price Index for Switzerland,switzerland,monthly,growth_previous,CPALTT01CHM657N
|
||||
Consumer Price Index for Switzerland,switzerland,monthly,growth_same,CPALTT01CHM659N
|
||||
Consumer Price Index for Switzerland,switzerland,quarterly,growth_previous,CPALTT01CHQ657N
|
||||
Consumer Price Index for Switzerland,switzerland,quarterly,growth_same,CPALTT01CHQ659N
|
||||
Consumer Price Index for the Czech Republic,czech_republic,annual,growth_same,CPALTT01CZA657N
|
||||
Consumer Price Index for the Czech Republic,czech_republic,annual,growth_previous,CPALTT01CZA659N
|
||||
Consumer Price Index for the Czech Republic,czech_republic,monthly,growth_same,CPALTT01CZM657N
|
||||
Consumer Price Index for the Czech Republic,czech_republic,monthly,growth_previous,CPALTT01CZM659N
|
||||
Consumer Price Index for the Czech Republic,czech_republic,quarterly,growth_same,CPALTT01CZQ657N
|
||||
Consumer Price Index for the Czech Republic,czech_republic,quarterly,growth_previous,CPALTT01CZQ659N
|
||||
Consumer Price Index for the Netherlands,netherlands,annual,growth_previous,CPALTT01NLA657N
|
||||
Consumer Price Index for the Netherlands,netherlands,annual,growth_same,CPALTT01NLA659N
|
||||
Consumer Price Index for the Netherlands,netherlands,monthly,growth_previous,CPALTT01NLM657N
|
||||
Consumer Price Index for the Netherlands,netherlands,monthly,growth_same,CPALTT01NLM659N
|
||||
Consumer Price Index for the Netherlands,netherlands,quarterly,growth_previous,CPALTT01NLQ657N
|
||||
Consumer Price Index for the Netherlands,netherlands,quarterly,growth_same,CPALTT01NLQ659N
|
||||
Consumer Price Index for the Republic of Korea,korea,annual,growth_previous,CPALTT01KRA657N
|
||||
Consumer Price Index for the Republic of Korea,korea,annual,growth_same,CPALTT01KRA659N
|
||||
Consumer Price Index for the Republic of Korea,korea,monthly,growth_previous,CPALTT01KRM657N
|
||||
Consumer Price Index for the Republic of Korea,korea,monthly,growth_same,CPALTT01KRM659N
|
||||
Consumer Price Index for the Republic of Korea,korea,quarterly,growth_previous,CPALTT01KRQ657N
|
||||
Consumer Price Index for the Republic of Korea,korea,quarterly,growth_same,CPALTT01KRQ659N
|
||||
Consumer Price Index for the Russian Federation,russian_federation,monthly,growth_previous,CPALTT01RUM657N
|
||||
Consumer Price Index for the Russian Federation,russian_federation,monthly,growth_same,CPALTT01RUM659N
|
||||
Consumer Price Index for the Russian Federation,russian_federation,quarterly,growth_previous,CPALTT01RUQ657N
|
||||
Consumer Price Index for the Russian Federation,russian_federation,quarterly,growth_same,CPALTT01RUQ659N
|
||||
Consumer Price Index for the Slovak Republic,slovak_republic,annual,growth_previous,CPALTT01SKA657N
|
||||
Consumer Price Index for the Slovak Republic,slovak_republic,annual,growth_same,CPALTT01SKA659N
|
||||
Consumer Price Index for the Slovak Republic,slovak_republic,monthly,growth_previous,CPALTT01SKM657N
|
||||
Consumer Price Index for the Slovak Republic,slovak_republic,monthly,growth_same,CPALTT01SKM659N
|
||||
Consumer Price Index for the Slovak Republic,slovak_republic,quarterly,growth_previous,CPALTT01SKQ657N
|
||||
Consumer Price Index for the Slovak Republic,slovak_republic,quarterly,growth_same,CPALTT01SKQ659N
|
||||
Consumer Price Index for the United Kingdom,the united kingdom,annual,growth_previous,CPALTT01GBA657N
|
||||
Consumer Price Index for the United Kingdom,united_kingdom,annual,growth_same,CPALTT01GBA659N
|
||||
Consumer Price Index for the United Kingdom,united_kingdom,monthly,growth_previous,CPALTT01GBM657N
|
||||
Consumer Price Index for the United Kingdom,united_kingdom,monthly,growth_same,CPALTT01GBM659N
|
||||
Consumer Price Index for the United Kingdom,united_kingdom,quarterly,growth_previous,CPALTT01GBQ657N
|
||||
Consumer Price Index for the United Kingdom,united_kingdom,quarterly,growth_same,CPALTT01GBQ659N
|
||||
Consumer Price Index for the United States,united_states,annual,index_2015,CPALCY01USA661N
|
||||
Consumer Price Index for the United States,united_states,monthly,index_2015,CPALCY01USM661N
|
||||
Consumer Price Index for the United States,united_states,quarterly,index_2015,CPALCY01USQ661N
|
||||
Consumer Price Index for the United States,united_states,annual,growth_previous,CPALTT01USA657N
|
||||
Consumer Price Index for the United States,united_states,annual,growth_same,CPALTT01USA659N
|
||||
Consumer Price Index for the United States,united_states,annual,index_2015,CPALTT01USA661S
|
||||
Consumer Price Index for the United States,united_states,monthly,growth_previous,CPALTT01USM657N
|
||||
Consumer Price Index for the United States,united_states,monthly,growth_same,CPALTT01USM659N
|
||||
Consumer Price Index for the United States,united_states,monthly,index_2015,CPALTT01USM661S
|
||||
Consumer Price Index for the United States,united_states,quarterly,growth_previous,CPALTT01USQ657N
|
||||
Consumer Price Index for the United States,united_states,quarterly,growth_same,CPALTT01USQ659N
|
||||
Consumer Price Index for the United States,united_states,quarterly,index_2015,CPALTT01USQ661S
|
||||
Consumer Price Index for Turkey,turkey,annual,index_2015,CPALCY01TRA661N
|
||||
Consumer Price Index for Turkey,turkey,monthly,index_2015,CPALCY01TRM661N
|
||||
Consumer Price Index for Turkey,turkey,quarterly,index_2015,CPALCY01TRQ661N
|
||||
Consumer Price Index for Turkey,turkey,annual,growth_previous,CPALTT01TRA657N
|
||||
Consumer Price Index for Turkey,turkey,annual,growth_same,CPALTT01TRA659N
|
||||
Consumer Price Index for Turkey,turkey,monthly,growth_previous,CPALTT01TRM657N
|
||||
Consumer Price Index for Turkey,turkey,monthly,growth_same,CPALTT01TRM659N
|
||||
Consumer Price Index for Turkey,turkey,quarterly,growth_previous,CPALTT01TRQ657N
|
||||
title,country,frequency,units,series_id
|
||||
Consumer Price Index for Australia,australia,annual,growth_previous,CPALTT01AUA657N
|
||||
Consumer Price Index for Australia,australia,annual,growth_same,CPALTT01AUA659N
|
||||
Consumer Price Index for Australia,australia,quarterly,growth_previous,CPALTT01AUQ657N
|
||||
Consumer Price Index for Australia,australia,quarterly,growth_same,CPALTT01AUQ659N
|
||||
Consumer Price Index for Austria,austria,annual,growth_previous,CPALTT01ATA657N
|
||||
Consumer Price Index for Austria,austria,annual,growth_same,CPALTT01ATA659N
|
||||
Consumer Price Index for Austria,austria,monthly,growth_previous,CPALTT01ATM657N
|
||||
Consumer Price Index for Austria,austria,monthly,growth_same,CPALTT01ATM659N
|
||||
Consumer Price Index for Austria,austria,quarterly,growth_previous,CPALTT01ATQ657N
|
||||
Consumer Price Index for Austria,austria,quarterly,growth_same,CPALTT01ATQ659N
|
||||
Consumer Price Index for Belgium,belgium,annual,growth_previous,CPALTT01BEA657N
|
||||
Consumer Price Index for Belgium,belgium,annual,growth_same,CPALTT01BEA659N
|
||||
Consumer Price Index for Belgium,belgium,monthly,growth_previous,CPALTT01BEM657N
|
||||
Consumer Price Index for Belgium,belgium,monthly,growth_same,CPALTT01BEM659N
|
||||
Consumer Price Index for Belgium,belgium,quarterly,growth_previous,CPALTT01BEQ657N
|
||||
Consumer Price Index for Belgium,belgium,quarterly,growth_same,CPALTT01BEQ659N
|
||||
Consumer Price Index for Brazil,brazil,annual,growth_previous,CPALTT01BRA657N
|
||||
Consumer Price Index for Brazil,brazil,annual,growth_same,CPALTT01BRA659N
|
||||
Consumer Price Index for Brazil,brazil,monthly,growth_previous,CPALTT01BRM657N
|
||||
Consumer Price Index for Brazil,brazil,monthly,growth_same,CPALTT01BRM659N
|
||||
Consumer Price Index for Brazil,brazil,quarterly,growth_previous,CPALTT01BRQ657N
|
||||
Consumer Price Index for Brazil,brazil,quarterly,growth_same,CPALTT01BRQ659N
|
||||
Consumer Price Index for Canada,canada,annual,index_2015,CPALCY01CAA661N
|
||||
Consumer Price Index for Canada,canada,monthly,index_2015,CPALCY01CAM661N
|
||||
Consumer Price Index for Canada,canada,quarterly,index_2015,CPALCY01CAQ661N
|
||||
Consumer Price Index for Canada,canada,annual,growth_previous,CPALTT01CAA657N
|
||||
Consumer Price Index for Canada,canada,annual,growth_same,CPALTT01CAA659N
|
||||
Consumer Price Index for Canada,canada,monthly,growth_previous,CPALTT01CAM657N
|
||||
Consumer Price Index for Canada,canada,monthly,growth_same,CPALTT01CAM659N
|
||||
Consumer Price Index for Canada,canada,quarterly,growth_previous,CPALTT01CAQ657N
|
||||
Consumer Price Index for Canada,canada,quarterly,growth_same,CPALTT01CAQ659N
|
||||
Consumer Price Index for Chile,chile,annual,growth_previous,CPALTT01CLA657N
|
||||
Consumer Price Index for Chile,chile,annual,growth_same,CPALTT01CLA659N
|
||||
Consumer Price Index for Chile,chile,monthly,growth_previous,CPALTT01CLM657N
|
||||
Consumer Price Index for Chile,chile,monthly,growth_same,CPALTT01CLM659N
|
||||
Consumer Price Index for Chile,chile,quarterly,growth_previous,CPALTT01CLQ657N
|
||||
Consumer Price Index for Chile,chile,quarterly,growth_same,CPALTT01CLQ659N
|
||||
Consumer Price Index for China,china,annual,growth_previous,CPALTT01CNA657N
|
||||
Consumer Price Index for China,china,monthly,growth_previous,CPALTT01CNM657N
|
||||
Consumer Price Index for China,china,monthly,growth_same,CPALTT01CNM659N
|
||||
Consumer Price Index for China,china,quarterly,growth_previous,CPALTT01CNQ657N
|
||||
Consumer Price Index for China,china,quarterly,growth_same,CPALTT01CNQ659N
|
||||
Consumer Price Index for Denmark,denmark,annual,growth_previous,CPALTT01DKA657N
|
||||
Consumer Price Index for Denmark,denmark,annual,growth_same,CPALTT01DKA659N
|
||||
Consumer Price Index for Denmark,denmark,monthly,growth_previous,CPALTT01DKM657N
|
||||
Consumer Price Index for Denmark,denmark,monthly,growth_same,CPALTT01DKM659N
|
||||
Consumer Price Index for Denmark,denmark,quarterly,growth_previous,CPALTT01DKQ657N
|
||||
Consumer Price Index for Denmark,denmark,quarterly,growth_same,CPALTT01DKQ659N
|
||||
Consumer Price Index for Estonia,estonia,annual,growth_previous,CPALTT01EEA657N
|
||||
Consumer Price Index for Estonia,estonia,annual,growth_same,CPALTT01EEA659N
|
||||
Consumer Price Index for Estonia,estonia,annual,index_2015,CPALTT01EEA661N
|
||||
Consumer Price Index for Estonia,estonia,monthly,growth_previous,CPALTT01EEM657N
|
||||
Consumer Price Index for Estonia,estonia,monthly,growth_same,CPALTT01EEM659N
|
||||
Consumer Price Index for Estonia,estonia,monthly,index_2015,CPALTT01EEM661N
|
||||
Consumer Price Index for Estonia,estonia,quarterly,growth_previous,CPALTT01EEQ657N
|
||||
Consumer Price Index for Estonia,estonia,quarterly,growth_same,CPALTT01EEQ659N
|
||||
Consumer Price Index for Estonia,estonia,quarterly,index_2015,CPALTT01EEQ661N
|
||||
Consumer Price Index for Finland,finland,annual,growth_previous,CPALTT01FIA657N
|
||||
Consumer Price Index for Finland,finland,annual,growth_same,CPALTT01FIA659N
|
||||
Consumer Price Index for Finland,finland,monthly,growth_previous,CPALTT01FIM657N
|
||||
Consumer Price Index for Finland,finland,monthly,growth_same,CPALTT01FIM659N
|
||||
Consumer Price Index for Finland,finland,quarterly,growth_previous,CPALTT01FIQ657N
|
||||
Consumer Price Index for Finland,finland,quarterly,growth_same,CPALTT01FIQ659N
|
||||
Consumer Price Index for France,france,annual,growth_previous,CPALTT01FRA657N
|
||||
Consumer Price Index for France,france,annual,growth_same,CPALTT01FRA659N
|
||||
Consumer Price Index for France,france,monthly,growth_previous,CPALTT01FRM657N
|
||||
Consumer Price Index for France,france,monthly,growth_same,CPALTT01FRM659N
|
||||
Consumer Price Index for France,france,quarterly,growth_previous,CPALTT01FRQ657N
|
||||
Consumer Price Index for France,france,quarterly,growth_same,CPALTT01FRQ659N
|
||||
Consumer Price Index for Germany,germany,annual,growth_previous,CPALTT01DEA657N
|
||||
Consumer Price Index for Germany,germany,annual,growth_same,CPALTT01DEA659N
|
||||
Consumer Price Index for Germany,germany,monthly,growth_previous,CPALTT01DEM657N
|
||||
Consumer Price Index for Germany,germany,monthly,growth_same,CPALTT01DEM659N
|
||||
Consumer Price Index for Germany,germany,quarterly,growth_previous,CPALTT01DEQ657N
|
||||
Consumer Price Index for Germany,germany,quarterly,growth_same,CPALTT01DEQ659N
|
||||
Consumer Price Index for Greece,greece,annual,growth_previous,CPALTT01GRA657N
|
||||
Consumer Price Index for Greece,greece,annual,growth_same,CPALTT01GRA659N
|
||||
Consumer Price Index for Greece,greece,monthly,growth_previous,CPALTT01GRM657N
|
||||
Consumer Price Index for Greece,greece,monthly,growth_same,CPALTT01GRM659N
|
||||
Consumer Price Index for Greece,greece,quarterly,growth_previous,CPALTT01GRQ657N
|
||||
Consumer Price Index for Greece,greece,quarterly,growth_same,CPALTT01GRQ659N
|
||||
Consumer Price Index for Hungary,hungary,annual,growth_previous,CPALTT01HUA657N
|
||||
Consumer Price Index for Hungary,hungary,annual,growth_same,CPALTT01HUA659N
|
||||
Consumer Price Index for Hungary,hungary,monthly,growth_previous,CPALTT01HUM657N
|
||||
Consumer Price Index for Hungary,hungary,monthly,growth_same,CPALTT01HUM659N
|
||||
Consumer Price Index for Hungary,hungary,quarterly,growth_previous,CPALTT01HUQ657N
|
||||
Consumer Price Index for Hungary,hungary,quarterly,growth_same,CPALTT01HUQ659N
|
||||
Consumer Price Index for Iceland,iceland,annual,growth_previous,CPALTT01ISA657N
|
||||
Consumer Price Index for Iceland,iceland,annual,growth_same,CPALTT01ISA659N
|
||||
Consumer Price Index for Iceland,iceland,monthly,growth_previous,CPALTT01ISM657N
|
||||
Consumer Price Index for Iceland,iceland,monthly,growth_same,CPALTT01ISM659N
|
||||
Consumer Price Index for Iceland,iceland,quarterly,growth_previous,CPALTT01ISQ657N
|
||||
Consumer Price Index for Iceland,iceland,quarterly,growth_same,CPALTT01ISQ659N
|
||||
Consumer Price Index for India,india,annual,growth_previous,CPALTT01INA657N
|
||||
Consumer Price Index for India,india,annual,growth_same,CPALTT01INA659N
|
||||
Consumer Price Index for India,india,monthly,growth_previous,CPALTT01INM657N
|
||||
Consumer Price Index for India,india,monthly,growth_same,CPALTT01INM659N
|
||||
Consumer Price Index for India,india,quarterly,growth_previous,CPALTT01INQ657N
|
||||
Consumer Price Index for India,india,quarterly,growth_same,CPALTT01INQ659N
|
||||
Consumer Price Index for Indonesia,indonesia,annual,growth_previous,CPALTT01IDA657N
|
||||
Consumer Price Index for Indonesia,indonesia,annual,growth_same,CPALTT01IDA659N
|
||||
Consumer Price Index for Indonesia,indonesia,monthly,growth_previous,CPALTT01IDM657N
|
||||
Consumer Price Index for Indonesia,indonesia,monthly,growth_same,CPALTT01IDM659N
|
||||
Consumer Price Index for Indonesia,indonesia,quarterly,growth_previous,CPALTT01IDQ657N
|
||||
Consumer Price Index for Indonesia,indonesia,quarterly,growth_same,CPALTT01IDQ659N
|
||||
Consumer Price Index for Ireland,ireland,annual,growth_previous,CPALTT01IEA657N
|
||||
Consumer Price Index for Ireland,ireland,annual,growth_same,CPALTT01IEA659N
|
||||
Consumer Price Index for Ireland,ireland,monthly,growth_previous,CPALTT01IEM657N
|
||||
Consumer Price Index for Ireland,ireland,monthly,growth_same,CPALTT01IEM659N
|
||||
Consumer Price Index for Ireland,ireland,quarterly,growth_previous,CPALTT01IEQ657N
|
||||
Consumer Price Index for Ireland,ireland,quarterly,growth_same,CPALTT01IEQ659N
|
||||
Consumer Price Index for Israel,israel,annual,growth_previous,CPALTT01ILA657N
|
||||
Consumer Price Index for Israel,israel,annual,growth_same,CPALTT01ILA659N
|
||||
Consumer Price Index for Israel,israel,monthly,growth_previous,CPALTT01ILM657N
|
||||
Consumer Price Index for Israel,israel,monthly,growth_same,CPALTT01ILM659N
|
||||
Consumer Price Index for Israel,israel,quarterly,growth_previous,CPALTT01ILQ657N
|
||||
Consumer Price Index for Israel,israel,quarterly,growth_same,CPALTT01ILQ659N
|
||||
Consumer Price Index for Italy,italy,annual,growth_previous,CPALTT01ITA657N
|
||||
Consumer Price Index for Italy,italy,annual,growth_same,CPALTT01ITA659N
|
||||
Consumer Price Index for Italy,italy,monthly,growth_previous,CPALTT01ITM657N
|
||||
Consumer Price Index for Italy,italy,monthly,growth_same,CPALTT01ITM659N
|
||||
Consumer Price Index for Italy,italy,quarterly,growth_previous,CPALTT01ITQ657N
|
||||
Consumer Price Index for Italy,italy,quarterly,growth_same,CPALTT01ITQ659N
|
||||
Consumer Price Index for Japan,japan,monthly,index_2015,CPALCY01JPM661N
|
||||
Consumer Price Index for Japan,japan,quarterly,index_2015,CPALCY01JPQ661N
|
||||
Consumer Price Index for Japan,japan,monthly,growth_previous,CPALTT01JPM657N
|
||||
Consumer Price Index for Japan,japan,monthly,growth_same,CPALTT01JPM659N
|
||||
Consumer Price Index for Japan,japan,monthly,index_2015,CPALTT01JPM661S
|
||||
Consumer Price Index for Japan,japan,quarterly,growth_previous,CPALTT01JPQ657N
|
||||
Consumer Price Index for Japan,japan,quarterly,growth_same,CPALTT01JPQ659N
|
||||
Consumer Price Index for Japan,japan,quarterly,index_2015,CPALTT01JPQ661S
|
||||
Consumer Price Index for Luxembourg,luxembourg,annual,growth_previous,CPALTT01LUA657N
|
||||
Consumer Price Index for Luxembourg,luxembourg,annual,growth_same,CPALTT01LUA659N
|
||||
Consumer Price Index for Luxembourg,luxembourg,monthly,growth_previous,CPALTT01LUM657N
|
||||
Consumer Price Index for Luxembourg,luxembourg,monthly,growth_same,CPALTT01LUM659N
|
||||
Consumer Price Index for Luxembourg,luxembourg,quarterly,growth_previous,CPALTT01LUQ657N
|
||||
Consumer Price Index for Luxembourg,luxembourg,quarterly,growth_same,CPALTT01LUQ659N
|
||||
Consumer Price Index for Mexico,mexico,annual,index_2015,CPALCY01MXA661N
|
||||
Consumer Price Index for Mexico,mexico,monthly,index_2015,CPALCY01MXM661N
|
||||
Consumer Price Index for Mexico,mexico,quarterly,index_2015,CPALCY01MXQ661N
|
||||
Consumer Price Index for Mexico,mexico,annual,growth_previous,CPALTT01MXA657N
|
||||
Consumer Price Index for Mexico,mexico,annual,growth_same,CPALTT01MXA659N
|
||||
Consumer Price Index for Mexico,mexico,monthly,growth_previous,CPALTT01MXM657N
|
||||
Consumer Price Index for Mexico,mexico,monthly,growth_same,CPALTT01MXM659N
|
||||
Consumer Price Index for Mexico,mexico,quarterly,growth_previous,CPALTT01MXQ657N
|
||||
Consumer Price Index for Mexico,mexico,quarterly,growth_same,CPALTT01MXQ659N
|
||||
Consumer Price Index for New Zealand,new_zealand,annual,index_2015,CPALCY01NZA661N
|
||||
Consumer Price Index for New Zealand,new_zealand,quarterly,index_2015,CPALCY01NZQ661N
|
||||
Consumer Price Index for New Zealand,new_zealand,annual,growth_previous,CPALTT01NZA657N
|
||||
Consumer Price Index for New Zealand,new_zealand,annual,growth_same,CPALTT01NZA659N
|
||||
Consumer Price Index for New Zealand,new_zealand,quarterly,growth_previous,CPALTT01NZQ657N
|
||||
Consumer Price Index for New Zealand,new_zealand,quarterly,growth_same,CPALTT01NZQ659N
|
||||
Consumer Price Index for Norway,norway,annual,growth_previous,CPALTT01NOA657N
|
||||
Consumer Price Index for Norway,norway,annual,growth_same,CPALTT01NOA659N
|
||||
Consumer Price Index for Norway,norway,monthly,growth_previous,CPALTT01NOM657N
|
||||
Consumer Price Index for Norway,norway,monthly,growth_same,CPALTT01NOM659N
|
||||
Consumer Price Index for Norway,norway,quarterly,growth_previous,CPALTT01NOQ657N
|
||||
Consumer Price Index for Norway,norway,quarterly,growth_same,CPALTT01NOQ659N
|
||||
Consumer Price Index for Poland,poland,annual,growth_previous,CPALTT01PLA657N
|
||||
Consumer Price Index for Poland,poland,annual,growth_same,CPALTT01PLA659N
|
||||
Consumer Price Index for Poland,poland,monthly,growth_previous,CPALTT01PLM657N
|
||||
Consumer Price Index for Poland,poland,monthly,growth_same,CPALTT01PLM659N
|
||||
Consumer Price Index for Poland,poland,quarterly,growth_previous,CPALTT01PLQ657N
|
||||
Consumer Price Index for Poland,poland,quarterly,growth_same,CPALTT01PLQ659N
|
||||
Consumer Price Index for Portugal,portugal,annual,growth_previous,CPALTT01PTA657N
|
||||
Consumer Price Index for Portugal,portugal,annual,growth_same,CPALTT01PTA659N
|
||||
Consumer Price Index for Portugal,portugal,monthly,growth_previous,CPALTT01PTM657N
|
||||
Consumer Price Index for Portugal,portugal,monthly,growth_same,CPALTT01PTM659N
|
||||
Consumer Price Index for Portugal,portugal,quarterly,growth_previous,CPALTT01PTQ657N
|
||||
Consumer Price Index for Portugal,portugal,quarterly,growth_same,CPALTT01PTQ659N
|
||||
Consumer Price Index for Slovenia,slovenia,annual,growth_previous,CPALTT01SIA657N
|
||||
Consumer Price Index for Slovenia,slovenia,annual,growth_same,CPALTT01SIA659N
|
||||
Consumer Price Index for Slovenia,slovenia,monthly,growth_previous,CPALTT01SIM657N
|
||||
Consumer Price Index for Slovenia,slovenia,monthly,growth_same,CPALTT01SIM659N
|
||||
Consumer Price Index for Slovenia,slovenia,quarterly,growth_previous,CPALTT01SIQ657N
|
||||
Consumer Price Index for Slovenia,slovenia,quarterly,growth_same,CPALTT01SIQ659N
|
||||
Consumer Price Index for South Africa,south_africa,annual,growth_previous,CPALTT01ZAA657N
|
||||
Consumer Price Index for South Africa,south_africa,annual,growth_same,CPALTT01ZAA659N
|
||||
Consumer Price Index for South Africa,south_africa,monthly,growth_previous,CPALTT01ZAM657N
|
||||
Consumer Price Index for South Africa,south_africa,monthly,growth_same,CPALTT01ZAM659N
|
||||
Consumer Price Index for South Africa,south_africa,quarterly,growth_previous,CPALTT01ZAQ657N
|
||||
Consumer Price Index for South Africa,south_africa,quarterly,growth_same,CPALTT01ZAQ659N
|
||||
Consumer Price Index for Spain,spain,annual,growth_previous,CPALTT01ESA657N
|
||||
Consumer Price Index for Spain,spain,annual,growth_same,CPALTT01ESA659N
|
||||
Consumer Price Index for Spain,spain,monthly,growth_previous,CPALTT01ESM657N
|
||||
Consumer Price Index for Spain,spain,monthly,growth_same,CPALTT01ESM659N
|
||||
Consumer Price Index for Spain,spain,quarterly,growth_previous,CPALTT01ESQ657N
|
||||
Consumer Price Index for Spain,spain,quarterly,growth_same,CPALTT01ESQ659N
|
||||
Consumer Price Index for Sweden,sweden,annual,growth_previous,CPALTT01SEA657N
|
||||
Consumer Price Index for Sweden,sweden,annual,growth_same,CPALTT01SEA659N
|
||||
Consumer Price Index for Sweden,sweden,monthly,growth_previous,CPALTT01SEM657N
|
||||
Consumer Price Index for Sweden,sweden,monthly,growth_same,CPALTT01SEM659N
|
||||
Consumer Price Index for Sweden,sweden,quarterly,growth_previous,CPALTT01SEQ657N
|
||||
Consumer Price Index for Sweden,sweden,quarterly,growth_same,CPALTT01SEQ659N
|
||||
Consumer Price Index for Switzerland,switzerland,annual,growth_previous,CPALTT01CHA657N
|
||||
Consumer Price Index for Switzerland,switzerland,annual,growth_same,CPALTT01CHA659N
|
||||
Consumer Price Index for Switzerland,switzerland,monthly,growth_previous,CPALTT01CHM657N
|
||||
Consumer Price Index for Switzerland,switzerland,monthly,growth_same,CPALTT01CHM659N
|
||||
Consumer Price Index for Switzerland,switzerland,quarterly,growth_previous,CPALTT01CHQ657N
|
||||
Consumer Price Index for Switzerland,switzerland,quarterly,growth_same,CPALTT01CHQ659N
|
||||
Consumer Price Index for the Czech Republic,czech_republic,annual,growth_previous,CPALTT01CZA657N
|
||||
Consumer Price Index for the Czech Republic,czech_republic,annual,growth_same,CPALTT01CZA659N
|
||||
Consumer Price Index for the Czech Republic,czech_republic,monthly,growth_previous,CPALTT01CZM657N
|
||||
Consumer Price Index for the Czech Republic,czech_republic,monthly,growth_same,CPALTT01CZM659N
|
||||
Consumer Price Index for the Czech Republic,czech_republic,quarterly,growth_previous,CPALTT01CZQ657N
|
||||
Consumer Price Index for the Czech Republic,czech_republic,quarterly,growth_same,CPALTT01CZQ659N
|
||||
Consumer Price Index for the Netherlands,netherlands,annual,growth_previous,CPALTT01NLA657N
|
||||
Consumer Price Index for the Netherlands,netherlands,annual,growth_same,CPALTT01NLA659N
|
||||
Consumer Price Index for the Netherlands,netherlands,monthly,growth_previous,CPALTT01NLM657N
|
||||
Consumer Price Index for the Netherlands,netherlands,monthly,growth_same,CPALTT01NLM659N
|
||||
Consumer Price Index for the Netherlands,netherlands,quarterly,growth_previous,CPALTT01NLQ657N
|
||||
Consumer Price Index for the Netherlands,netherlands,quarterly,growth_same,CPALTT01NLQ659N
|
||||
Consumer Price Index for the Republic of Korea,korea,annual,growth_previous,CPALTT01KRA657N
|
||||
Consumer Price Index for the Republic of Korea,korea,annual,growth_same,CPALTT01KRA659N
|
||||
Consumer Price Index for the Republic of Korea,korea,monthly,growth_previous,CPALTT01KRM657N
|
||||
Consumer Price Index for the Republic of Korea,korea,monthly,growth_same,CPALTT01KRM659N
|
||||
Consumer Price Index for the Republic of Korea,korea,quarterly,growth_previous,CPALTT01KRQ657N
|
||||
Consumer Price Index for the Republic of Korea,korea,quarterly,growth_same,CPALTT01KRQ659N
|
||||
Consumer Price Index for the Russian Federation,russian_federation,monthly,growth_previous,CPALTT01RUM657N
|
||||
Consumer Price Index for the Russian Federation,russian_federation,monthly,growth_same,CPALTT01RUM659N
|
||||
Consumer Price Index for the Russian Federation,russian_federation,quarterly,growth_previous,CPALTT01RUQ657N
|
||||
Consumer Price Index for the Russian Federation,russian_federation,quarterly,growth_same,CPALTT01RUQ659N
|
||||
Consumer Price Index for the Slovak Republic,slovak_republic,annual,growth_previous,CPALTT01SKA657N
|
||||
Consumer Price Index for the Slovak Republic,slovak_republic,annual,growth_same,CPALTT01SKA659N
|
||||
Consumer Price Index for the Slovak Republic,slovak_republic,monthly,growth_previous,CPALTT01SKM657N
|
||||
Consumer Price Index for the Slovak Republic,slovak_republic,monthly,growth_same,CPALTT01SKM659N
|
||||
Consumer Price Index for the Slovak Republic,slovak_republic,quarterly,growth_previous,CPALTT01SKQ657N
|
||||
Consumer Price Index for the Slovak Republic,slovak_republic,quarterly,growth_same,CPALTT01SKQ659N
|
||||
Consumer Price Index for the United Kingdom,the united kingdom,annual,growth_previous,CPALTT01GBA657N
|
||||
Consumer Price Index for the United Kingdom,united_kingdom,annual,growth_same,CPALTT01GBA659N
|
||||
Consumer Price Index for the United Kingdom,united_kingdom,monthly,growth_previous,CPALTT01GBM657N
|
||||
Consumer Price Index for the United Kingdom,united_kingdom,monthly,growth_same,CPALTT01GBM659N
|
||||
Consumer Price Index for the United Kingdom,united_kingdom,quarterly,growth_previous,CPALTT01GBQ657N
|
||||
Consumer Price Index for the United Kingdom,united_kingdom,quarterly,growth_same,CPALTT01GBQ659N
|
||||
Consumer Price Index for the United States,united_states,annual,index_2015,CPALCY01USA661N
|
||||
Consumer Price Index for the United States,united_states,monthly,index_2015,CPALCY01USM661N
|
||||
Consumer Price Index for the United States,united_states,quarterly,index_2015,CPALCY01USQ661N
|
||||
Consumer Price Index for the United States,united_states,annual,growth_previous,CPALTT01USA657N
|
||||
Consumer Price Index for the United States,united_states,annual,growth_same,CPALTT01USA659N
|
||||
Consumer Price Index for the United States,united_states,annual,index_2015,CPALTT01USA661S
|
||||
Consumer Price Index for the United States,united_states,monthly,growth_previous,CPALTT01USM657N
|
||||
Consumer Price Index for the United States,united_states,monthly,growth_same,CPALTT01USM659N
|
||||
Consumer Price Index for the United States,united_states,monthly,index_2015,CPALTT01USM661S
|
||||
Consumer Price Index for the United States,united_states,quarterly,growth_previous,CPALTT01USQ657N
|
||||
Consumer Price Index for the United States,united_states,quarterly,growth_same,CPALTT01USQ659N
|
||||
Consumer Price Index for the United States,united_states,quarterly,index_2015,CPALTT01USQ661S
|
||||
Consumer Price Index for Turkey,turkey,annual,index_2015,CPALCY01TRA661N
|
||||
Consumer Price Index for Turkey,turkey,monthly,index_2015,CPALCY01TRM661N
|
||||
Consumer Price Index for Turkey,turkey,quarterly,index_2015,CPALCY01TRQ661N
|
||||
Consumer Price Index for Turkey,turkey,annual,growth_previous,CPALTT01TRA657N
|
||||
Consumer Price Index for Turkey,turkey,annual,growth_same,CPALTT01TRA659N
|
||||
Consumer Price Index for Turkey,turkey,monthly,growth_previous,CPALTT01TRM657N
|
||||
Consumer Price Index for Turkey,turkey,monthly,growth_same,CPALTT01TRM659N
|
||||
Consumer Price Index for Turkey,turkey,quarterly,growth_previous,CPALTT01TRQ657N
|
||||
Consumer Price Index for Turkey,turkey,quarterly,growth_same,CPALTT01TRQ659N
|
||||
|
@@ -577,52 +577,6 @@ class KeysController(BaseController): # pylint: disable=too-many-public-methods
|
||||
show_output=True,
|
||||
)
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def call_twitter(self, other_args: List[str]):
|
||||
"""Process twitter command"""
|
||||
parser = argparse.ArgumentParser(
|
||||
add_help=False,
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
prog="twitter",
|
||||
description="Set Twitter API key.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-k",
|
||||
"--key",
|
||||
type=str,
|
||||
dest="key",
|
||||
help="Key",
|
||||
required="-h" not in other_args and "--help" not in other_args,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-s",
|
||||
"--secret",
|
||||
type=str,
|
||||
dest="secret",
|
||||
help="Secret key",
|
||||
required="-h" not in other_args and "--help" not in other_args,
|
||||
)
|
||||
parser.add_argument(
|
||||
"-t",
|
||||
"--token",
|
||||
type=str,
|
||||
dest="token",
|
||||
help="Bearer token",
|
||||
required="-h" not in other_args and "--help" not in other_args,
|
||||
)
|
||||
if not other_args:
|
||||
console.print("For your API Key, visit: https://developer.twitter.com")
|
||||
return
|
||||
ns_parser = self.parse_simple_args(parser, other_args)
|
||||
if ns_parser:
|
||||
self.status_dict["twitter"] = keys_model.set_twitter_key(
|
||||
key=ns_parser.key,
|
||||
secret=ns_parser.secret,
|
||||
access_token=ns_parser.token,
|
||||
persist=True,
|
||||
show_output=True,
|
||||
)
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def call_rh(self, other_args: List[str]):
|
||||
"""Process rh command"""
|
||||
|
||||
@@ -64,7 +64,6 @@ API_DICT: Dict = {
|
||||
"cmc": "COINMARKETCAP",
|
||||
"finnhub": "FINNHUB",
|
||||
"reddit": "REDDIT",
|
||||
"twitter": "TWITTER",
|
||||
"rh": "ROBINHOOD",
|
||||
"degiro": "DEGIRO",
|
||||
"oanda": "OANDA",
|
||||
@@ -1160,100 +1159,6 @@ def check_bitquery_key(show_output: bool = False) -> str:
|
||||
return str(status)
|
||||
|
||||
|
||||
def set_twitter_key(
|
||||
key: str,
|
||||
secret: str,
|
||||
access_token: str,
|
||||
persist: bool = False,
|
||||
show_output: bool = False,
|
||||
) -> str:
|
||||
"""Set Twitter key
|
||||
|
||||
Parameters
|
||||
----------
|
||||
key: str
|
||||
API key
|
||||
secret: str
|
||||
API secret
|
||||
access_token: str
|
||||
API token
|
||||
persist: bool, optional
|
||||
If False, api key change will be contained to where it was changed. For example, a Jupyter notebook session.
|
||||
If True, api key change will be global, i.e. it will affect terminal environment variables.
|
||||
By default, False.
|
||||
show_output: bool, optional
|
||||
Display status string or not. By default, False.
|
||||
|
||||
Returns
|
||||
-------
|
||||
str
|
||||
Status of key set
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> from openbb_terminal.sdk import openbb
|
||||
>>> openbb.keys.twitter(
|
||||
key="example_key",
|
||||
secret="example_secret",
|
||||
access_token="example_access_token"
|
||||
)
|
||||
"""
|
||||
handle_credential("API_TWITTER_KEY", key, persist)
|
||||
handle_credential("API_TWITTER_SECRET_KEY", secret, persist)
|
||||
handle_credential("API_TWITTER_BEARER_TOKEN", access_token, persist)
|
||||
|
||||
return check_twitter_key(show_output)
|
||||
|
||||
|
||||
def check_twitter_key(show_output: bool = False) -> str:
|
||||
"""Check Twitter key
|
||||
|
||||
Parameters
|
||||
----------
|
||||
show_output: bool, optional
|
||||
Display status string or not. By default, False.
|
||||
|
||||
Returns
|
||||
-------
|
||||
str
|
||||
Status of key set
|
||||
"""
|
||||
|
||||
if show_output:
|
||||
console.print("Checking status...")
|
||||
|
||||
current_user = get_current_user()
|
||||
if current_user.credentials.API_TWITTER_BEARER_TOKEN == "REPLACE_ME":
|
||||
status = KeyStatus.NOT_DEFINED
|
||||
else:
|
||||
params = {
|
||||
"query": "(\\$AAPL) (lang:en)",
|
||||
"max_results": "10",
|
||||
"tweet.fields": "created_at,lang",
|
||||
}
|
||||
r = request(
|
||||
"https://api.twitter.com/2/tweets/search/recent",
|
||||
params=params, # type: ignore
|
||||
headers={
|
||||
"authorization": "Bearer "
|
||||
+ current_user.credentials.API_TWITTER_BEARER_TOKEN
|
||||
},
|
||||
)
|
||||
if r.status_code == 200:
|
||||
status = KeyStatus.DEFINED_TEST_PASSED
|
||||
elif r.status_code in [401, 403]:
|
||||
logger.warning("Twitter key defined, test failed")
|
||||
status = KeyStatus.DEFINED_TEST_FAILED
|
||||
else:
|
||||
logger.warning("Twitter key defined, test failed")
|
||||
status = KeyStatus.DEFINED_TEST_INCONCLUSIVE
|
||||
|
||||
if show_output:
|
||||
console.print(status.colorize())
|
||||
|
||||
return str(status)
|
||||
|
||||
|
||||
def set_rh_key(
|
||||
username: str,
|
||||
password: str,
|
||||
|
||||
@@ -2,29 +2,21 @@ stocks
|
||||
ba
|
||||
load ${ticker=aapl}
|
||||
headlines
|
||||
headlines --raw
|
||||
wsb
|
||||
wsb --new
|
||||
watchlist
|
||||
popular -l 5 -n 10
|
||||
spacc
|
||||
spac
|
||||
popular
|
||||
getdd
|
||||
redditsent
|
||||
trending
|
||||
stalker -l 3
|
||||
stalker
|
||||
bullbear
|
||||
messages
|
||||
infer
|
||||
sentiment -d 3 -l 2
|
||||
mentions
|
||||
regions
|
||||
interest -w yolo
|
||||
queries
|
||||
rise
|
||||
jcdr
|
||||
jctr
|
||||
snews
|
||||
ns
|
||||
help
|
||||
reset
|
||||
exit
|
||||
|
||||
@@ -65,24 +65,6 @@
|
||||
"link": "https://polygon.io",
|
||||
"markdown": "Go to: https://polygon.io\n\n\n\nClick on, \"Get your Free API Key\".\n\n\n\nAfter signing up, the API Key is found at the bottom of the account dashboard page.\n\n"
|
||||
},
|
||||
{
|
||||
"name": "API_TWITTER_KEY",
|
||||
"source": "Twitter key",
|
||||
"link": "https://developer.twitter.com",
|
||||
"markdown": ""
|
||||
},
|
||||
{
|
||||
"name": "API_TWITTER_SECRET_KEY",
|
||||
"source": "Twitter secret",
|
||||
"link": "https://developer.twitter.com",
|
||||
"markdown": ""
|
||||
},
|
||||
{
|
||||
"name": "API_TWITTER_BEARER_TOKEN",
|
||||
"source": "Twitter token",
|
||||
"link": "https://developer.twitter.com",
|
||||
"markdown": ""
|
||||
},
|
||||
{
|
||||
"name": "API_FRED_KEY",
|
||||
"source": "FRED",
|
||||
|
||||
@@ -32,8 +32,5 @@
|
||||
"API_REDDIT_USERNAME": "",
|
||||
"API_REDDIT_USER_AGENT": "",
|
||||
"API_REDDIT_PASSWORD": "",
|
||||
"API_TWITTER_KEY": "",
|
||||
"API_TWITTER_SECRET_KEY": "",
|
||||
"API_TWITTER_BEARER_TOKEN": "",
|
||||
"API_DAPPRADAR_KEY": ""
|
||||
}
|
||||
|
||||
@@ -438,7 +438,6 @@ class OpenBBSDK:
|
||||
`stocksera`: Set Stocksera key.\n
|
||||
`tokenterminal`: Set Token Terminal key.\n
|
||||
`tradier`: Set Tradier key\n
|
||||
`twitter`: Set Twitter key\n
|
||||
`ultima`: Set Ultima Insights key\n
|
||||
`walert`: Set Walert key\n
|
||||
"""
|
||||
|
||||
@@ -13,7 +13,6 @@ from openbb_terminal.common.behavioural_analysis import (
|
||||
google_view,
|
||||
reddit_view,
|
||||
stocktwits_view,
|
||||
twitter_view,
|
||||
)
|
||||
from openbb_terminal.core.session.current_user import get_current_user
|
||||
from openbb_terminal.custom_prompt_toolkit import NestedCompleter
|
||||
@@ -21,7 +20,6 @@ from openbb_terminal.decorators import log_start_end
|
||||
from openbb_terminal.helper_funcs import (
|
||||
EXPORT_BOTH_RAW_DATA_AND_FIGURES,
|
||||
EXPORT_ONLY_RAW_DATA_ALLOWED,
|
||||
check_int_range,
|
||||
check_non_negative,
|
||||
check_positive,
|
||||
valid_date,
|
||||
@@ -53,8 +51,6 @@ class BehaviouralAnalysisController(StockBaseController):
|
||||
"messages",
|
||||
"trending",
|
||||
"stalker",
|
||||
"infer",
|
||||
"sentiment",
|
||||
"mentions",
|
||||
"regions",
|
||||
"queries",
|
||||
@@ -102,8 +98,6 @@ class BehaviouralAnalysisController(StockBaseController):
|
||||
mt.add_cmd("stalker")
|
||||
mt.add_cmd("bullbear", self.ticker)
|
||||
mt.add_cmd("messages", self.ticker)
|
||||
mt.add_cmd("infer", self.ticker)
|
||||
mt.add_cmd("sentiment", self.ticker)
|
||||
mt.add_cmd("mentions", self.ticker)
|
||||
mt.add_cmd("regions", self.ticker)
|
||||
mt.add_cmd("interest", self.ticker)
|
||||
@@ -673,106 +667,6 @@ class BehaviouralAnalysisController(StockBaseController):
|
||||
else:
|
||||
console.print("No ticker loaded. Please load using 'load <ticker>'\n")
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def call_infer(self, other_args: List[str]):
|
||||
"""Process infer command."""
|
||||
parser = argparse.ArgumentParser(
|
||||
add_help=False,
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
prog="infer",
|
||||
description="""
|
||||
Print quick sentiment inference from last tweets that contain the ticker.
|
||||
This model splits the text into character-level tokens and uses vader sentiment analysis.
|
||||
[Source: Twitter]
|
||||
""",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-l",
|
||||
"--limit",
|
||||
action="store",
|
||||
dest="limit",
|
||||
type=check_int_range(10, 100),
|
||||
default=100,
|
||||
help="limit of latest tweets to infer from.",
|
||||
)
|
||||
if other_args and "-" not in other_args[0][0]:
|
||||
other_args.insert(0, "-l")
|
||||
ns_parser = self.parse_known_args_and_warn(
|
||||
parser, other_args, EXPORT_ONLY_RAW_DATA_ALLOWED
|
||||
)
|
||||
if ns_parser:
|
||||
if self.ticker:
|
||||
twitter_view.display_inference(
|
||||
symbol=self.ticker,
|
||||
limit=ns_parser.limit,
|
||||
export=ns_parser.export,
|
||||
sheet_name=" ".join(ns_parser.sheet_name)
|
||||
if ns_parser.sheet_name
|
||||
else None,
|
||||
)
|
||||
else:
|
||||
console.print("No ticker loaded. Please load using 'load <ticker>'\n")
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def call_sentiment(self, other_args: List[str]):
|
||||
"""Process sentiment command."""
|
||||
parser = argparse.ArgumentParser(
|
||||
add_help=False,
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
prog="sentiment",
|
||||
description="""
|
||||
Plot in-depth sentiment predicted from tweets from last days
|
||||
that contain pre-defined ticker. [Source: Twitter]
|
||||
""",
|
||||
)
|
||||
# in reality this argument could be 100, but after testing it takes too long
|
||||
# to compute which may not be acceptable
|
||||
# TODO: use https://github.com/twintproject/twint instead of twitter API
|
||||
parser.add_argument(
|
||||
"-l",
|
||||
"--limit",
|
||||
action="store",
|
||||
dest="limit",
|
||||
type=check_int_range(10, 62),
|
||||
default=15,
|
||||
help="limit of tweets to extract per hour.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-d",
|
||||
"--days",
|
||||
action="store",
|
||||
dest="n_days_past",
|
||||
type=check_int_range(1, 6),
|
||||
default=6,
|
||||
help="number of days in the past to extract tweets.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-c",
|
||||
"--compare",
|
||||
action="store_true",
|
||||
dest="compare",
|
||||
help="show corresponding change in stock price",
|
||||
)
|
||||
if other_args and "-" not in other_args[0][0]:
|
||||
other_args.insert(0, "-l")
|
||||
ns_parser = self.parse_known_args_and_warn(
|
||||
parser, other_args, EXPORT_BOTH_RAW_DATA_AND_FIGURES
|
||||
)
|
||||
if ns_parser:
|
||||
if self.ticker:
|
||||
twitter_view.display_sentiment(
|
||||
symbol=self.ticker,
|
||||
n_tweets=ns_parser.limit,
|
||||
n_days_past=ns_parser.n_days_past,
|
||||
compare=ns_parser.compare,
|
||||
export=ns_parser.export,
|
||||
sheet_name=" ".join(ns_parser.sheet_name)
|
||||
if ns_parser.sheet_name
|
||||
else None,
|
||||
)
|
||||
else:
|
||||
console.print("No ticker loaded. Please load using 'load <ticker>'\n")
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def call_headlines(self, other_args: List[str]):
|
||||
"""Process finbrain command."""
|
||||
|
||||
@@ -325,8 +325,9 @@ class FundamentalAnalysisController(StockBaseController):
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||
prog="score",
|
||||
description="""
|
||||
Value investing tool based on Warren Buffett, Joseph Piotroski
|
||||
and Benjamin Graham thoughts [Source: FMP]
|
||||
Value investing based on Warren Buffett, Joseph Piotroski and Benjamin Graham thoughts [Source: FMP].
|
||||
Data is gathered from fmp and the scores are calculated using the valinvest library. The repository
|
||||
For this library can be found here: https://github.com/astro30/valinvest
|
||||
""",
|
||||
)
|
||||
parser.add_argument(
|
||||
|
||||
@@ -29,7 +29,10 @@ logger = logging.getLogger(__name__)
|
||||
def valinvest_score(
|
||||
symbol: str, years: int, export: str = "", sheet_name: Optional[str] = None
|
||||
):
|
||||
"""Value investing tool based on Warren Buffett, Joseph Piotroski and Benjamin Graham thoughts [Source: FMP]
|
||||
"""
|
||||
Value investing tool based on Warren Buffett, Joseph Piotroski and Benjamin Graham thoughts [Source: FMP]
|
||||
The data is gathered from fmp and the scores are calculated using the valinvest library. The repository
|
||||
For this library can be found here: https://github.com/astro30/valinvest
|
||||
|
||||
Parameters
|
||||
----------
|
||||
|
||||
@@ -791,8 +791,11 @@ def terminal(jobs_cmds: Optional[List[str]] = None, test_mode=False):
|
||||
|
||||
export_path = ""
|
||||
if jobs_cmds and "export" in jobs_cmds[0]:
|
||||
export_path = jobs_cmds[0].split("/")[0].split(" ")[1]
|
||||
jobs_cmds = ["/".join(jobs_cmds[0].split("/")[1:])]
|
||||
commands = jobs_cmds[0].split("/")
|
||||
first_split = commands[0].split(" ")
|
||||
if len(first_split) > 1:
|
||||
export_path = first_split[1]
|
||||
jobs_cmds = ["/".join(commands[1:])]
|
||||
|
||||
ret_code = 1
|
||||
t_controller = TerminalController(jobs_cmds)
|
||||
|
||||
@@ -271,41 +271,6 @@ def test_call_func_expect_queue(expected_queue, func, queue):
|
||||
[],
|
||||
dict(),
|
||||
),
|
||||
(
|
||||
"call_tokens",
|
||||
[],
|
||||
"graph_view.display_uni_tokens",
|
||||
[],
|
||||
dict(),
|
||||
),
|
||||
(
|
||||
"call_stats",
|
||||
[],
|
||||
"graph_view.display_uni_stats",
|
||||
[],
|
||||
dict(),
|
||||
),
|
||||
(
|
||||
"call_pairs",
|
||||
[],
|
||||
"graph_view.display_recently_added",
|
||||
[],
|
||||
dict(),
|
||||
),
|
||||
(
|
||||
"call_pools",
|
||||
[],
|
||||
"graph_view.display_uni_pools",
|
||||
[],
|
||||
dict(),
|
||||
),
|
||||
(
|
||||
"call_swaps",
|
||||
[],
|
||||
"graph_view.display_last_uni_swaps",
|
||||
[],
|
||||
dict(),
|
||||
),
|
||||
(
|
||||
"call_vaults",
|
||||
[],
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
# IMPORTATION STANDARD
|
||||
|
||||
# IMPORTATION THIRDPARTY
|
||||
import pandas as pd
|
||||
import pytest
|
||||
|
||||
# IMPORTATION INTERNAL
|
||||
from openbb_terminal.cryptocurrency.defi import graph_model
|
||||
|
||||
|
||||
@pytest.mark.vcr(record_mode="none")
|
||||
def test_query_graph_status_400(mocker):
|
||||
# MOCK GET
|
||||
attrs = {
|
||||
"status_code": 400,
|
||||
}
|
||||
mock_response = mocker.Mock(**attrs)
|
||||
mocker.patch(target="requests.post", new=mocker.Mock(return_value=mock_response))
|
||||
|
||||
graph_model.query_graph(url="http://MOCK_URL", query="MOCK_QUERY")
|
||||
|
||||
|
||||
@pytest.mark.vcr
|
||||
@pytest.mark.parametrize(
|
||||
"func, kwargs",
|
||||
[
|
||||
("get_uni_tokens", dict(skip=0, limit=5)),
|
||||
("get_uniswap_stats", dict()),
|
||||
("get_uni_pools_by_volume", dict()),
|
||||
("get_last_uni_swaps", dict(limit=5)),
|
||||
],
|
||||
)
|
||||
def test_call_func(func, kwargs):
|
||||
df = getattr(graph_model, func)(**kwargs)
|
||||
|
||||
assert isinstance(df, pd.DataFrame)
|
||||
assert not df.empty
|
||||
|
||||
|
||||
@pytest.mark.vcr(filter_post_data_parameters=[("query", "MOCK_QUERY")])
|
||||
def test_get_uniswap_pool_recently_added():
|
||||
df = graph_model.get_uniswap_pool_recently_added(
|
||||
last_days=14, min_volume=100, min_liquidity=0, min_tx=100
|
||||
)
|
||||
|
||||
assert isinstance(df, pd.DataFrame)
|
||||
assert not df.empty
|
||||
|
||||
|
||||
@pytest.mark.vcr(record_mode="none")
|
||||
@pytest.mark.parametrize(
|
||||
"func, kwargs",
|
||||
[
|
||||
("get_uni_tokens", dict(skip=0, limit=5)),
|
||||
("get_uniswap_stats", dict()),
|
||||
(
|
||||
"get_uniswap_pool_recently_added",
|
||||
dict(last_days=14, min_volume=100, min_liquidity=0, min_tx=100),
|
||||
),
|
||||
("get_uni_pools_by_volume", dict()),
|
||||
("get_last_uni_swaps", dict(limit=5)),
|
||||
],
|
||||
)
|
||||
def test_call_func_empty_df(func, kwargs, mocker):
|
||||
# MOCK QUERY_GRAPH
|
||||
mocker.patch(
|
||||
target="openbb_terminal.cryptocurrency.defi.graph_model.query_graph",
|
||||
return_value={},
|
||||
)
|
||||
|
||||
df = getattr(graph_model, func)(**kwargs)
|
||||
|
||||
assert isinstance(df, pd.DataFrame)
|
||||
assert df.empty
|
||||
@@ -1,38 +0,0 @@
|
||||
# IMPORTATION STANDARD
|
||||
|
||||
# IMPORTATION THIRDPARTY
|
||||
import pytest
|
||||
|
||||
# IMPORTATION INTERNAL
|
||||
from openbb_terminal.cryptocurrency.defi import graph_view
|
||||
|
||||
|
||||
@pytest.mark.vcr
|
||||
@pytest.mark.parametrize(
|
||||
"func, kwargs",
|
||||
[
|
||||
("display_uni_tokens", dict(skip=0, limit=5)),
|
||||
("display_uni_stats", dict()),
|
||||
("display_uni_pools", dict()),
|
||||
("display_last_uni_swaps", dict(limit=5)),
|
||||
],
|
||||
)
|
||||
def test_call_func(func, kwargs, mocker):
|
||||
# MOCK EXPORT_DATA
|
||||
mocker.patch(target="openbb_terminal.cryptocurrency.defi.graph_view.export_data")
|
||||
|
||||
getattr(graph_view, func)(**kwargs)
|
||||
|
||||
|
||||
@pytest.mark.vcr(filter_post_data_parameters=[("query", "MOCK_QUERY")])
|
||||
def test_display_recently_added(mocker):
|
||||
# MOCK EXPORT_DATA
|
||||
mocker.patch(target="openbb_terminal.cryptocurrency.defi.graph_view.export_data")
|
||||
|
||||
graph_view.display_recently_added(
|
||||
limit=10,
|
||||
days=7,
|
||||
min_volume=20,
|
||||
min_liquidity=0,
|
||||
min_tx=100,
|
||||
)
|
||||
@@ -1,10 +1,5 @@
|
||||
newsletter recent DeFi related newsletters [Substack]
|
||||
vaults top DeFi Vaults on different blockchains [Coindix]
|
||||
tokens tokens trade-able on Uniswap [TheGraph]
|
||||
stats base statistics about Uniswap [TheGraph]
|
||||
pairs recently added pairs on Uniswap [TheGraph]
|
||||
pools pools by volume on Uniswap [TheGraph]
|
||||
swaps recent swaps done on Uniswap [TheGraph]
|
||||
ldapps lists dApps [DeFiLlama]
|
||||
gdapps top DeFi dApps grouped by chain [DeFiLlama]
|
||||
stvl historical values of the total sum of TVLs from all dApps [DeFiLlama]
|
||||
|
||||
@@ -297,27 +297,6 @@ def test_call_func_expect_queue(expected_queue, queue, func):
|
||||
limit=5,
|
||||
),
|
||||
),
|
||||
(
|
||||
"call_infer",
|
||||
["--limit=20", "--export=csv"],
|
||||
"twitter_view.display_inference",
|
||||
[],
|
||||
dict(symbol="MOCK_TICKER", limit=20, export="csv", sheet_name=None),
|
||||
),
|
||||
(
|
||||
"call_sentiment",
|
||||
["--limit=20", "--days=2", "--compare", "--export=csv"],
|
||||
"twitter_view.display_sentiment",
|
||||
[],
|
||||
dict(
|
||||
symbol="MOCK_TICKER",
|
||||
n_tweets=20,
|
||||
n_days_past=2,
|
||||
compare=True,
|
||||
export="csv",
|
||||
sheet_name=None,
|
||||
),
|
||||
),
|
||||
(
|
||||
"call_mentions",
|
||||
["--start=2020-12-01", "--export=csv"],
|
||||
@@ -422,8 +401,6 @@ def test_call_func(
|
||||
"call_messages",
|
||||
"call_trending",
|
||||
"call_stalker",
|
||||
"call_infer",
|
||||
"call_sentiment",
|
||||
"call_mentions",
|
||||
"call_regions",
|
||||
"call_queries",
|
||||
@@ -456,8 +433,6 @@ def test_call_func_no_parser(func, mocker):
|
||||
"func",
|
||||
[
|
||||
"call_headlines",
|
||||
"call_sentiment",
|
||||
"call_infer",
|
||||
"call_rise",
|
||||
"call_queries",
|
||||
"call_regions",
|
||||
|
||||
@@ -12,8 +12,6 @@ Ticker: TSLA
|
||||
stalker stalk stocktwits user's last messages [Stocktwits]
|
||||
bullbear estimate quick sentiment from last 30 messages on board [Stocktwits]
|
||||
messages output up to the 30 last messages on the board [Stocktwits]
|
||||
infer infer about stock's sentiment from latest tweets [Twitter]
|
||||
sentiment in-depth sentiment prediction from tweets over time [Twitter]
|
||||
mentions interest over time based on stock's mentions [Google]
|
||||
regions regions that show highest interest in stock [Google]
|
||||
interest interest over time of sentences versus stock price [Google]
|
||||
|
||||
@@ -148,12 +148,6 @@ def test_call_reddit(other):
|
||||
controller.call_reddit(other)
|
||||
|
||||
|
||||
@pytest.mark.vcr
|
||||
@pytest.mark.parametrize("other", [[], ["-k", "1234", "-s", "4567", "-t", "890"]])
|
||||
def test_call_twitter(other):
|
||||
controller.call_twitter(other)
|
||||
|
||||
|
||||
@pytest.mark.vcr
|
||||
@pytest.mark.parametrize("other", [[], ["-u", "1234", "-p", "4567"]])
|
||||
def test_call_rh(other):
|
||||
|
||||
@@ -367,34 +367,6 @@ def test_set_bitquery_key(args: List[str], persist: bool, show_output: bool, moc
|
||||
mock_check.assert_called_once_with(show_output)
|
||||
|
||||
|
||||
@pytest.mark.vcr
|
||||
@pytest.mark.parametrize(
|
||||
"args, persist, show_output",
|
||||
[
|
||||
(
|
||||
["test_key", "test_secret", "test_access_token"],
|
||||
False,
|
||||
True,
|
||||
),
|
||||
(
|
||||
["test_key", "test_secret", "test_access_token"],
|
||||
False,
|
||||
False,
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_set_twitter_key(args: List[str], persist: bool, show_output: bool, mocker):
|
||||
mock_check = mocker.patch("openbb_terminal.keys_model.check_twitter_key")
|
||||
keys_model.set_twitter_key(
|
||||
key=args[0],
|
||||
secret=args[1],
|
||||
access_token=args[2],
|
||||
persist=persist,
|
||||
show_output=show_output,
|
||||
)
|
||||
mock_check.assert_called_once_with(show_output)
|
||||
|
||||
|
||||
@pytest.mark.vcr
|
||||
@pytest.mark.parametrize(
|
||||
"args, persist, show_output",
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
---
|
||||
title: pairs
|
||||
description: OpenBB SDK Function
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
# pairs
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="model" label="Model" default>
|
||||
|
||||
Get lastly added trade-able pairs on Uniswap with parameters like:
|
||||
|
||||
Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_model.py#L164)]
|
||||
|
||||
```python
|
||||
openbb.crypto.defi.pairs(last_days: int = 14, min_volume: int = 100, min_liquidity: int = 0, min_tx: int = 100)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
| Name | Type | Description | Default | Optional |
|
||||
| ---- | ---- | ----------- | ------- | -------- |
|
||||
| last_days | int | How many days back to look for added pairs. | 14 | True |
|
||||
| min_volume | int | Minimum volume | 100 | True |
|
||||
| min_liquidity | int | Minimum liquidity | 0 | True |
|
||||
| min_tx | int | Minimum number of transactions done in given pool. | 100 | True |
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Returns
|
||||
|
||||
| Type | Description |
|
||||
| ---- | ----------- |
|
||||
| pd.DataFrame | Lastly added pairs on Uniswap DEX. |
|
||||
---
|
||||
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="view" label="Chart">
|
||||
|
||||
Prints table showing Lastly added pairs on Uniswap DEX.
|
||||
|
||||
Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_view.py#L102)]
|
||||
|
||||
```python
|
||||
openbb.crypto.defi.pairs_chart(limit: int = 20, days: int = 7, min_volume: int = 20, min_liquidity: int = 0, min_tx: int = 100, sortby: str = "created", ascend: bool = False, export: str = "")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
| Name | Type | Description | Default | Optional |
|
||||
| ---- | ---- | ----------- | ------- | -------- |
|
||||
| limit | int | Number of records to display | 20 | True |
|
||||
| days | int | Number of days the pair has been active, | 7 | True |
|
||||
| min_volume | int | Minimum trading volume, | 20 | True |
|
||||
| min_liquidity | int | Minimum liquidity | 0 | True |
|
||||
| min_tx | int | Minimum number of transactions | 100 | True |
|
||||
| sortby | str | Key by which to sort data | created | True |
|
||||
| ascend | bool | Flag to sort data descending | False | True |
|
||||
| export | str | Export dataframe data to csv,json,xlsx file | | True |
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Returns
|
||||
|
||||
This function does not return anything
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
@@ -1,73 +0,0 @@
|
||||
---
|
||||
title: pools
|
||||
description: OpenBB SDK Function
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
# pools
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="model" label="Model" default>
|
||||
|
||||
Get uniswap pools by volume. [Source: https://thegraph.com/en/]
|
||||
|
||||
Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_model.py#L253)]
|
||||
|
||||
```python
|
||||
openbb.crypto.defi.pools()
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
This function does not take any parameters.
|
||||
|
||||
---
|
||||
|
||||
## Returns
|
||||
|
||||
| Type | Description |
|
||||
| ---- | ----------- |
|
||||
| pd.DataFrame | Trade-able pairs listed on Uniswap by top volume. |
|
||||
---
|
||||
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="view" label="Chart">
|
||||
|
||||
Prints table showing uniswap pools by volume.
|
||||
|
||||
Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_view.py#L170)]
|
||||
|
||||
```python
|
||||
openbb.crypto.defi.pools_chart(limit: int = 20, sortby: str = "volumeUSD", ascend: bool = True, export: str = "")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
| Name | Type | Description | Default | Optional |
|
||||
| ---- | ---- | ----------- | ------- | -------- |
|
||||
| limit | int | Number of records to display | 20 | True |
|
||||
| sortby | str | Key by which to sort data. The table can be sorted by every of its columns<br/>(see https://bit.ly/3ORagr1 then press ctrl-enter or execute the query). | volumeUSD | True |
|
||||
| ascend | bool | Flag to sort data descending | True | True |
|
||||
| export | str | Export dataframe data to csv,json,xlsx file | | True |
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Returns
|
||||
|
||||
This function does not return anything
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
@@ -1,70 +0,0 @@
|
||||
---
|
||||
title: stats
|
||||
description: OpenBB SDK Function
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
# stats
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="model" label="Model" default>
|
||||
|
||||
Get base statistics about Uniswap DEX. [Source: https://thegraph.com/en/]
|
||||
|
||||
Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_model.py#L124)]
|
||||
|
||||
```python
|
||||
openbb.crypto.defi.stats()
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
This function does not take any parameters.
|
||||
|
||||
---
|
||||
|
||||
## Returns
|
||||
|
||||
| Type | Description |
|
||||
| ---- | ----------- |
|
||||
| pd.DataFrame | Uniswap DEX statistics like liquidity, volume, number of pairs, number of transactions. |
|
||||
---
|
||||
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="view" label="Chart">
|
||||
|
||||
Prints table showing base statistics about Uniswap DEX. [Source: https://thegraph.com/en/]
|
||||
|
||||
Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_view.py#L72)]
|
||||
|
||||
```python
|
||||
openbb.crypto.defi.stats_chart(export: str = "")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
| Name | Type | Description | Default | Optional |
|
||||
| ---- | ---- | ----------- | ------- | -------- |
|
||||
| export | str | Export dataframe data to csv,json,xlsx file | | True |
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Returns
|
||||
|
||||
This function does not return anything
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
@@ -1,78 +0,0 @@
|
||||
---
|
||||
title: swaps
|
||||
description: OpenBB SDK Function
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
# swaps
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="model" label="Model" default>
|
||||
|
||||
Get the last 100 swaps done on Uniswap [Source: https://thegraph.com/en/]
|
||||
|
||||
Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_model.py#L296)]
|
||||
|
||||
```python
|
||||
openbb.crypto.defi.swaps(limit: int = 100, sortby: str = "timestamp", ascend: bool = False)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
| Name | Type | Description | Default | Optional |
|
||||
| ---- | ---- | ----------- | ------- | -------- |
|
||||
| limit | int | Number of swaps to return. Maximum possible number: 1000. | 100 | True |
|
||||
| sortby | str | Key by which to sort data. The table can be sorted by every of its columns<br/>(see https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2). | timestamp | True |
|
||||
| ascend | bool | Flag to sort data descending | False | True |
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Returns
|
||||
|
||||
| Type | Description |
|
||||
| ---- | ----------- |
|
||||
| pd.DataFrame | Last 100 swaps on Uniswap |
|
||||
---
|
||||
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="view" label="Chart">
|
||||
|
||||
Prints table showing last swaps done on Uniswap
|
||||
|
||||
Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_view.py#L218)]
|
||||
|
||||
```python
|
||||
openbb.crypto.defi.swaps_chart(limit: int = 10, sortby: str = "timestamp", ascend: bool = False, export: str = "")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
| Name | Type | Description | Default | Optional |
|
||||
| ---- | ---- | ----------- | ------- | -------- |
|
||||
| limit | int | Number of records to display | 10 | True |
|
||||
| sortby | str | Key by which to sort data. The table can be sorted by every of its columns<br/>(see https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2). | timestamp | True |
|
||||
| ascend | bool | Flag to sort data descending | False | True |
|
||||
| export | str | Export dataframe data to csv,json,xlsx file | | True |
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Returns
|
||||
|
||||
This function does not return anything
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
@@ -1,80 +0,0 @@
|
||||
---
|
||||
title: tokens
|
||||
description: OpenBB SDK Function
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
# tokens
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="model" label="Model" default>
|
||||
|
||||
Get list of tokens trade-able on Uniswap DEX. [Source: https://thegraph.com/en/]
|
||||
|
||||
Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_model.py#L81)]
|
||||
|
||||
```python
|
||||
openbb.crypto.defi.tokens(skip: int = 0, limit: int = 100, sortby: str = "index", ascend: bool = False)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
| Name | Type | Description | Default | Optional |
|
||||
| ---- | ---- | ----------- | ------- | -------- |
|
||||
| skip | int | Skip n number of records. | 0 | True |
|
||||
| limit | int | Show n number of records. | 100 | True |
|
||||
| sortby | str | The column to sort by | index | True |
|
||||
| ascend | bool | Whether to sort in ascending order | False | True |
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Returns
|
||||
|
||||
| Type | Description |
|
||||
| ---- | ----------- |
|
||||
| pd.DataFrame | Uniswap tokens with trading volume, transaction count, liquidity. |
|
||||
---
|
||||
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="view" label="Chart">
|
||||
|
||||
Prints table showing tokens trade-able on Uniswap DEX.
|
||||
|
||||
Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/cryptocurrency/defi/graph_view.py#L18)]
|
||||
|
||||
```python
|
||||
openbb.crypto.defi.tokens_chart(skip: int = 0, limit: int = 20, sortby: str = "index", ascend: bool = False, export: str = "")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Parameters
|
||||
|
||||
| Name | Type | Description | Default | Optional |
|
||||
| ---- | ---- | ----------- | ------- | -------- |
|
||||
| skip | int | Number of records to skip | 0 | True |
|
||||
| limit | int | Number of records to display | 20 | True |
|
||||
| sortby | str | Key by which to sort data | index | True |
|
||||
| ascend | bool | Flag to sort data descending | False | True |
|
||||
| export | str | Export dataframe data to csv,json,xlsx file | | True |
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Returns
|
||||
|
||||
This function does not return anything
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Setting API Keys
|
||||
sidebar_position: 1
|
||||
description: API (Application Programming Interface) keys are access credentials for accessing data from a particular source. Learn how to set, manage, and access data APIs for the OpenBB Terminal.
|
||||
keywords: [api, keys, api keys, openbb terminal, data provider, data, free, alpha vantage, fred, iex, twitter, degiro, binance, coinglass, polygon, intrinio, sdk, alphavantage, bitquery, coinbase, databento, finnhub, FRED, github, glassnode, iex cloud, news API, robinhood, santiment, shroomdk, token terminal, tradier, twitter, whale alert]
|
||||
keywords: [api, keys, api keys, openbb terminal, data provider, data, free, alpha vantage, fred, iex, degiro, binance, coinglass, polygon, intrinio, sdk, alphavantage, bitquery, coinbase, databento, finnhub, FRED, github, glassnode, iex cloud, news API, robinhood, santiment, shroomdk, token terminal, tradier, whale alert]
|
||||
---
|
||||
|
||||
import HeadTitle from '@site/src/components/General/HeadTitle.tsx';
|
||||
|
||||
Reference in New Issue
Block a user