Skip to content

Commit

Permalink
[Python] Fix client
Browse files Browse the repository at this point in the history
  • Loading branch information
Herklos committed Mar 26, 2024
1 parent 6ffefa9 commit adee965
Show file tree
Hide file tree
Showing 19 changed files with 56 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Coingecko API - Publish
name: Coingecko API - Publish npm

on:
push:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/pip-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Coingecko API - Publish python

on:
push:
branches:
- master

jobs:
publish-pip:
uses: Drakkar-Software/.github/.github/workflows/python3_sdist_workflow.yml@master
secrets:
PYPI_OFFICIAL_UPLOAD_URL: ${{ secrets.PYPI_OFFICIAL_UPLOAD_URL }}
PYPI_USERNAME: __token__
PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,5 @@ docker run --rm -v ./:/local swaggerapi/swagger-codegen-cli generate \
--additional-properties=projectName=coingecko-openapi-client \
--additional-properties=packageUrl=https://github.com/Drakkar-Software/coingecko-openapi-clients
```

Then patch the generated client with by replacing all `response_type=None` by `response_type='str'`
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def asset_platforms_get_with_http_info(self, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down
4 changes: 2 additions & 2 deletions client/python/coingecko_openapi_client/api/categories_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def coins_categories_get_with_http_info(self, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -203,7 +203,7 @@ def coins_categories_list_get_with_http_info(self, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down
14 changes: 7 additions & 7 deletions client/python/coingecko_openapi_client/api/coins_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def coins_id_get_with_http_info(self, id, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -251,7 +251,7 @@ def coins_id_history_get_with_http_info(self, id, _date, **kwargs): # noqa: E50
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -370,7 +370,7 @@ def coins_id_market_chart_get_with_http_info(self, id, vs_currency, days, **kwar
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -493,7 +493,7 @@ def coins_id_market_chart_range_get_with_http_info(self, id, vs_currency, _from,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -723,7 +723,7 @@ def coins_id_tickers_get_with_http_info(self, id, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -814,7 +814,7 @@ def coins_list_get_with_http_info(self, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -945,7 +945,7 @@ def coins_markets_get_with_http_info(self, vs_currency, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def companies_public_treasury_coin_id_get_with_http_info(self, coin_id, **kwargs
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down
6 changes: 3 additions & 3 deletions client/python/coingecko_openapi_client/api/contract_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def coins_id_contract_contract_address_get_with_http_info(self, id, contract_add
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -251,7 +251,7 @@ def coins_id_contract_contract_address_market_chart_get_with_http_info(self, id,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -382,7 +382,7 @@ def coins_id_contract_contract_address_market_chart_range_get_with_http_info(sel
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down
8 changes: 4 additions & 4 deletions client/python/coingecko_openapi_client/api/derivatives_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def derivatives_exchanges_get_with_http_info(self, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -223,7 +223,7 @@ def derivatives_exchanges_id_get_with_http_info(self, id, **kwargs): # noqa: E5
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -310,7 +310,7 @@ def derivatives_exchanges_list_get_with_http_info(self, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -397,7 +397,7 @@ def derivatives_get_with_http_info(self, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def exchange_rates_get_with_http_info(self, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down
10 changes: 5 additions & 5 deletions client/python/coingecko_openapi_client/api/exchanges_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def exchanges_get_with_http_info(self, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -215,7 +215,7 @@ def exchanges_id_get_with_http_info(self, id, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -330,7 +330,7 @@ def exchanges_id_tickers_get_with_http_info(self, id, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -433,7 +433,7 @@ def exchanges_id_volume_chart_get_with_http_info(self, id, days, **kwargs): # n
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -520,7 +520,7 @@ def exchanges_list_get_with_http_info(self, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down
4 changes: 2 additions & 2 deletions client/python/coingecko_openapi_client/api/global_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def global_decentralized_finance_defi_get_with_http_info(self, **kwargs): # noq
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -199,7 +199,7 @@ def global_get_with_http_info(self, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down
6 changes: 3 additions & 3 deletions client/python/coingecko_openapi_client/api/nfts__beta_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def nfts_asset_platform_id_contract_contract_address_get_with_http_info(self, as
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -223,7 +223,7 @@ def nfts_id_get_with_http_info(self, id, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -326,7 +326,7 @@ def nfts_list_get_with_http_info(self, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down
2 changes: 1 addition & 1 deletion client/python/coingecko_openapi_client/api/ping_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def ping_get_with_http_info(self, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down
2 changes: 1 addition & 1 deletion client/python/coingecko_openapi_client/api/search_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def search_get_with_http_info(self, query, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down
6 changes: 3 additions & 3 deletions client/python/coingecko_openapi_client/api/simple_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def simple_price_get_with_http_info(self, ids, vs_currencies, **kwargs): # noqa
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -235,7 +235,7 @@ def simple_supported_vs_currencies_get_with_http_info(self, **kwargs): # noqa:
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down Expand Up @@ -366,7 +366,7 @@ def simple_token_price_id_get_with_http_info(self, id, contract_addresses, vs_cu
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down
2 changes: 1 addition & 1 deletion client/python/coingecko_openapi_client/api/trending_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def search_trending_get_with_http_info(self, **kwargs): # noqa: E501
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
Expand Down
4 changes: 2 additions & 2 deletions client/python/coingecko_openapi_client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def set_default_header(self, header_name, header_value):
async def __call_api(
self, resource_path, method, path_params=None,
query_params=None, header_params=None, body=None, post_params=None,
files=None, response_type=None, auth_settings=None,
files=None, response_type='str', auth_settings=None,
_return_http_data_only=None, collection_formats=None,
_preload_content=True, _request_timeout=None):

Expand Down Expand Up @@ -283,7 +283,7 @@ def __deserialize(self, data, klass):
def call_api(self, resource_path, method,
path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None,
response_type=None, auth_settings=None, async_req=None,
response_type='str', auth_settings=None, async_req=None,
_return_http_data_only=None, collection_formats=None,
_preload_content=True, _request_timeout=None):
"""Makes the HTTP request (synchronous) and returns deserialized data.
Expand Down
5 changes: 2 additions & 3 deletions examples/python/coins-list.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
async def fetchCoinsList():
api_client = coingecko_openapi_client.ApiClient()
client = coingecko_openapi_client.api.coins_api.CoinsApi(api_client)
categoryCoinsList = await client.coins_markets_get(vs_currency='usd', category='layer-1', per_page=10)
print(categoryCoinsList)
return await client.coins_markets_get(vs_currency='usd', category='layer-1', per_page=10)

loop = asyncio.get_event_loop()
loop.run_until_complete(fetchCoinsList())
print(loop.run_until_complete(fetchCoinsList()))

0 comments on commit adee965

Please sign in to comment.