I am trying to get a JSON formatted tree of the market groups like in the market browser, eve marketer, etc.
So far I am able to pull the invMarketGroups.csv file from fuzzwork, but I am struggling to build a tree with just parent nodes. Does anyone have some code I could look at for this? I’m working in Python but can read other stuff pretty easily.
Thanks in advance.
The parent nodes are ones that have a
Correct, I have that. I am just struggling to build the entire tree in a reasonable amount of time.
Some thoughts I have had include:
Using the initial parent nodes with parentGroupID None to build a dict like:
then I step through the remaining groups to assign them to one of the parent keys of the group dict.
However, I would then have to repeat this and index into each child of the parent node, which seems very time consuming.
It wouldn’t be terrible to dynamically build this out. I.e. Fuzzwork Market Data Browser only does an initial request to its API to get the root groups, then each click on a group fetches the groups a part of the root group. The responses are cached so multiple clicks on the same group do not result in multiple requests.
Seems kinda wasteful to do this every time. At the least you could just do it once and cache it somewhere so it doesn’t matter too much if it’s not super pretty.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.