Skip to content

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
man-c committed Apr 23, 2021
2 parents bf02690 + 654ac59 commit c9982d6
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 42 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@

2.0.0 / 2021-04-23
==================

* Allow Python Lists and Booleans for any endpoint parameter (list converted to comma-separated string & bool converted to lower case string)
* Removed /indexes/{id} endpoint (Get market index by id) -> cg.get_indexes_by_id()
* Improved request exceptions handling (Fixed unbound local exception on GET request failure)

1.4.1 / 2021-03-30
==================

Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ cg = CoinGeckoAPI()
```

### Examples
The required parameters for each endpoint are defined as required (mandatory) parameters for the corresponding functions.
**Any optional parameters** can be also passed using same names, as defined in CoinGecko API doc (https://www.coingecko.com/api/docs/v3)
The required parameters for each endpoint are defined as required (mandatory) parameters for the corresponding functions.\
**Any optional parameters** can be passed using same names, as defined in CoinGecko API doc (https://www.coingecko.com/api/docs/v3)

*Lists are also supported as input for multiple-valued comma-separated parameters (e.g. see /simple/price usage examples).*
For any parameter:
- ***Lists** are supported as input for multiple-valued comma-separated parameters\
(e.g. see /simple/price usage examples).*
- ***Booleans** are supported as input for boolean type parameters; they can be `str` ('true', 'false'') or `bool` (`True`, `False`)\
(e.g. see /simple/price usage examples).*

Usage examples:
```python
Expand All @@ -47,6 +51,9 @@ Usage examples:
# optional parameters can be passed as defined in the API doc (https://www.coingecko.com/api/docs/v3)
>>> cg.get_price(ids='bitcoin', vs_currencies='usd', include_market_cap='true', include_24hr_vol='true', include_24hr_change='true', include_last_updated_at='true')
{'bitcoin': {'usd': 3458.74, 'usd_market_cap': 60574330199.29028, 'usd_24h_vol': 4182664683.6247883, 'usd_24h_change': 1.2295378479069035, 'last_updated_at': 1549071865}}
# OR (also booleans can be used for boolean type arguments)
>>> cg.get_price(ids='bitcoin', vs_currencies='usd', include_market_cap=True, include_24hr_vol=True, include_24hr_change=True, include_last_updated_at=True)
{'bitcoin': {'usd': 3458.74, 'usd_market_cap': 60574330199.29028, 'usd_24h_vol': 4182664683.6247883, 'usd_24h_change': 1.2295378479069035, 'last_updated_at': 1549071865}}
```

### API documentation
Expand Down Expand Up @@ -161,10 +168,6 @@ https://www.coingecko.com/api/docs/v3
```python
cg.get_indexes()
```
- **/indexes/{id}** (Get market index by id)
```python
cg.get_indexes_by_id()
```
- **/indexes/list** (List market indexes id and name)
```python
cg.get_indexes_list()
Expand Down
Loading

0 comments on commit c9982d6

Please sign in to comment.