This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client.get_symbol_info('BNBBTC') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tickers = pd.DataFrame(client.get_all_tickers()) | |
tickers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Check if client is working | |
client.get_system_status() | |
#get server time (does not need to match your timezone) | |
server_time = client.get_server_time() pd.to_datetime(server_time['serverTime'], unit = "ms") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#client = Client(api_key, api_secret) #only needed for buying and selling crypto assets | |
client = Client() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from binance.client import Client | |
import plotly.graph_objects as go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install python-binance |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chart_config = ( | |
chart | |
.configure_title( | |
fontSize = 40, | |
font = "Staatliches", | |
align = "center", | |
color = "black", | |
baseline = "bottom", | |
dy = 40 | |
).configure_view( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chart = ( | |
alt.Chart(pd.concat([df_ll, df_rl, df_ll_weeks])) | |
.mark_square( | |
color = "black", | |
size = 100 / 2 | |
).encode( | |
x = alt.X("week", axis = None), | |
y = alt.Y("year", axis = None), | |
#color = alt.Color("label", legend = alt.Legend(orient = "bottom"), title = ""), | |
#shape=alt.ShapeValue(person) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df_ll_weeks = pd.DataFrame(columns = ['week', 'year', 'label']) | |
for week in range (lived_life_weeks_floor): | |
df_ll_weeks = df_ll_weeks.append(pd.DataFrame({ | |
'week':[week], | |
'year':[lived_life_years_floor], | |
'label':[c_label_lived] | |
})) | |
df_ll_weeks = df_ll_weeks.append(pd.DataFrame({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lived_life = current_date - day_of_birth | |
rest_of_life = day_of_death - current_date | |
lived_life_years = (lived_life.days / 365.25) | |
lived_life_years_floor = math.floor(lived_life_years) | |
lived_life_weeks = (lived_life_years - lived_life_years_floor) * 365.25 / 7 | |
lived_life_weeks_floor = math.floor(lived_life_weeks) | |
rest_of_life_years = (rest_of_life.days / 365.25) |