-
Notifications
You must be signed in to change notification settings - Fork 0
/
req.py
179 lines (140 loc) · 4.43 KB
/
req.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
import requests
import secret
"""status requests functions"""
def market_bourse():
"""get bourse market state"""
patameters = {
'token': secret.bors_api_key,
"market": "market_bourse"
}
data = requests.get(secret.bors_api_url, params=patameters).json()
return data
def market_farabourse():
"""get bourse market state"""
patameters = {
'token': secret.bors_api_key,
"market": "market_farabourse"
}
data = requests.get(secret.bors_api_url, params=patameters).json()
return data
def fav_namad_bourse():
""""get most view namad in bourse market"""
patameters = {
'token': secret.bors_api_key,
"market": "fav_namad_bourse"
}
data = requests.get(secret.bors_api_url, params=patameters).json()
return data
def fav_namad_farabourse():
""""get most view namad in farabourse market"""
patameters = {
'token': secret.bors_api_key,
"market": "fav_namad_farabourse"
}
data = requests.get(secret.bors_api_url, params=patameters).json()
return data
def ind_namad_bourse():
"""get most impact on the index in bourse market"""
patameters = {
'token': secret.bors_api_key,
"market": "ind_namad_bourse"
}
data = requests.get(secret.bors_api_url, params=patameters).json()
return data
def ind_namad_farabourse():
"""get most impact on the index in farabourse market"""
patameters = {
'token': secret.bors_api_key,
"market": "ind_namad_farabourse"
}
data = requests.get(secret.bors_api_url, params=patameters).json()
return data
def market_indices():
"""get indices market data"""
patameters = {
'token': secret.bors_api_key,
"market": "indices"
}
data = requests.get(secret.bors_api_url, params=patameters).json()
return data
"""show single namad requests functions"""
def namad_search(search):
"""search in all namad"""
patameters = {
'token': secret.bors_api_key,
"search": search
}
data = requests.get(secret.bors_api_url, params=patameters).json()
return data
def single_namad_data(namad):
"""get single namad data"""
patameters = {
'token': secret.bors_api_key,
"name": namad
}
data = requests.get(secret.bors_api_url, params=patameters).json()
return data
def namad_stockholder(namad):
"""get namad stockholder data"""
patameters = {
'token': secret.bors_api_key,
"stockholder": namad
}
data = requests.get(secret.bors_api_url, params=patameters).json()
return data
def namad_stats(namad):
"""get namad state data"""
patameters = {
'token': secret.bors_api_key,
"stats": namad
}
data = requests.get(secret.bors_api_url, params=patameters).json()
return data
def namad_codal(namad):
"""fet namad codal alert data"""
patameters = {
'token': secret.bors_api_key,
"codal": namad,
"p": 1
}
data = requests.get(secret.bors_api_url, params=patameters).json()
return data
def co_real_power(namad):
"""get company or real person buy or sell power data"""
patameters = {
'token': secret.bors_api_key,
"power": namad,
"days": 30
}
data = requests.get(secret.bors_api_url, params=patameters).json()
return data
def namad_nday_history(namad, day):
"""get price history in n days"""
patameters = {
'token': secret.bors_api_key,
"name": namad,
"days": day
}
data = requests.get(secret.bors_api_url, params=patameters).json()
return data
"""watch req functions"""
def search_code(codes):
"""search a namad with instance code"""
data = requests.get(secret.bors_api_url + "?token=" + secret.bors_api_key + "&all&type=0").json()
out_list = []
for i in data:
if i["instance_code"] in codes:
out_list.append([f'{i["full_name"]} ({i["name"]})', i["instance_code"]])
return out_list
def search_code_name(codes):
"""search a namad with instance code"""
data = requests.get(secret.bors_api_url + "?token=" + secret.bors_api_key + "&all&type=0").json()
out_list = []
for i in data:
if i["instance_code"] in codes:
out_list.append(i["name"])
return out_list
def all_namad_data():
"""get all namad data"""
data = requests.get(secret.bors_api_url + "?token=" + secret.bors_api_key + "&all&type=0").json()
return data