Skip to content

Instantly share code, notes, and snippets.

client.get_symbol_info('BNBBTC')
tickers = pd.DataFrame(client.get_all_tickers())
tickers
#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")
#client = Client(api_key, api_secret) #only needed for buying and selling crypto assets
client = Client()
import pandas as pd 
from binance.client import Client
import plotly.graph_objects as go
pip install python-binance
chart_config = (
chart
.configure_title(
fontSize = 40,
font = "Staatliches",
align = "center",
color = "black",
baseline = "bottom",
dy = 40
).configure_view(
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)
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({
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)