-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Messari crypto dd commands #1711
Conversation
@@ -37,3 +37,12 @@ Coinbase | |||
stats show coin stats | |||
Messari | |||
mcapdom show market cap dominance | |||
mt show messari timeseries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for the "show" on the description in all of these
Excellent work 🚀 ✨ This totally revamped the DD menu |
Already said it, but I'm going to say it again, you're killing this @jose-donato - basically adding half of what we are having to the dd menu 🚀 From my interviews with users, they absolutely need these commands. Instead of having to navigate through multiple sites, now they can find it all in the terminal. |
parser.add_argument( | ||
"-q", | ||
"--query", | ||
type=str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -136,6 +139,8 @@ def __init__( | |||
choices["twitter"]["-s"] = { | |||
c: None for c in coinpaprika_view.TWEETS_FILTERS | |||
} | |||
choices["mt"] = {c: None for c in self.messari_timeseries} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ax.plot(df.index, df["values"]) | ||
|
||
ax.set_title(f"{coin}'s {title}") | ||
ax.set_ylabel(y_axis) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -214,15 +218,18 @@ def get_close_price(asset: str, interval: str, since: int, until: int) -> pd.Dat | |||
df = pd.DataFrame(json.loads(r.text)) | |||
|
|||
if df.empty: | |||
console.print(f"No data found for {asset} price.\n") | |||
if print_errors: | |||
console.print(f"No data found for {asset} price.\n") | |||
else: | |||
df = df.set_index("t") | |||
df.index = pd.to_datetime(df.index, unit="s") | |||
|
|||
elif r.status_code == 401: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the Premium API Feat, instead of invalid API key.
We have the template on API error handling here - you might need to update depending on their status code
if response.status_code == 200:
d_data = response.json()
if "economicCalendar" in d_data:
df = pd.DataFrame(d_data["economicCalendar"])
else:
console.print("No latest economy calendar events found\n")
elif response.status_code == 401:
console.print("[red]Invalid API Key[/red]\n")
elif response.status_code == 403:
console.print("[red]API Key not authorized for Premium Feature[/red]\n")
else:
console.print(f"Error in request: {response.json()['error']}", "\n")
return df
action="store_true", | ||
help="Flag to show chart with coin price and roadmap dates", | ||
dest="chart", | ||
default=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default should be True, so they can see your awesome chart ;)
|
||
if not df.empty: | ||
df["Date"] = df["Date"].dt.date | ||
print_rich_table( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very small but this will add to user experience. It'd be nice to have this sort by date (descending) so we show the latest roadmap first, and have a limit flag. We could show top 5 as default, as otherwise it'd be rather long.
external_axes : Optional[List[plt.Axes]], optional | ||
External axes (1 axis is expected in the list), by default None | ||
""" | ||
df, circ_df = get_tokenomics(coin, coingecko_symbol, circ_supply_src) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got this error msg if it's from cg
|
||
@log_start_end(log=logger) | ||
@check_api_key(["API_MESSARI_KEY"]) | ||
def display_fundraising( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jose-donato Looks like the tests fail was related to file naming : case sensitivity |
Description
WIP
How has this been tested?
Checklist:
Others
pre-commit install
.pytest tests/...
.