devupai 1.0.0a1__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.
devupai/__init__.py ADDED
@@ -0,0 +1,85 @@
1
+ """The official Python client for the DEVUP AI API.
2
+
3
+ Create a client and call the API::
4
+
5
+ from devupai import DevupAI
6
+
7
+ client = DevupAI() # reads the key from DEVUP_API_KEY, then DEVUPAI_API_KEY
8
+
9
+ ``AsyncDevupAI`` offers the same options for ``asyncio`` code. ``create(stream=True)`` returns a ``Stream`` (an
10
+ ``AsyncStream`` on the async client), and a binary result is a ``BinaryResponse`` (``AsyncBinaryResponse``).
11
+
12
+ An answer or a connection problem raises a subclass of ``DevupAPIError`` (``APIConnectionError`` when no response
13
+ was received); a webhook that cannot be verified raises ``DevupWebhookVerificationError``. An option or header value
14
+ that is not valid raises ``TypeError`` or ``ValueError`` before anything is sent, and a closed client raises
15
+ ``RuntimeError``.
16
+
17
+ Request parameter and response types live in ``devupai.types``. Webhook signatures are checked with
18
+ ``client.webhooks``, or with ``verify_webhook_signature`` and ``construct_webhook_event`` without a client.
19
+ """
20
+
21
+ from devupai import types
22
+ from devupai._client import AsyncDevupAI, DebugEvent, DevupAI, RequestOptions
23
+ from devupai._errors import (
24
+ APIConnectionError,
25
+ APITimeoutError,
26
+ AuthenticationError,
27
+ BadRequestError,
28
+ ConflictError,
29
+ DevupAPIError,
30
+ DevupWebhookVerificationError,
31
+ InternalServerError,
32
+ NotFoundError,
33
+ PayloadTooLargeError,
34
+ PaymentRequiredError,
35
+ PermissionDeniedError,
36
+ RateLimitError,
37
+ UnprocessableEntityError,
38
+ UnsupportedMediaTypeError,
39
+ )
40
+ from devupai._response import APIResponse, AsyncBinaryResponse, BinaryResponse
41
+ from devupai._streaming import AsyncStream, Stream
42
+ from devupai._version import __version__
43
+ from devupai.webhooks import Webhooks, construct_webhook_event, verify_webhook_signature
44
+
45
+ VERSION: str = __version__
46
+ """The version of this package, the same value as ``__version__``."""
47
+
48
+ __all__ = [
49
+ # Clients and responses.
50
+ "DevupAI",
51
+ "AsyncDevupAI",
52
+ "APIResponse",
53
+ "DebugEvent",
54
+ "RequestOptions",
55
+ # Streams and binary results.
56
+ "Stream",
57
+ "AsyncStream",
58
+ "BinaryResponse",
59
+ "AsyncBinaryResponse",
60
+ # Version.
61
+ "VERSION",
62
+ "__version__",
63
+ # Errors.
64
+ "DevupAPIError",
65
+ "BadRequestError",
66
+ "AuthenticationError",
67
+ "PaymentRequiredError",
68
+ "PermissionDeniedError",
69
+ "NotFoundError",
70
+ "ConflictError",
71
+ "PayloadTooLargeError",
72
+ "UnsupportedMediaTypeError",
73
+ "UnprocessableEntityError",
74
+ "RateLimitError",
75
+ "InternalServerError",
76
+ "APIConnectionError",
77
+ "APITimeoutError",
78
+ "DevupWebhookVerificationError",
79
+ # Webhooks.
80
+ "Webhooks",
81
+ "verify_webhook_signature",
82
+ "construct_webhook_event",
83
+ # Request parameter and response types.
84
+ "types",
85
+ ]