python-dependency-injector/examples/miniapps/api_client/api.py

16 lines
414 B
Python
Raw Normal View History

"""API client module."""
2016-04-20 14:19:54 +03:00
class ApiClient:
2016-04-20 14:19:54 +03:00
"""Some API client."""
def __init__(self, host, api_key):
"""Initialize instance."""
2016-04-20 14:19:54 +03:00
self.host = host
self.api_key = api_key
def call(self, operation, data):
"""Make some network operations."""
2016-11-02 19:22:17 +03:00
print('API call [{0}:{1}], method - {2}, data - {3}'.format(
self.host, self.api_key, operation, repr(data)))