useknockout 0.7.0__tar.gz → 0.8.1__tar.gz
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.
- useknockout-0.8.1/.remember/.gitignore +1 -0
- useknockout-0.8.1/.remember/logs/hook-errors.log +0 -0
- useknockout-0.8.1/.remember/logs/memory-2026-07-30.log +8 -0
- {useknockout-0.7.0 → useknockout-0.8.1}/PKG-INFO +30 -36
- {useknockout-0.7.0 → useknockout-0.8.1}/README.md +335 -341
- {useknockout-0.7.0 → useknockout-0.8.1}/pyproject.toml +61 -60
- {useknockout-0.7.0 → useknockout-0.8.1}/src/useknockout/__init__.py +47 -47
- useknockout-0.8.1/src/useknockout/_version.py +1 -0
- {useknockout-0.7.0 → useknockout-0.8.1}/src/useknockout/async_client.py +46 -7
- {useknockout-0.7.0 → useknockout-0.8.1}/src/useknockout/client.py +59 -12
- useknockout-0.7.0/src/useknockout/_version.py +0 -1
- {useknockout-0.7.0 → useknockout-0.8.1}/.gitignore +0 -0
- {useknockout-0.7.0 → useknockout-0.8.1}/LICENSE +0 -0
- {useknockout-0.7.0 → useknockout-0.8.1}/SERVICES.md +0 -0
- {useknockout-0.7.0 → useknockout-0.8.1}/TECHSTACK.md +0 -0
- {useknockout-0.7.0 → useknockout-0.8.1}/src/useknockout/_helpers.py +0 -0
- {useknockout-0.7.0 → useknockout-0.8.1}/src/useknockout/errors.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
01:27:19 [hook] session-start: PROJECT_DIR=C:/Users/Troy/projects/useknockout-python PIPELINE_DIR=C:/Users/Troy/.claude/plugins/cache/claude-plugins-official/remember/0.8.3 REMEMBER_DIR=C:/Users/Troy/projects/useknockout-python/.remember
|
|
2
|
+
01:29:21 [hook] post-tool: PROJECT_DIR=C:/Users/Troy/projects/useknockout-python PIPELINE_DIR=C:/Users/Troy/.claude/plugins/cache/claude-plugins-official/remember/0.8.3 PYTHON=python REMEMBER_DIR=C:/Users/Troy/projects/useknockout-python/.remember
|
|
3
|
+
01:29:24 [hook] post-tool: PROJECT_DIR=C:/Users/Troy/projects/useknockout-python PIPELINE_DIR=C:/Users/Troy/.claude/plugins/cache/claude-plugins-official/remember/0.8.3 PYTHON=python REMEMBER_DIR=C:/Users/Troy/projects/useknockout-python/.remember
|
|
4
|
+
01:29:35 [hook] post-tool: PROJECT_DIR=C:/Users/Troy/projects/useknockout-python PIPELINE_DIR=C:/Users/Troy/.claude/plugins/cache/claude-plugins-official/remember/0.8.3 PYTHON=python REMEMBER_DIR=C:/Users/Troy/projects/useknockout-python/.remember
|
|
5
|
+
01:29:46 [hook] post-tool: PROJECT_DIR=C:/Users/Troy/projects/useknockout-python PIPELINE_DIR=C:/Users/Troy/.claude/plugins/cache/claude-plugins-official/remember/0.8.3 PYTHON=python REMEMBER_DIR=C:/Users/Troy/projects/useknockout-python/.remember
|
|
6
|
+
01:30:06 [hook] post-tool: PROJECT_DIR=C:/Users/Troy/projects/useknockout-python PIPELINE_DIR=C:/Users/Troy/.claude/plugins/cache/claude-plugins-official/remember/0.8.3 PYTHON=python REMEMBER_DIR=C:/Users/Troy/projects/useknockout-python/.remember
|
|
7
|
+
01:30:12 [hook] post-tool: PROJECT_DIR=C:/Users/Troy/projects/useknockout-python PIPELINE_DIR=C:/Users/Troy/.claude/plugins/cache/claude-plugins-official/remember/0.8.3 PYTHON=python REMEMBER_DIR=C:/Users/Troy/projects/useknockout-python/.remember
|
|
8
|
+
01:30:33 [hook] post-tool: PROJECT_DIR=C:/Users/Troy/projects/useknockout-python PIPELINE_DIR=C:/Users/Troy/.claude/plugins/cache/claude-plugins-official/remember/0.8.3 PYTHON=python REMEMBER_DIR=C:/Users/Troy/projects/useknockout-python/.remember
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: useknockout
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: Python SDK for useknockout
|
|
3
|
+
Version: 0.8.1
|
|
4
|
+
Summary: Python SDK for useknockout, the open source background removal API.
|
|
5
5
|
Project-URL: Homepage, https://useknockout.com
|
|
6
6
|
Project-URL: Documentation, https://github.com/useknockout/python
|
|
7
7
|
Project-URL: Repository, https://github.com/useknockout/python
|
|
@@ -9,7 +9,7 @@ Project-URL: Issues, https://github.com/useknockout/python/issues
|
|
|
9
9
|
Author: useknockout
|
|
10
10
|
License: MIT
|
|
11
11
|
License-File: LICENSE
|
|
12
|
-
Keywords: ai,background-removal,birefnet,image-processing,remove-background,useknockout
|
|
12
|
+
Keywords: ai,background-removal,birefnet,image-processing,open-source,remove-background,useknockout
|
|
13
13
|
Classifier: Development Status :: 4 - Beta
|
|
14
14
|
Classifier: Intended Audience :: Developers
|
|
15
15
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -30,20 +30,18 @@ Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
|
30
30
|
Requires-Dist: ruff>=0.6.0; extra == 'dev'
|
|
31
31
|
Description-Content-Type: text/markdown
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
project: projects/useknockout-python
|
|
35
|
-
type: readme
|
|
36
|
-
---
|
|
33
|
+
|
|
37
34
|
|
|
38
35
|
<div align="center">
|
|
39
36
|
|
|
40
37
|
# 🥊 useknockout
|
|
41
38
|
|
|
42
|
-
**
|
|
39
|
+
**Python SDK for useknockout, the open source background removal API.**
|
|
43
40
|
|
|
44
41
|
[](https://pypi.org/project/useknockout/)
|
|
45
42
|
[](https://pypi.org/project/useknockout/)
|
|
46
43
|
[](LICENSE)
|
|
44
|
+
[](https://pepy.tech/projects/useknockout)
|
|
47
45
|
|
|
48
46
|
[Website](https://useknockout.com) ·
|
|
49
47
|
[API repo](https://github.com/useknockout/api) ·
|
|
@@ -53,7 +51,7 @@ type: readme
|
|
|
53
51
|
|
|
54
52
|
<img src="https://raw.githubusercontent.com/useknockout/api/main/docs/banner.png" width="800" alt="useknockout — background removal API for developers" />
|
|
55
53
|
|
|
56
|
-
*
|
|
54
|
+
*Open source background removal and image processing. MIT licensed.*
|
|
57
55
|
|
|
58
56
|
</div>
|
|
59
57
|
|
|
@@ -68,6 +66,9 @@ subject-aware image operations: background replacement, drop shadows, stickers a
|
|
|
68
66
|
outlines, e-commerce / LinkedIn presets, super-resolution upscaling, face
|
|
69
67
|
restoration, colorization, silhouettes, and inpainting.
|
|
70
68
|
|
|
69
|
+
The API is open source under the MIT license:
|
|
70
|
+
[github.com/useknockout/api](https://github.com/useknockout/api).
|
|
71
|
+
|
|
71
72
|
The SDK is a thin, fully-typed wrapper over [`httpx`](https://www.python-httpx.org/).
|
|
72
73
|
It ships both a synchronous client (`Knockout`) and an asynchronous one
|
|
73
74
|
(`AsyncKnockout`) with identical method signatures. Every image-returning method
|
|
@@ -88,14 +89,15 @@ Requires Python 3.9+. The only runtime dependency is `httpx>=0.27.0`.
|
|
|
88
89
|
```python
|
|
89
90
|
from useknockout import Knockout
|
|
90
91
|
|
|
91
|
-
client = Knockout() # uses
|
|
92
|
+
client = Knockout() # uses the shared demo key
|
|
92
93
|
png = client.remove("photo.jpg")
|
|
93
94
|
|
|
94
95
|
with open("out.png", "wb") as f:
|
|
95
96
|
f.write(png)
|
|
96
97
|
```
|
|
97
98
|
|
|
98
|
-
That's it.
|
|
99
|
+
That's it, no sign-up needed to try it. The demo key is limited, so get your own
|
|
100
|
+
key before building on it (see [Authentication](#authentication)).
|
|
99
101
|
|
|
100
102
|
## Async
|
|
101
103
|
|
|
@@ -123,16 +125,24 @@ The client resolves its token by falling through three sources, in order:
|
|
|
123
125
|
|
|
124
126
|
1. The `token=` constructor argument
|
|
125
127
|
2. The `KNOCKOUT_TOKEN` environment variable
|
|
126
|
-
3.
|
|
128
|
+
3. A shared demo key built into the SDK
|
|
127
129
|
|
|
128
130
|
```python
|
|
129
131
|
client = Knockout(token="kno_...") # explicit
|
|
130
|
-
client = Knockout() # env var or
|
|
132
|
+
client = Knockout() # env var or shared demo key
|
|
131
133
|
```
|
|
132
134
|
|
|
133
|
-
The token is sent as a `Bearer` header on every request.
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
The token is sent as a `Bearer` header on every request.
|
|
136
|
+
|
|
137
|
+
**Demo key limits.** It is for trying the API without an account. It only works
|
|
138
|
+
with `remove`, `replace_background`, `mask`, `sticker` and `compare`, output is
|
|
139
|
+
capped at 1536 px, and it has daily usage limits. Other image methods return an
|
|
140
|
+
error.
|
|
141
|
+
|
|
142
|
+
**Your own key.** Sign up at [useknockout.com/signin](https://useknockout.com/signin).
|
|
143
|
+
Free accounts get 30 images every month on the core tools, no card. Pay-as-you-go
|
|
144
|
+
is $0.02 per image and unlocks the rest. Current rates are on the
|
|
145
|
+
[pricing page](https://useknockout.com/pricing).
|
|
136
146
|
|
|
137
147
|
## Input types
|
|
138
148
|
|
|
@@ -152,7 +162,7 @@ client.remove(open("photo.jpg", "rb").read())# bytes
|
|
|
152
162
|
```python
|
|
153
163
|
from useknockout import Knockout
|
|
154
164
|
|
|
155
|
-
c = Knockout()
|
|
165
|
+
c = Knockout(token="kno_...") # your own key; the demo key covers only a few of these
|
|
156
166
|
|
|
157
167
|
# --- Core background removal ---
|
|
158
168
|
c.remove("photo.jpg") # returns PNG/WebP bytes
|
|
@@ -297,30 +307,14 @@ when available).
|
|
|
297
307
|
|
|
298
308
|
| Constructor arg | Default | Purpose |
|
|
299
309
|
| --- | --- | --- |
|
|
300
|
-
| `token` | env var →
|
|
301
|
-
| `base_url` | `https://useknockout--api.modal.run` | API base URL
|
|
310
|
+
| `token` | env var → shared demo key | API token, sent as `Bearer` header |
|
|
311
|
+
| `base_url` | `https://useknockout--api.modal.run` | API base URL |
|
|
302
312
|
| `timeout` | `60.0` | per-request timeout in seconds |
|
|
303
313
|
|
|
304
314
|
| Environment variable | Purpose |
|
|
305
315
|
| --- | --- |
|
|
306
316
|
| `KNOCKOUT_TOKEN` | API token, used when `token=` is not passed |
|
|
307
317
|
|
|
308
|
-
## Self-host
|
|
309
|
-
|
|
310
|
-
The API is open source and runs on Modal. Deploy your own copy:
|
|
311
|
-
|
|
312
|
-
```bash
|
|
313
|
-
git clone https://github.com/useknockout/api
|
|
314
|
-
cd api
|
|
315
|
-
modal deploy main.py
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
Then point the SDK at your deployment:
|
|
319
|
-
|
|
320
|
-
```python
|
|
321
|
-
client = Knockout(token="your-token", base_url="https://your-deploy.modal.run")
|
|
322
|
-
```
|
|
323
|
-
|
|
324
318
|
## Project structure
|
|
325
319
|
|
|
326
320
|
```
|