-
Notifications
You must be signed in to change notification settings - Fork 134
2 modifies I want to make, Nils' advise? #180
Comments
|
|
@ajeep8 I'm also coding something based on bitex, I save APIs in a json config file and read it like this: Here how my settings json looks like:
Then I read it like this:
In reality I loop the file and check the "type" (in my case type is the exchange name) and use it to create the correct api object based on it... If you need an example on how to cache stuff in a json and read from the json if the json is not older than X seconds, minutes or so, have a look at my coinmarketcap-helper: https://github.com/firepol/coinmarketcap-helper/blob/master/src/coinmarketcap_helper.py Was this what you were looking for? Hope it helped ;) |
Ah, now I got ya. I'm not a fan of the json format - however, you could merge the ini files into a single one, with sections for each API. Like so:
Of course that would require some updates to the config parser methods. |
Nils,
I want to save all pairs in one json file with timestamp, and config it's path in the config file. User can refresh pairs json file periodically, but in _get_supported_pairs only fetch from json file.
Your advise?
The text was updated successfully, but these errors were encountered: