alfred-python 0.6.1__py3-none-any.whl → 0.6.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
alfred/base/constants.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from enum import Enum
2
2
 
3
- from alfred.http.typed import ResponseType
3
+ from alfred.base.typed import ResponseType
4
4
 
5
5
  # Response type/header mapping
6
6
  RESPONSE_TYPE_HEADER_MAPPING = {
alfred/base/typed.py ADDED
@@ -0,0 +1,4 @@
1
+ class ResponseType:
2
+ JSON = "json"
3
+ TEXT = "text"
4
+ XML = "xml"
@@ -17,6 +17,7 @@ from urllib3.util.retry import Retry
17
17
 
18
18
  # Project imports
19
19
  from .typed import * # pylint: disable=W0401, W0614
20
+ from ..base.typed import ResponseType
20
21
  from ..base.constants import RESPONSE_TYPE_HEADER_MAPPING
21
22
  from ..base.exceptions import AlfredMissingAuthException
22
23
  from ..utils import logging
alfred/http/typed.py CHANGED
@@ -2,6 +2,9 @@
2
2
  from enum import Enum
3
3
  from typing import TypedDict, Optional, Text
4
4
 
5
+ # Project Imports
6
+ from alfred.base import ResponseType
7
+
5
8
 
6
9
  class HttpMethod(Enum):
7
10
  POST = "POST"
@@ -18,12 +21,6 @@ class AuthMethod(Enum):
18
21
  HMAC = ("hmac",)
19
22
 
20
23
 
21
- class ResponseType:
22
- JSON = "json"
23
- TEXT = "text"
24
- XML = "xml"
25
-
26
-
27
24
  class OAuthConfiguration(TypedDict):
28
25
  username: Text
29
26
  password: Text
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: alfred-python
3
- Version: 0.6.1
3
+ Version: 0.6.3
4
4
  Summary: Python library designed to simplify and streamline interactions with the Alfred API
5
5
  Author-email: Tagshelf LLC <support@tagshelf.com>
6
6
  License: Copyright (c) 2018 The Python Packaging Authority
@@ -269,11 +269,11 @@ auth_config = AuthConfiguration({
269
269
  "api_key": "<api-key>"
270
270
  })
271
271
 
272
- client = AlfredRealTimeClient(
272
+ realtime_client = AlfredRealTimeClient(
273
273
  config,
274
274
  auth_config,
275
275
  verbose=False,
276
- on_callback=None,
276
+ error_callback=None,
277
277
  on_connect=None
278
278
  )
279
279
  ```
@@ -282,7 +282,7 @@ client = AlfredRealTimeClient(
282
282
  These events are specifically designed to respond to a variety of actions or status changes related to Files. To see more details about File events, visit our [official documentation](https://docs.tagshelf.dev/event-api/fileevents).
283
283
  ```python
284
284
  # Listen to all File events
285
- client.on_file_event(lambda data: print(data))
285
+ realtime_client.on_file_event(lambda data: print(data))
286
286
  ```
287
287
 
288
288
  ### Job Events
@@ -290,7 +290,7 @@ Alfred performs asynchronous document classification, extraction, and indexing o
290
290
 
291
291
  ```python
292
292
  # Listen to all Job events
293
- client.on_job_event(lambda data: print(data))
293
+ realtime_client.on_job_event(lambda data: print(data))
294
294
  ```
295
295
 
296
296
  ### Specific Events
@@ -304,10 +304,10 @@ Here's an example of how to listen to a specific event:
304
304
  from alfred.base import FileEvent, JobEvent
305
305
 
306
306
  # Listen to the specific File Done event
307
- client.on(FileEvent.FILE_DONE_EVENT.value, lambda data: print(data))
307
+ realtime_client.on(FileEvent.FILE_DONE_EVENT.value, lambda data: print(data))
308
308
 
309
309
  # Listen to the specific Job Finished event
310
- client.on(JobEvent.JOB_FINISHED_EVENT.value, lambda data: print(data))
310
+ realtime_client.on(JobEvent.JOB_FINISHED_EVENT.value, lambda data: print(data))
311
311
  ```
312
312
 
313
313
  Here is a list of all supported events:
@@ -1,12 +1,13 @@
1
1
  alfred/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
2
2
  alfred/base/__init__.py,sha256=ofqXadRCm14fndC43dox_TdUKgrtXn1MveCzj7t6qA0,73
3
3
  alfred/base/config.py,sha256=Uqakwi-5Hb73JrWcyhwlrWbTm2pJF_EKA6GaVXm58EQ,866
4
- alfred/base/constants.py,sha256=hxSL_lISCWuSfglTpkQOl82KFX_u5HOO6LQh-oiybAM,3125
4
+ alfred/base/constants.py,sha256=vCPdh3u9Twh0fuPxJabaKA86MOHQ2q-JiwYpgaCPgQA,3125
5
5
  alfred/base/exceptions.py,sha256=LeKJq4JDNCtsQdfo8xzqwbum99H_3fVhlpkyPO2ChhU,301
6
+ alfred/base/typed.py,sha256=8Ix94K975s_CTjqDYXkfH3rqMqBuak9bBTflxSOCtRI,71
6
7
  alfred/exceptions/__init__.py,sha256=Um5nvtfKZaD_4vbrv6R9kazOejs8UKS2o0GafAddDx8,226
7
8
  alfred/http/__init__.py,sha256=Gk-UEx2h6ZBQayngVo9UNiDaPZka5MTQIbpq7Zf4_eQ,48
8
- alfred/http/http_client.py,sha256=opN0QVyEmRvVkwemp63XNG5_ga1L6N1QOlF4oL174KA,18536
9
- alfred/http/typed.py,sha256=0lqZT9F16f2IxqDCIf0oeNuGRWHkFHY4RQCIc4iXna0,939
9
+ alfred/http/http_client.py,sha256=qY1U1IotUZfHkIYOt1Ao48OCFPrGw5G1NI-lnx7a990,18574
10
+ alfred/http/typed.py,sha256=YtL-JO9u9XeIe5c0qOf-1CwzBcHNmb-lXfCAsoFlKrQ,921
10
11
  alfred/realtime/__init__.py,sha256=0oG5LjzvrOU4U6__o1AuNdtARe8yYn2di-v-vu8SV4E,4280
11
12
  alfred/rest/__init__.py,sha256=VprIGEGvsyTbhggoFcgUKC7FSoX6adjSGCcu2sehTMo,2554
12
13
  alfred/rest/data_points/__init__.py,sha256=893MGIl_fcqM1f3WBb_SuXFwJI9mWGJT6b85410ah0M,350
@@ -27,8 +28,8 @@ alfred/typings/__init__.py,sha256=F7iVP8Wv4FPfqlwFRR8M381Q55IYChCiTANYr1vgDDw,34
27
28
  alfred/typings/misc.py,sha256=m2i4ktYiX8U6Hx00os9b6hSP9k6t_Y7DdAppE8hFJCc,216
28
29
  alfred/utils/__init__.py,sha256=oCoKgEKGX2kefjKNrv5GgDaTY2JQRHXqr-VPeIC9u2Q,35
29
30
  alfred/utils/logging.py,sha256=7pcLpP-klfv1FhgMp1WIc8BKEHQlOhrj7qjGYYw31cc,2333
30
- alfred_python-0.6.1.dist-info/LICENSE,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
31
- alfred_python-0.6.1.dist-info/METADATA,sha256=tcBLtyxOyP7G4KlAkQy8pk9VEwiaNxOzrJgu6KCQ3Tc,17797
32
- alfred_python-0.6.1.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
33
- alfred_python-0.6.1.dist-info/top_level.txt,sha256=ciQlts3Jwu5HdzhiQYDhjDGMoxlI9_CcqBEgc6PBE5U,7
34
- alfred_python-0.6.1.dist-info/RECORD,,
31
+ alfred_python-0.6.3.dist-info/LICENSE,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
32
+ alfred_python-0.6.3.dist-info/METADATA,sha256=6vLR_uRjjQDMCHCAHEVQYjnrzODDuiIiJSq03jzlIDw,17845
33
+ alfred_python-0.6.3.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
34
+ alfred_python-0.6.3.dist-info/top_level.txt,sha256=ciQlts3Jwu5HdzhiQYDhjDGMoxlI9_CcqBEgc6PBE5U,7
35
+ alfred_python-0.6.3.dist-info/RECORD,,