Skip to content

Commit

Permalink
Merge branch 'release/2.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
man-c committed Jun 17, 2021
2 parents 07484c5 + debbb5d commit 6f6d0ba
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

2.2.0 / 2021-06-17
==================

* Added /indexes/{market_id}/{id} and /companies/public_treasury/{coin_id} endpoints

2.1.0 / 2021-06-03
==================

Expand Down
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ https://www.coingecko.com/api/docs/v3
```python
cg.get_coins_categories()
```
- *exchanges (beta)*
- *exchanges*
- **/exchanges** (List all exchanges)
```python
cg.get_exchanges_list()
Expand All @@ -169,7 +169,7 @@ https://www.coingecko.com/api/docs/v3
```python
cg.get_exchanges_volume_chart_by_id()
```
- *finance (beta)*
- *finance*
- **/finance_platforms** (List all finance platforms)
```python
cg.get_finance_platforms()
Expand All @@ -178,16 +178,20 @@ https://www.coingecko.com/api/docs/v3
```python
cg.get_finance_products()
```
- *indexes (beta)*
- *indexes*
- **/indexes** (List all market indexes)
```python
cg.get_indexes()
```
- **/indexes/{market_id}/{id}** (Get market index by market id and index id)
```python
cg.get_indexes_by_market_id_and_index_id()
```
- **/indexes/list** (List market indexes id and name)
```python
cg.get_indexes_list()
```
- *derivatives (beta)*
- *derivatives*
- **/derivatives** (List all derivative tickers)
```python
cg.get_derivatives()
Expand All @@ -204,7 +208,7 @@ https://www.coingecko.com/api/docs/v3
```python
cg.get_derivatives_exchanges_list()
```
- status_updates (beta)
- *status_updates*
- **/status_updates** (List all status_updates with data (description, category, created_at, user, user_title and pin))
```python
cg.get_status_updates()
Expand Down Expand Up @@ -241,6 +245,11 @@ https://www.coingecko.com/api/docs/v3
```python
cg.get_global_decentralized_finance_defi()
```
- *companies (beta)*
- **/companies/public_treasury/{coin_id}** (Get public companies data)
```python
cg.get_companies_public_treasury_by_coin_id()
```

### Test

Expand Down
30 changes: 24 additions & 6 deletions pycoingecko/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def get_coin_status_updates_by_id(self, id, **kwargs):
api_url = self.__api_url_params(api_url, kwargs)

return self.__request(api_url)

@func_args_preprocessing
def get_coin_ohlc_by_id(self, id, vs_currency, days, **kwargs):
"""Get coin's OHLC"""
Expand Down Expand Up @@ -344,15 +344,24 @@ def get_indexes(self, **kwargs):

return self.__request(api_url)

#@func_args_preprocessing
#def get_indexes_by_id(self, id, **kwargs):
# @func_args_preprocessing
# def get_indexes_by_id(self, id, **kwargs):
# """Get market index by id"""

#
# api_url = '{0}indexes/{1}'.format(self.api_base_url, id)
# api_url = self.__api_url_params(api_url, kwargs)

#
# return self.__request(api_url)

@func_args_preprocessing
def get_indexes_by_market_id_and_index_id(self, market_id, id, **kwargs):
"""Get market index by market id and index id"""

api_url = '{0}indexes/{1}/{2}'.format(self.api_base_url, market_id, id)
api_url = self.__api_url_params(api_url, kwargs)

return self.__request(api_url)

@func_args_preprocessing
def get_indexes_list(self, **kwargs):
"""List market indexes id and name"""
Expand Down Expand Up @@ -446,7 +455,7 @@ def get_exchange_rates(self, **kwargs):
api_url = self.__api_url_params(api_url, kwargs)

return self.__request(api_url)

# ---------- TRENDING ----------#
@func_args_preprocessing
def get_search_trending(self, **kwargs):
Expand Down Expand Up @@ -476,3 +485,12 @@ def get_global_decentralized_finance_defi(self, **kwargs):

return self.__request(api_url)['data']

# ---------- COMPANIES ----------#
@func_args_preprocessing
def get_companies_public_treasury_by_coin_id(self, coin_id, **kwargs):
"""Get public companies data"""

api_url = '{0}companies/public_treasury/{1}'.format(self.api_base_url, coin_id)
api_url = self.__api_url_params(api_url, kwargs)

return self.__request(api_url)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setuptools.setup(
name='pycoingecko',
version='2.1.0',
version='2.2.0',
packages=['pycoingecko',],
license='MIT',
description = 'Python wrapper around the CoinGecko API',
Expand Down

0 comments on commit 6f6d0ba

Please sign in to comment.