-
Notifications
You must be signed in to change notification settings - Fork 0
/
edinet_query_all.py
30 lines (24 loc) · 1 KB
/
edinet_query_all.py
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
26
27
28
29
30
if __name__ == "__main__":
import pandas as pd
import sys
import os
import subprocess
if len(sys.argv) != 4:
print("Usage: python3 edinet_query_all.py ${filename} yyyy-mm-dd yyyy-mm-dd\n ${start} ${end}")
filename = sys.argv[1]
start = sys.argv[2]
end = sys.argv[3]
df = pd.read_csv(filename, skiprows=1, index_col='EDINETコード')
df = df[df['上場区分'] == '上場']
edinet.edinet_key = getpass.getpass()
for i in df.index:
print('{0}'.format(df['提出者名'][i]))
with open('{0}.csv'.format(df['提出者名'][i]), 'w') as redirect_file:
subprocess.run(args=['python3',
'edinet_tools.py',
'--target={0}'.format(i),
'--start={0}'.format(start),
'--end={0}'.format(end)],
stdout=redirect_file)
subprocess.run(args=['python3', 'analyse.py', '{0}.csv'.format(df['提出者名'][i])])
print('-----------------------')