mirror of
https://github.com/webclinic017/drift.git
synced 2026-07-27 18:57:55 +00:00
chore(Linter): reformatted code with black (#211)
* chore(Linter): reformatted code with black * Create black.yaml
This commit is contained in:
committed by
GitHub
parent
f3fee4a4e1
commit
8dd2d88740
+34
-31
@@ -3,60 +3,63 @@ import pandas as pd
|
||||
from tqdm import tqdm
|
||||
from utils.glassnode import GlassnodeClient, Indicators, Mining
|
||||
|
||||
path = 'data/daily_glassnode/'
|
||||
client = GlassnodeClient(asset='BTC', since='2014-01-01', until='2021-12-17')
|
||||
path = "data/daily_glassnode/"
|
||||
client = GlassnodeClient(asset="BTC", since="2014-01-01", until="2021-12-17")
|
||||
print("Client initiated")
|
||||
indicator_client = Indicators(client)
|
||||
|
||||
indicator_names = ['rhodl_ratio',
|
||||
'cvdd',
|
||||
'difficulty_ribbon_compression',
|
||||
'nvt_ratio',
|
||||
'nvt_signal',
|
||||
'velocity',
|
||||
'supply_adjusted_cdd',
|
||||
'binary_cdd',
|
||||
'supply_adjusted_dormancy',
|
||||
'puell_multiple',
|
||||
'asopr',
|
||||
'reserve_risk',
|
||||
'sopr',
|
||||
'cdd',
|
||||
'asol',
|
||||
'msol',
|
||||
'dormancy',
|
||||
'liveliness',
|
||||
'relative_unrealized_profit',
|
||||
'relative_unrealized_loss',
|
||||
'nupl',
|
||||
indicator_names = [
|
||||
"rhodl_ratio",
|
||||
"cvdd",
|
||||
"difficulty_ribbon_compression",
|
||||
"nvt_ratio",
|
||||
"nvt_signal",
|
||||
"velocity",
|
||||
"supply_adjusted_cdd",
|
||||
"binary_cdd",
|
||||
"supply_adjusted_dormancy",
|
||||
"puell_multiple",
|
||||
"asopr",
|
||||
"reserve_risk",
|
||||
"sopr",
|
||||
"cdd",
|
||||
"asol",
|
||||
"msol",
|
||||
"dormancy",
|
||||
"liveliness",
|
||||
"relative_unrealized_profit",
|
||||
"relative_unrealized_loss",
|
||||
"nupl",
|
||||
# 'sth_nupl',
|
||||
# 'lth_nupl',
|
||||
'ssr',
|
||||
'bvin',
|
||||
"ssr",
|
||||
"bvin",
|
||||
]
|
||||
|
||||
|
||||
def process_df(df: pd.DataFrame) -> pd.DataFrame:
|
||||
df.index.rename('time', inplace=True)
|
||||
df.index.rename("time", inplace=True)
|
||||
if len(df.columns) != 1:
|
||||
df = df[['v']]
|
||||
df.rename(columns={df.columns[0]: 'close'}, inplace=True)
|
||||
df = df[["v"]]
|
||||
df.rename(columns={df.columns[0]: "close"}, inplace=True)
|
||||
df.sort_index(inplace=True)
|
||||
return df
|
||||
|
||||
|
||||
for name in tqdm(indicator_names):
|
||||
method_to_call = getattr(indicator_client, name)
|
||||
df = method_to_call()
|
||||
df = process_df(df)
|
||||
df.to_csv(path + name + '.csv')
|
||||
df.to_csv(path + name + ".csv")
|
||||
|
||||
|
||||
# Mining data
|
||||
|
||||
mining_names = ['hash_rate']
|
||||
mining_names = ["hash_rate"]
|
||||
mining_client = Mining(client)
|
||||
|
||||
for name in tqdm(mining_names):
|
||||
method_to_call = getattr(mining_client, name)
|
||||
df = method_to_call()
|
||||
df = process_df(df)
|
||||
df.to_csv(path + name + '.csv')
|
||||
df.to_csv(path + name + ".csv")
|
||||
|
||||
Reference in New Issue
Block a user