Crypto backtesting
Loading...
Searching...
No Matches
bin
coins.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
3
# Get all currency pairs
4
5
import
json
6
import
requests
7
from
collections
import
deque
8
9
f = open(
"exchanges.txt"
)
10
exchange_names = deque(f.read().split())
11
12
try
:
13
url =
"https://min-api.cryptocompare.com/data/all/exchanges"
14
15
r = requests.get(url)
16
exchanges = r.json()
17
18
for
exchange
in
exchanges:
19
if
exchange
in
exchange_names:
20
for
from_symbol
in
exchanges[exchange]:
21
for
to_symbol
in
exchanges[exchange][from_symbol]:
22
print(from_symbol,
"\t"
, to_symbol,
"\t"
, exchange)
23
24
except
Exception
as
e:
25
print(
"#"
, from_symbol,
"generated exception: "
+ str(e))
Generated by
1.15.0