zerodb-celery 0.1.0__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.
- zerodb_celery-0.1.0/.coverage +0 -0
- zerodb_celery-0.1.0/LICENSE +21 -0
- zerodb_celery-0.1.0/PKG-INFO +155 -0
- zerodb_celery-0.1.0/README.md +125 -0
- zerodb_celery-0.1.0/pyproject.toml +63 -0
- zerodb_celery-0.1.0/tests/__init__.py +0 -0
- zerodb_celery-0.1.0/tests/test_backend.py +585 -0
- zerodb_celery-0.1.0/zerodb_celery/__init__.py +16 -0
- zerodb_celery-0.1.0/zerodb_celery/backend.py +172 -0
- zerodb_celery-0.1.0/zerodb_celery/broker.py +214 -0
- zerodb_celery-0.1.0/zerodb_celery/provision.py +132 -0
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AINative Studio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: zerodb-celery
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Celery broker + result backend powered by ZeroDB. Replace Redis/RabbitMQ with one line — zero infrastructure, auto-provisioned.
|
|
5
|
+
Project-URL: Homepage, https://github.com/AINative-Studio/zerodb-celery
|
|
6
|
+
Project-URL: Documentation, https://docs.ainative.studio
|
|
7
|
+
Project-URL: Repository, https://github.com/AINative-Studio/zerodb-celery
|
|
8
|
+
Project-URL: Issues, https://github.com/AINative-Studio/zerodb-celery/issues
|
|
9
|
+
Author-email: AINative Studio <hello@ainative.studio>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: ai-pipeline,ainative,auto-provisioning,background-jobs,celery,celery-backend,celery-broker,claude,cursor,event-driven,ml-pipeline,python,rabbitmq-alternative,redis-alternative,task-queue,zerodb
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Framework :: Celery
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Classifier: Topic :: System :: Distributed Computing
|
|
26
|
+
Requires-Python: >=3.8
|
|
27
|
+
Requires-Dist: celery>=5.0
|
|
28
|
+
Requires-Dist: requests>=2.28
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# zerodb-celery
|
|
32
|
+
|
|
33
|
+
**Celery broker + result backend powered by ZeroDB. Replace Redis/RabbitMQ with one line.**
|
|
34
|
+
|
|
35
|
+
[](https://pypi.org/project/zerodb-celery/)
|
|
36
|
+
[](LICENSE)
|
|
37
|
+
|
|
38
|
+
## Why?
|
|
39
|
+
|
|
40
|
+
Celery requires Redis or RabbitMQ for its broker and result backend. That means provisioning, configuring, and paying for infrastructure you shouldn't need.
|
|
41
|
+
|
|
42
|
+
`zerodb-celery` replaces both with [ZeroDB](https://ainative.studio) — a cloud database that auto-provisions on first use. No signup, no credit card, no infrastructure.
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install zerodb-celery
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Quick Start
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from celery import Celery
|
|
54
|
+
from zerodb_celery import ZeroDBBroker, ZeroDBBackend
|
|
55
|
+
|
|
56
|
+
app = Celery('tasks')
|
|
57
|
+
|
|
58
|
+
# Configure both broker and backend
|
|
59
|
+
ZeroDBBroker.configure(app)
|
|
60
|
+
ZeroDBBackend.configure(app)
|
|
61
|
+
|
|
62
|
+
@app.task
|
|
63
|
+
def add(x, y):
|
|
64
|
+
return x + y
|
|
65
|
+
|
|
66
|
+
# Trigger a task
|
|
67
|
+
result = add.delay(4, 6)
|
|
68
|
+
print(result.get(timeout=30)) # 10
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Configuration
|
|
72
|
+
|
|
73
|
+
### Auto-provisioning (default)
|
|
74
|
+
|
|
75
|
+
Just use `zerodb://auto` — a free ZeroDB project is created on first use:
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
app.config_from_object({
|
|
79
|
+
'broker_url': 'zerodb://auto',
|
|
80
|
+
'broker_transport': 'zerodb_celery.broker:Transport',
|
|
81
|
+
'result_backend': 'zerodb_celery.backend:ZeroDBBackend',
|
|
82
|
+
})
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Explicit credentials
|
|
86
|
+
|
|
87
|
+
Set environment variables:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
export ZERODB_API_KEY=zdb_your_key_here
|
|
91
|
+
export ZERODB_PROJECT_ID=proj_your_id_here
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Or pass them directly:
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
ZeroDBBroker.configure(app, api_key='zdb_...', project_id='proj_...')
|
|
98
|
+
ZeroDBBackend.configure(app, api_key='zdb_...', project_id='proj_...')
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Credential resolution order
|
|
102
|
+
|
|
103
|
+
1. Explicit `api_key` / `project_id` parameters
|
|
104
|
+
2. `ZERODB_API_KEY` / `ZERODB_PROJECT_ID` environment variables
|
|
105
|
+
3. Cached credentials in `~/.zerodb/credentials.json`
|
|
106
|
+
4. Auto-provision a new free project via API
|
|
107
|
+
|
|
108
|
+
## How It Works
|
|
109
|
+
|
|
110
|
+
### Broker (message queue)
|
|
111
|
+
|
|
112
|
+
The broker uses ZeroDB's event stream as a message queue:
|
|
113
|
+
|
|
114
|
+
- **Publish task**: `POST /api/v1/zerodb/events` with topic `celery:{queue_name}`
|
|
115
|
+
- **Consume task**: `GET /api/v1/zerodb/events?topic=celery:{queue_name}&consume=true`
|
|
116
|
+
|
|
117
|
+
### Result backend (task results)
|
|
118
|
+
|
|
119
|
+
The backend stores results in a ZeroDB table called `celery_results`:
|
|
120
|
+
|
|
121
|
+
- **Store result**: `POST /api/v1/zerodb/tables/celery_results/rows`
|
|
122
|
+
- **Get result**: `GET /api/v1/zerodb/tables/celery_results/rows/{task_id}`
|
|
123
|
+
|
|
124
|
+
The table is auto-created on first use.
|
|
125
|
+
|
|
126
|
+
## Use Cases
|
|
127
|
+
|
|
128
|
+
- **ML pipelines**: Queue training jobs, store results — no Redis needed
|
|
129
|
+
- **AI agent workflows**: Background task processing for agent swarms
|
|
130
|
+
- **Serverless apps**: No infrastructure to manage alongside your Celery workers
|
|
131
|
+
- **Prototyping**: Get Celery running in 30 seconds without Docker
|
|
132
|
+
|
|
133
|
+
## Comparison
|
|
134
|
+
|
|
135
|
+
| Feature | Redis | RabbitMQ | zerodb-celery |
|
|
136
|
+
|---------|-------|----------|---------------|
|
|
137
|
+
| Setup time | 5-30 min | 10-60 min | 0 min (auto) |
|
|
138
|
+
| Infrastructure | Self-hosted or managed | Self-hosted or managed | None |
|
|
139
|
+
| Cost | $15-100+/mo | $15-100+/mo | Free tier |
|
|
140
|
+
| Persistence | Optional (AOF/RDB) | Yes | Yes |
|
|
141
|
+
| Auto-provisioning | No | No | Yes |
|
|
142
|
+
|
|
143
|
+
## Development
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Install dev dependencies
|
|
147
|
+
pip install -e ".[dev]"
|
|
148
|
+
|
|
149
|
+
# Run tests
|
|
150
|
+
pytest tests/ -v
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## License
|
|
154
|
+
|
|
155
|
+
MIT
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# zerodb-celery
|
|
2
|
+
|
|
3
|
+
**Celery broker + result backend powered by ZeroDB. Replace Redis/RabbitMQ with one line.**
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/zerodb-celery/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
## Why?
|
|
9
|
+
|
|
10
|
+
Celery requires Redis or RabbitMQ for its broker and result backend. That means provisioning, configuring, and paying for infrastructure you shouldn't need.
|
|
11
|
+
|
|
12
|
+
`zerodb-celery` replaces both with [ZeroDB](https://ainative.studio) — a cloud database that auto-provisions on first use. No signup, no credit card, no infrastructure.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install zerodb-celery
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
from celery import Celery
|
|
24
|
+
from zerodb_celery import ZeroDBBroker, ZeroDBBackend
|
|
25
|
+
|
|
26
|
+
app = Celery('tasks')
|
|
27
|
+
|
|
28
|
+
# Configure both broker and backend
|
|
29
|
+
ZeroDBBroker.configure(app)
|
|
30
|
+
ZeroDBBackend.configure(app)
|
|
31
|
+
|
|
32
|
+
@app.task
|
|
33
|
+
def add(x, y):
|
|
34
|
+
return x + y
|
|
35
|
+
|
|
36
|
+
# Trigger a task
|
|
37
|
+
result = add.delay(4, 6)
|
|
38
|
+
print(result.get(timeout=30)) # 10
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Configuration
|
|
42
|
+
|
|
43
|
+
### Auto-provisioning (default)
|
|
44
|
+
|
|
45
|
+
Just use `zerodb://auto` — a free ZeroDB project is created on first use:
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
app.config_from_object({
|
|
49
|
+
'broker_url': 'zerodb://auto',
|
|
50
|
+
'broker_transport': 'zerodb_celery.broker:Transport',
|
|
51
|
+
'result_backend': 'zerodb_celery.backend:ZeroDBBackend',
|
|
52
|
+
})
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Explicit credentials
|
|
56
|
+
|
|
57
|
+
Set environment variables:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
export ZERODB_API_KEY=zdb_your_key_here
|
|
61
|
+
export ZERODB_PROJECT_ID=proj_your_id_here
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Or pass them directly:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
ZeroDBBroker.configure(app, api_key='zdb_...', project_id='proj_...')
|
|
68
|
+
ZeroDBBackend.configure(app, api_key='zdb_...', project_id='proj_...')
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Credential resolution order
|
|
72
|
+
|
|
73
|
+
1. Explicit `api_key` / `project_id` parameters
|
|
74
|
+
2. `ZERODB_API_KEY` / `ZERODB_PROJECT_ID` environment variables
|
|
75
|
+
3. Cached credentials in `~/.zerodb/credentials.json`
|
|
76
|
+
4. Auto-provision a new free project via API
|
|
77
|
+
|
|
78
|
+
## How It Works
|
|
79
|
+
|
|
80
|
+
### Broker (message queue)
|
|
81
|
+
|
|
82
|
+
The broker uses ZeroDB's event stream as a message queue:
|
|
83
|
+
|
|
84
|
+
- **Publish task**: `POST /api/v1/zerodb/events` with topic `celery:{queue_name}`
|
|
85
|
+
- **Consume task**: `GET /api/v1/zerodb/events?topic=celery:{queue_name}&consume=true`
|
|
86
|
+
|
|
87
|
+
### Result backend (task results)
|
|
88
|
+
|
|
89
|
+
The backend stores results in a ZeroDB table called `celery_results`:
|
|
90
|
+
|
|
91
|
+
- **Store result**: `POST /api/v1/zerodb/tables/celery_results/rows`
|
|
92
|
+
- **Get result**: `GET /api/v1/zerodb/tables/celery_results/rows/{task_id}`
|
|
93
|
+
|
|
94
|
+
The table is auto-created on first use.
|
|
95
|
+
|
|
96
|
+
## Use Cases
|
|
97
|
+
|
|
98
|
+
- **ML pipelines**: Queue training jobs, store results — no Redis needed
|
|
99
|
+
- **AI agent workflows**: Background task processing for agent swarms
|
|
100
|
+
- **Serverless apps**: No infrastructure to manage alongside your Celery workers
|
|
101
|
+
- **Prototyping**: Get Celery running in 30 seconds without Docker
|
|
102
|
+
|
|
103
|
+
## Comparison
|
|
104
|
+
|
|
105
|
+
| Feature | Redis | RabbitMQ | zerodb-celery |
|
|
106
|
+
|---------|-------|----------|---------------|
|
|
107
|
+
| Setup time | 5-30 min | 10-60 min | 0 min (auto) |
|
|
108
|
+
| Infrastructure | Self-hosted or managed | Self-hosted or managed | None |
|
|
109
|
+
| Cost | $15-100+/mo | $15-100+/mo | Free tier |
|
|
110
|
+
| Persistence | Optional (AOF/RDB) | Yes | Yes |
|
|
111
|
+
| Auto-provisioning | No | No | Yes |
|
|
112
|
+
|
|
113
|
+
## Development
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Install dev dependencies
|
|
117
|
+
pip install -e ".[dev]"
|
|
118
|
+
|
|
119
|
+
# Run tests
|
|
120
|
+
pytest tests/ -v
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
MIT
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "zerodb-celery"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Celery broker + result backend powered by ZeroDB. Replace Redis/RabbitMQ with one line — zero infrastructure, auto-provisioned."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.8"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "AINative Studio", email = "hello@ainative.studio" },
|
|
14
|
+
]
|
|
15
|
+
keywords = [
|
|
16
|
+
"celery",
|
|
17
|
+
"celery-backend",
|
|
18
|
+
"celery-broker",
|
|
19
|
+
"task-queue",
|
|
20
|
+
"redis-alternative",
|
|
21
|
+
"rabbitmq-alternative",
|
|
22
|
+
"zerodb",
|
|
23
|
+
"ainative",
|
|
24
|
+
"auto-provisioning",
|
|
25
|
+
"background-jobs",
|
|
26
|
+
"python",
|
|
27
|
+
"ai-pipeline",
|
|
28
|
+
"ml-pipeline",
|
|
29
|
+
"event-driven",
|
|
30
|
+
"claude",
|
|
31
|
+
"cursor",
|
|
32
|
+
]
|
|
33
|
+
classifiers = [
|
|
34
|
+
"Development Status :: 3 - Alpha",
|
|
35
|
+
"Intended Audience :: Developers",
|
|
36
|
+
"License :: OSI Approved :: MIT License",
|
|
37
|
+
"Programming Language :: Python :: 3",
|
|
38
|
+
"Programming Language :: Python :: 3.8",
|
|
39
|
+
"Programming Language :: Python :: 3.9",
|
|
40
|
+
"Programming Language :: Python :: 3.10",
|
|
41
|
+
"Programming Language :: Python :: 3.11",
|
|
42
|
+
"Programming Language :: Python :: 3.12",
|
|
43
|
+
"Programming Language :: Python :: 3.13",
|
|
44
|
+
"Framework :: Celery",
|
|
45
|
+
"Topic :: System :: Distributed Computing",
|
|
46
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
47
|
+
]
|
|
48
|
+
dependencies = [
|
|
49
|
+
"celery>=5.0",
|
|
50
|
+
"requests>=2.28",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
[project.urls]
|
|
54
|
+
Homepage = "https://github.com/AINative-Studio/zerodb-celery"
|
|
55
|
+
Documentation = "https://docs.ainative.studio"
|
|
56
|
+
Repository = "https://github.com/AINative-Studio/zerodb-celery"
|
|
57
|
+
Issues = "https://github.com/AINative-Studio/zerodb-celery/issues"
|
|
58
|
+
|
|
59
|
+
[tool.hatch.build.targets.wheel]
|
|
60
|
+
packages = ["zerodb_celery"]
|
|
61
|
+
|
|
62
|
+
[tool.pytest.ini_options]
|
|
63
|
+
testpaths = ["tests"]
|
|
File without changes
|