-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathp04.py
More file actions
27 lines (21 loc) · 754 Bytes
/
p04.py
File metadata and controls
27 lines (21 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import pandas as pd
import os
import time
from datetime import datetime
# path = "X:/Backups/intraQuarter" # for Windows with X files :)
# if git clone'ed then use relative path,
# assuming you extracted the downloaded zip into this project's folder:
path = "intraQuarter"
def Key_Stats(gather="Total Debt/Equity (mrq)"):
statspath = path+'/_KeyStats'
stock_list = [x[0] for x in os.walk(statspath)]
# print(stock_list)
for each_dir in stock_list[1:]:
each_file = os.listdir(each_dir)
if len(each_file) > 0:
for file in each_file:
date_stamp = datetime.strptime(file, '%Y%m%d%H%M%S.html')
unix_time = time.mktime(date_stamp.timetuple())
print(date_stamp, unix_time)
#time.sleep(15)
Key_Stats()