Skip to content

Commit f04e185

Browse files
committed
Rename QencodeApiClient to Client. Make available via qencode.Client
Class instances should start with capital letters and always the pure object being classified if possible (for code completion, api interlinking, type annotations, etc)
1 parent 5067065 commit f04e185

12 files changed

+14
-20
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ poetry install
3333
```python
3434
import qencode
3535

36-
client = qencode.client(API_KEY)
36+
client = qencode.Client(api_key=API_KEY)
3737
client.create()
3838

3939
task = client.create_task()

docs/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ poetry install
2727
```python
2828
import qencode
2929

30-
client = qencode.client(API_KEY)
30+
client = qencode.Client(api_key=API_KEY)
3131
client.create()
3232

3333
task = client.create_task()

docs/usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ VIDEO_URL = 'your source url'
1515

1616

1717
def start_encode():
18-
client = qencode.client(API_KEY)
18+
client = qencode.Client(api_key=API_KEY)
1919
client.create()
2020
if client.error:
2121
print 'encoder error:', client.error, client.message
@@ -102,7 +102,7 @@ def start_encode():
102102
:param api_version: int. not required. default 'v1'
103103
:return: client object
104104
"""
105-
client = qencode.client(API_KEY)
105+
client = qencode.Client(api_key=API_KEY)
106106
client.create()
107107
if client.error:
108108
print('encoder error:', client.error, client.message)

qencode/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from .client import Client
12
from .custom_params import (
23
CustomTranscodingParams,
34
Destination,
@@ -8,13 +9,6 @@
89
)
910
from .exceptions import QencodeClientException, QencodeTaskException
1011

11-
12-
def client(api_key, api_url=None, version=None, **kwargs):
13-
from client import QencodeApiClient
14-
15-
return QencodeApiClient(api_key, api_url=api_url, version=version, **kwargs)
16-
17-
1812
__version__ = "0.9.29"
1913
__status__ = "Beta"
2014
__author__ = "Qencode"

qencode/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from task import Task
44

55

6-
class QencodeApiClient(object):
6+
class Client(object):
77
def __init__(self, api_key, api_url=None, version=None):
88
self.api_key = api_key
99
self.api_url = api_url if api_url else 'https://api.qencode.com/'

sample-code/start_custom_hls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def start_encode():
5252
:return: task object
5353
"""
5454

55-
client = qencode.client(API_KEY)
55+
client = qencode.Client(api_key=API_KEY)
5656
if client.error:
5757
raise QencodeClientException(client.message)
5858

sample-code/start_custom_mp4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def start_encode():
4646
:return: task object
4747
"""
4848

49-
client = qencode.client(API_KEY)
49+
client = qencode.Client(api_key=API_KEY)
5050
if client.error:
5151
raise QencodeClientException(client.message)
5252

sample-code/start_custom_with_dict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def start_encode():
4040
:return: task object
4141
"""
4242

43-
client = qencode.client(API_KEY)
43+
client = qencode.Client(api_key=API_KEY)
4444
if client.error:
4545
raise QencodeClientException(client.message)
4646

sample-code/start_custom_with_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ def start_encode():
4242
:param api_url: string. not required
4343
:param api_version: int. not required. default 'v1'
4444
:return: task object
45-
"""
45+
"""
4646

47-
client = qencode.client(API_KEY)
47+
client = qencode.Client(api_key=API_KEY)
4848
if client.error:
4949
raise QencodeClientException(client.message)
5050

sample-code/start_custom_with_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def start_encode():
4040
:return: task object
4141
"""
4242

43-
client = qencode.client(API_KEY)
43+
client = qencode.Client(api_key=API_KEY)
4444
if client.error:
4545
raise QencodeClientException(client.message)
4646

sample-code/start_encode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def start_encode():
3636
:return: task object
3737
"""
3838

39-
client = qencode.client(API_KEY)
39+
client = qencode.Client(api_key=API_KEY)
4040
if client.error:
4141
raise QencodeClientException(client.message)
4242

sample-code/start_with_callback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def start_encode():
4343
:return: task object
4444
"""
4545

46-
client = qencode.client(API_KEY)
46+
client = qencode.Client(api_key=API_KEY)
4747
if client.error:
4848
raise QencodeClientException(client.message)
4949

0 commit comments

Comments
 (0)