barnumbirr / coinmarketcap

A python wrapper around the https://coinmarketcap.com API.
Apache License 2.0
436 stars 109 forks source link

Allow looking up prices by symbol #34

Closed jathpala closed 6 years ago

jathpala commented 6 years ago

See #33

The ticker method now accepts a 'symbol' paramater. If a currency id is not specified but symbol is, then the appropriate currency id is automatically chosen for the request to the coinmarketcap api.

The mappings of currency symbols to currency ids are stored in a 'symbol.json' data file. This is generated using the 'get_symbols.py' script. The data file is static for a given release of the library. Users are not expected to update the data file.

To keep the library up to date with new currencies, the 'get_symbols' script should be run from time to time and the update 'symbols.json' file should be moved into the data folder and a new release pushed.