Skip to content

Commit

Permalink
Added data folder to path for file export
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaeye committed Dec 31, 2020
1 parent 744bfcc commit 8bc4152
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion boomkat.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,6 @@ def get_page(year):
print("Error getting chart item")

filename = "boomkat_" + user_year + ".csv"
df.to_csv(filename, index=False, encoding='utf-8-sig')
if not os.path.exists('data'):
os.makedirs('data')
df.to_csv("data/" + filename, index=False, encoding='utf-8-sig')
4 changes: 3 additions & 1 deletion pitchfork.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,6 @@ def get_page(year):
df = df.sort_values('rank', ascending=True)

filename = "pitchfork_" + user_year + ".csv"
df.to_csv(filename, index=False, encoding='utf-8-sig')
if not os.path.exists('data'):
os.makedirs('data')
df.to_csv("data/" + filename, index=False, encoding='utf-8-sig')
2 changes: 1 addition & 1 deletion spotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ def get_input():

df['html'] = pd.Series(html)

df.to_csv(site + "_" + year + "_html.csv", index=False)
df.to_csv("data/" + site + "_" + year + "_html.csv", index=False)

0 comments on commit 8bc4152

Please sign in to comment.