-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgenerate_skills.py
More file actions
38 lines (23 loc) · 887 Bytes
/
generate_skills.py
File metadata and controls
38 lines (23 loc) · 887 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
26
27
28
29
30
31
32
33
34
35
36
import json
import sys
import requests
skill_category = 16
esi_base = "https://esi.tech.ccp.is/latest/universe/"
esi_trail = "/?datasource=tranquility"
category_endpoint = esi_base + "categories/" + str(skill_category) + esi_trail
skills_map = {}
#iterate groups where category_id=16
for skillid in requests.get(category_endpoint).json()["groups"]:
group_endpoint = esi_base + "groups/" + str(skillid) + esi_trail
groups = requests.get(group_endpoint).json()
print(groups["name"])
print("=================================")
for typeid in groups["types"]:
type_endpoint = esi_base + "types/" +str(typeid) + esi_trail
types = requests.get(type_endpoint).json()
skills_map[int(typeid)] = types["name"]
#print(str(typeid) +"="+types["name"])
with open('skills_map.json', 'w') as fp:
json.dump(skills_map, fp)
#for x,y in skills_map:
# print(str(x) + ":" + y)