imagestep 0.1.0__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.
- imagestep/__init__.py +28 -0
- imagestep/_compat.py +22 -0
- imagestep/_generated.py +3281 -0
- imagestep/client.py +2456 -0
- imagestep/errors.py +66 -0
- imagestep/py.typed +0 -0
- imagestep/webhooks.py +72 -0
- imagestep-0.1.0.dist-info/METADATA +126 -0
- imagestep-0.1.0.dist-info/RECORD +12 -0
- imagestep-0.1.0.dist-info/WHEEL +4 -0
- imagestep-0.1.0.dist-info/licenses/LICENSE +21 -0
- imagestep-0.1.0.dist-info/licenses/THIRD-PARTY-NOTICES.md +603 -0
imagestep/__init__.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""ImageStep SDK — the image step for your automations.
|
|
2
|
+
|
|
3
|
+
from imagestep import ImageStep
|
|
4
|
+
client = ImageStep(api_key="is_sk_…")
|
|
5
|
+
asset = client.assets.upload("./product.jpg")
|
|
6
|
+
job = client.ops.remove_bg(asset["id"], wait=True)
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
__version__ = "0.1.0"
|
|
10
|
+
|
|
11
|
+
# `client` reads `__version__` for its User-Agent, so the version is defined above this import.
|
|
12
|
+
from .client import AsyncImageStep, BinaryResult, ImageStep, Page, RequestResult # noqa: E402
|
|
13
|
+
from .errors import ImageStepError, JobFailedError, WebhookSignatureError # noqa: E402
|
|
14
|
+
from .webhooks import construct_webhook_event, verify_webhook_signature # noqa: E402
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"ImageStep",
|
|
18
|
+
"AsyncImageStep",
|
|
19
|
+
"BinaryResult",
|
|
20
|
+
"Page",
|
|
21
|
+
"RequestResult",
|
|
22
|
+
"ImageStepError",
|
|
23
|
+
"JobFailedError",
|
|
24
|
+
"WebhookSignatureError",
|
|
25
|
+
"verify_webhook_signature",
|
|
26
|
+
"construct_webhook_event",
|
|
27
|
+
"__version__",
|
|
28
|
+
]
|
imagestep/_compat.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""`Required` / `TypedDict` for the generated types, without a typing_extensions dependency.
|
|
2
|
+
|
|
3
|
+
`_generated.py` targets Python 3.10, where `typing.Required` does not exist yet. Its annotations
|
|
4
|
+
are strings (`from __future__ import annotations`) and are read by type checkers, not evaluated at
|
|
5
|
+
runtime, so on 3.10 without typing_extensions a placeholder is enough.
|
|
6
|
+
"""
|
|
7
|
+
import sys
|
|
8
|
+
|
|
9
|
+
if sys.version_info >= (3, 11):
|
|
10
|
+
from typing import Required, TypedDict
|
|
11
|
+
else: # pragma: no cover - exercised only on 3.10
|
|
12
|
+
try:
|
|
13
|
+
from typing_extensions import Required, TypedDict
|
|
14
|
+
except ImportError:
|
|
15
|
+
from typing import TypedDict
|
|
16
|
+
|
|
17
|
+
class Required: # placeholder, see the module docstring
|
|
18
|
+
def __class_getitem__(cls, item):
|
|
19
|
+
return item
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
__all__ = ["Required", "TypedDict"]
|