grindsharp 0.1.1__tar.gz → 0.1.2__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.
Files changed (23) hide show
  1. {grindsharp-0.1.1/src/grindsharp.egg-info → grindsharp-0.1.2}/PKG-INFO +38 -35
  2. {grindsharp-0.1.1 → grindsharp-0.1.2}/README.md +37 -34
  3. {grindsharp-0.1.1 → grindsharp-0.1.2}/pyproject.toml +1 -1
  4. {grindsharp-0.1.1 → grindsharp-0.1.2}/src/grindsharp/__init__.py +1 -1
  5. {grindsharp-0.1.1 → grindsharp-0.1.2/src/grindsharp.egg-info}/PKG-INFO +38 -35
  6. {grindsharp-0.1.1 → grindsharp-0.1.2}/LICENSE +0 -0
  7. {grindsharp-0.1.1 → grindsharp-0.1.2}/setup.cfg +0 -0
  8. {grindsharp-0.1.1 → grindsharp-0.1.2}/src/grindsharp/__main__.py +0 -0
  9. {grindsharp-0.1.1 → grindsharp-0.1.2}/src/grindsharp/app.py +0 -0
  10. {grindsharp-0.1.1 → grindsharp-0.1.2}/src/grindsharp/cli.py +0 -0
  11. {grindsharp-0.1.1 → grindsharp-0.1.2}/src/grindsharp/errors.py +0 -0
  12. {grindsharp-0.1.1 → grindsharp-0.1.2}/src/grindsharp/models.py +0 -0
  13. {grindsharp-0.1.1 → grindsharp-0.1.2}/src/grindsharp/postgres.py +0 -0
  14. {grindsharp-0.1.1 → grindsharp-0.1.2}/src/grindsharp/py.typed +0 -0
  15. {grindsharp-0.1.1 → grindsharp-0.1.2}/src/grindsharp/redis_store.py +0 -0
  16. {grindsharp-0.1.1 → grindsharp-0.1.2}/src/grindsharp/store.py +0 -0
  17. {grindsharp-0.1.1 → grindsharp-0.1.2}/src/grindsharp/worker.py +0 -0
  18. {grindsharp-0.1.1 → grindsharp-0.1.2}/src/grindsharp.egg-info/SOURCES.txt +0 -0
  19. {grindsharp-0.1.1 → grindsharp-0.1.2}/src/grindsharp.egg-info/dependency_links.txt +0 -0
  20. {grindsharp-0.1.1 → grindsharp-0.1.2}/src/grindsharp.egg-info/entry_points.txt +0 -0
  21. {grindsharp-0.1.1 → grindsharp-0.1.2}/src/grindsharp.egg-info/requires.txt +0 -0
  22. {grindsharp-0.1.1 → grindsharp-0.1.2}/src/grindsharp.egg-info/top_level.txt +0 -0
  23. {grindsharp-0.1.1 → grindsharp-0.1.2}/tests/test_grindsharp.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: grindsharp
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: SQLite-first background jobs for Python. No Redis required.
5
5
  Author: GT47THY
6
6
  License: MIT
@@ -24,28 +24,33 @@ Dynamic: license-file
24
24
 
25
25
  # Grindsharp
26
26
 
27
- Most Python apps eventually need to do stuff in the background: send an email, process an upload, call a webhook, generate a report, retry something that flopped.
27
+ SQLite-first background jobs for Python. No Redis required.
28
28
 
29
- The usual setup works, but it can be overkill for a small app — Redis, a broker, worker containers, extra config, the whole mission.
29
+ Most Python apps eventually need to do stuff in the background: send an email, process an upload, call a webhook, generate a report, retry something that flopped. The usual setup works, but it can be overkill for a small app - Redis, a broker, worker containers, extra config.
30
30
 
31
31
  Grindsharp is for the common case: you just want background jobs that are reliable and easy to run.
32
32
 
33
- It uses **SQLite** by default. No Redis needed.
33
+ ## Features
34
34
 
35
- ## What you get
36
-
37
- - A simple `@task` decorator
35
+ - Simple `@task` decorator
38
36
  - `enqueue()`, `enqueue_in()`, `enqueue_at()`
39
37
  - Retries with backoff
40
- - A worker process (with basic concurrency)
38
+ - Worker process with basic concurrency
41
39
  - SQLite-backed job storage (WAL mode)
42
40
  - Job status, crash recovery, and idempotent job IDs
43
- - A small CLI for listing/retrying/stats
41
+ - Small CLI for listing/retrying/stats
42
+ - Optional Postgres/Redis store adapters
44
43
 
45
44
  ## Install
46
45
 
47
46
  ```bash
48
- pip install -e .
47
+ pip install grindsharp
48
+ ```
49
+
50
+ For local development:
51
+
52
+ ```bash
53
+ pip install -e .[dev]
49
54
  ```
50
55
 
51
56
  ## Quick start
@@ -94,7 +99,7 @@ Run a worker:
94
99
  grindsharp worker --app jobs:jobs --db jobs.db
95
100
  ```
96
101
 
97
- That’s it: your web request returns quickly, and the worker handles the job.
102
+ That's it: your web request returns quickly, and the worker handles the job.
98
103
 
99
104
  ## FastAPI example
100
105
 
@@ -125,10 +130,10 @@ grindsharp worker --app app:jobs --db jobs.db
125
130
  ## How jobs behave
126
131
 
127
132
  - **Durable:** jobs are saved in SQLite, so they survive app restarts.
128
- - **At-least-once:** if a worker crashes mid-job, that job might run again. So write tasks like they may be retried (because they might).
133
+ - **At-least-once:** if a worker crashes mid-job, that job might run again. Write tasks so they're safe to retry.
129
134
  - **Retries:** failed jobs retry with backoff (`retry_backoff_seconds * attempt`).
130
135
  - **Timeouts:** if a task sets `timeout_seconds`, the worker marks it as timed out/failed when that limit passes (then it retries or goes dead like any other failure). A stuck Python thread may still keep running in-process, so task code should still respect timeouts/cancellation where it can.
131
- - **Dead jobs:** when retries run out, the job gets marked `dead` and keeps the last error so you can see what happened.
136
+ - **Dead jobs:** when retries run out, the job gets marked `dead` and keeps the last error.
132
137
  - **Crash recovery:** stale `running` jobs get moved back to `pending` after a timeout.
133
138
 
134
139
  ## CLI
@@ -156,23 +161,6 @@ grindsharp --db jobs.db purge --status succeeded --older-than-seconds 86400
156
161
 
157
162
  When you run `grindsharp worker` from the CLI, it handles SIGINT/SIGTERM and stops gracefully.
158
163
 
159
- ## When Grindsharp is a good fit
160
-
161
- Use it when you want background jobs without extra infrastructure:
162
-
163
- - small/medium web apps
164
- - internal tools and SaaS MVPs
165
- - single-server deployments
166
- - low-to-moderate job volume
167
-
168
- ## When to use something else
169
-
170
- - you need lots of workers spread across many machines
171
- - you already run Redis/RabbitMQ and need the fancy queue features
172
- - you need complex workflow/DAG orchestration
173
-
174
- For many apps, a Postgres/Redis-backed queue is the next step up. Grindsharp is here to make the simple case easy.
175
-
176
164
  ## Postgres / Redis backends
177
165
 
178
166
  SQLite is the default. When you outgrow a single-node setup, Grindsharp can use a different store:
@@ -189,15 +177,26 @@ jobs = Jobs(store=RedisJobStore(redis.Redis.from_url(REDIS_URL)))
189
177
 
190
178
  These adapters keep the same `Jobs`/`Worker` API. Use SQLite for simple/local apps, Postgres for durable multi-worker SQL setups, and Redis for fast queue-style workloads.
191
179
 
180
+ ## When to use Grindsharp
181
+
182
+ Good fit:
183
+
184
+ - small/medium web apps
185
+ - internal tools and SaaS MVPs
186
+ - single-server deployments
187
+ - low-to-moderate job volume
188
+
189
+ Not the right fit:
190
+
191
+ - lots of workers spread across many machines
192
+ - you already run Redis/RabbitMQ and need advanced queue features
193
+ - complex workflow/DAG orchestration
194
+
192
195
  ## Design notes
193
196
 
194
197
  - Jobs are **at-least-once** (tasks should be idempotent).
195
198
  - Payloads must be **JSON-serializable**.
196
- - SQLite makes this a great fit for **small/medium single-node apps**. When you need distributed throughput, grow to a Postgres/Redis-style queue.
197
-
198
- ## Version 0.1.1
199
-
200
- Small production-hardening pass: worker timeout enforcement, graceful SIGINT/SIGTERM shutdown in the CLI worker, CI/release workflows, and tighter packaging/lint/test setup.
199
+ - SQLite is great for small/medium single-node apps. When you need distributed throughput, move to a Postgres/Redis-style queue.
201
200
 
202
201
  ## Development
203
202
 
@@ -215,3 +214,7 @@ python scripts/integration_test_backends.py
215
214
  ```
216
215
 
217
216
  This runs the same enqueue/retry/dead-job flow against real Postgres and Redis services.
217
+
218
+ ## License
219
+
220
+ MIT
@@ -1,27 +1,32 @@
1
1
  # Grindsharp
2
2
 
3
- Most Python apps eventually need to do stuff in the background: send an email, process an upload, call a webhook, generate a report, retry something that flopped.
3
+ SQLite-first background jobs for Python. No Redis required.
4
4
 
5
- The usual setup works, but it can be overkill for a small app — Redis, a broker, worker containers, extra config, the whole mission.
5
+ Most Python apps eventually need to do stuff in the background: send an email, process an upload, call a webhook, generate a report, retry something that flopped. The usual setup works, but it can be overkill for a small app - Redis, a broker, worker containers, extra config.
6
6
 
7
7
  Grindsharp is for the common case: you just want background jobs that are reliable and easy to run.
8
8
 
9
- It uses **SQLite** by default. No Redis needed.
9
+ ## Features
10
10
 
11
- ## What you get
12
-
13
- - A simple `@task` decorator
11
+ - Simple `@task` decorator
14
12
  - `enqueue()`, `enqueue_in()`, `enqueue_at()`
15
13
  - Retries with backoff
16
- - A worker process (with basic concurrency)
14
+ - Worker process with basic concurrency
17
15
  - SQLite-backed job storage (WAL mode)
18
16
  - Job status, crash recovery, and idempotent job IDs
19
- - A small CLI for listing/retrying/stats
17
+ - Small CLI for listing/retrying/stats
18
+ - Optional Postgres/Redis store adapters
20
19
 
21
20
  ## Install
22
21
 
23
22
  ```bash
24
- pip install -e .
23
+ pip install grindsharp
24
+ ```
25
+
26
+ For local development:
27
+
28
+ ```bash
29
+ pip install -e .[dev]
25
30
  ```
26
31
 
27
32
  ## Quick start
@@ -70,7 +75,7 @@ Run a worker:
70
75
  grindsharp worker --app jobs:jobs --db jobs.db
71
76
  ```
72
77
 
73
- That’s it: your web request returns quickly, and the worker handles the job.
78
+ That's it: your web request returns quickly, and the worker handles the job.
74
79
 
75
80
  ## FastAPI example
76
81
 
@@ -101,10 +106,10 @@ grindsharp worker --app app:jobs --db jobs.db
101
106
  ## How jobs behave
102
107
 
103
108
  - **Durable:** jobs are saved in SQLite, so they survive app restarts.
104
- - **At-least-once:** if a worker crashes mid-job, that job might run again. So write tasks like they may be retried (because they might).
109
+ - **At-least-once:** if a worker crashes mid-job, that job might run again. Write tasks so they're safe to retry.
105
110
  - **Retries:** failed jobs retry with backoff (`retry_backoff_seconds * attempt`).
106
111
  - **Timeouts:** if a task sets `timeout_seconds`, the worker marks it as timed out/failed when that limit passes (then it retries or goes dead like any other failure). A stuck Python thread may still keep running in-process, so task code should still respect timeouts/cancellation where it can.
107
- - **Dead jobs:** when retries run out, the job gets marked `dead` and keeps the last error so you can see what happened.
112
+ - **Dead jobs:** when retries run out, the job gets marked `dead` and keeps the last error.
108
113
  - **Crash recovery:** stale `running` jobs get moved back to `pending` after a timeout.
109
114
 
110
115
  ## CLI
@@ -132,23 +137,6 @@ grindsharp --db jobs.db purge --status succeeded --older-than-seconds 86400
132
137
 
133
138
  When you run `grindsharp worker` from the CLI, it handles SIGINT/SIGTERM and stops gracefully.
134
139
 
135
- ## When Grindsharp is a good fit
136
-
137
- Use it when you want background jobs without extra infrastructure:
138
-
139
- - small/medium web apps
140
- - internal tools and SaaS MVPs
141
- - single-server deployments
142
- - low-to-moderate job volume
143
-
144
- ## When to use something else
145
-
146
- - you need lots of workers spread across many machines
147
- - you already run Redis/RabbitMQ and need the fancy queue features
148
- - you need complex workflow/DAG orchestration
149
-
150
- For many apps, a Postgres/Redis-backed queue is the next step up. Grindsharp is here to make the simple case easy.
151
-
152
140
  ## Postgres / Redis backends
153
141
 
154
142
  SQLite is the default. When you outgrow a single-node setup, Grindsharp can use a different store:
@@ -165,15 +153,26 @@ jobs = Jobs(store=RedisJobStore(redis.Redis.from_url(REDIS_URL)))
165
153
 
166
154
  These adapters keep the same `Jobs`/`Worker` API. Use SQLite for simple/local apps, Postgres for durable multi-worker SQL setups, and Redis for fast queue-style workloads.
167
155
 
156
+ ## When to use Grindsharp
157
+
158
+ Good fit:
159
+
160
+ - small/medium web apps
161
+ - internal tools and SaaS MVPs
162
+ - single-server deployments
163
+ - low-to-moderate job volume
164
+
165
+ Not the right fit:
166
+
167
+ - lots of workers spread across many machines
168
+ - you already run Redis/RabbitMQ and need advanced queue features
169
+ - complex workflow/DAG orchestration
170
+
168
171
  ## Design notes
169
172
 
170
173
  - Jobs are **at-least-once** (tasks should be idempotent).
171
174
  - Payloads must be **JSON-serializable**.
172
- - SQLite makes this a great fit for **small/medium single-node apps**. When you need distributed throughput, grow to a Postgres/Redis-style queue.
173
-
174
- ## Version 0.1.1
175
-
176
- Small production-hardening pass: worker timeout enforcement, graceful SIGINT/SIGTERM shutdown in the CLI worker, CI/release workflows, and tighter packaging/lint/test setup.
175
+ - SQLite is great for small/medium single-node apps. When you need distributed throughput, move to a Postgres/Redis-style queue.
177
176
 
178
177
  ## Development
179
178
 
@@ -191,3 +190,7 @@ python scripts/integration_test_backends.py
191
190
  ```
192
191
 
193
192
  This runs the same enqueue/retry/dead-job flow against real Postgres and Redis services.
193
+
194
+ ## License
195
+
196
+ MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "grindsharp"
7
- version = "0.1.1"
7
+ version = "0.1.2"
8
8
  description = "SQLite-first background jobs for Python. No Redis required."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -20,4 +20,4 @@ __all__ = [
20
20
  "InvalidTask",
21
21
  ]
22
22
 
23
- __version__ = "0.1.1"
23
+ __version__ = "0.1.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: grindsharp
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: SQLite-first background jobs for Python. No Redis required.
5
5
  Author: GT47THY
6
6
  License: MIT
@@ -24,28 +24,33 @@ Dynamic: license-file
24
24
 
25
25
  # Grindsharp
26
26
 
27
- Most Python apps eventually need to do stuff in the background: send an email, process an upload, call a webhook, generate a report, retry something that flopped.
27
+ SQLite-first background jobs for Python. No Redis required.
28
28
 
29
- The usual setup works, but it can be overkill for a small app — Redis, a broker, worker containers, extra config, the whole mission.
29
+ Most Python apps eventually need to do stuff in the background: send an email, process an upload, call a webhook, generate a report, retry something that flopped. The usual setup works, but it can be overkill for a small app - Redis, a broker, worker containers, extra config.
30
30
 
31
31
  Grindsharp is for the common case: you just want background jobs that are reliable and easy to run.
32
32
 
33
- It uses **SQLite** by default. No Redis needed.
33
+ ## Features
34
34
 
35
- ## What you get
36
-
37
- - A simple `@task` decorator
35
+ - Simple `@task` decorator
38
36
  - `enqueue()`, `enqueue_in()`, `enqueue_at()`
39
37
  - Retries with backoff
40
- - A worker process (with basic concurrency)
38
+ - Worker process with basic concurrency
41
39
  - SQLite-backed job storage (WAL mode)
42
40
  - Job status, crash recovery, and idempotent job IDs
43
- - A small CLI for listing/retrying/stats
41
+ - Small CLI for listing/retrying/stats
42
+ - Optional Postgres/Redis store adapters
44
43
 
45
44
  ## Install
46
45
 
47
46
  ```bash
48
- pip install -e .
47
+ pip install grindsharp
48
+ ```
49
+
50
+ For local development:
51
+
52
+ ```bash
53
+ pip install -e .[dev]
49
54
  ```
50
55
 
51
56
  ## Quick start
@@ -94,7 +99,7 @@ Run a worker:
94
99
  grindsharp worker --app jobs:jobs --db jobs.db
95
100
  ```
96
101
 
97
- That’s it: your web request returns quickly, and the worker handles the job.
102
+ That's it: your web request returns quickly, and the worker handles the job.
98
103
 
99
104
  ## FastAPI example
100
105
 
@@ -125,10 +130,10 @@ grindsharp worker --app app:jobs --db jobs.db
125
130
  ## How jobs behave
126
131
 
127
132
  - **Durable:** jobs are saved in SQLite, so they survive app restarts.
128
- - **At-least-once:** if a worker crashes mid-job, that job might run again. So write tasks like they may be retried (because they might).
133
+ - **At-least-once:** if a worker crashes mid-job, that job might run again. Write tasks so they're safe to retry.
129
134
  - **Retries:** failed jobs retry with backoff (`retry_backoff_seconds * attempt`).
130
135
  - **Timeouts:** if a task sets `timeout_seconds`, the worker marks it as timed out/failed when that limit passes (then it retries or goes dead like any other failure). A stuck Python thread may still keep running in-process, so task code should still respect timeouts/cancellation where it can.
131
- - **Dead jobs:** when retries run out, the job gets marked `dead` and keeps the last error so you can see what happened.
136
+ - **Dead jobs:** when retries run out, the job gets marked `dead` and keeps the last error.
132
137
  - **Crash recovery:** stale `running` jobs get moved back to `pending` after a timeout.
133
138
 
134
139
  ## CLI
@@ -156,23 +161,6 @@ grindsharp --db jobs.db purge --status succeeded --older-than-seconds 86400
156
161
 
157
162
  When you run `grindsharp worker` from the CLI, it handles SIGINT/SIGTERM and stops gracefully.
158
163
 
159
- ## When Grindsharp is a good fit
160
-
161
- Use it when you want background jobs without extra infrastructure:
162
-
163
- - small/medium web apps
164
- - internal tools and SaaS MVPs
165
- - single-server deployments
166
- - low-to-moderate job volume
167
-
168
- ## When to use something else
169
-
170
- - you need lots of workers spread across many machines
171
- - you already run Redis/RabbitMQ and need the fancy queue features
172
- - you need complex workflow/DAG orchestration
173
-
174
- For many apps, a Postgres/Redis-backed queue is the next step up. Grindsharp is here to make the simple case easy.
175
-
176
164
  ## Postgres / Redis backends
177
165
 
178
166
  SQLite is the default. When you outgrow a single-node setup, Grindsharp can use a different store:
@@ -189,15 +177,26 @@ jobs = Jobs(store=RedisJobStore(redis.Redis.from_url(REDIS_URL)))
189
177
 
190
178
  These adapters keep the same `Jobs`/`Worker` API. Use SQLite for simple/local apps, Postgres for durable multi-worker SQL setups, and Redis for fast queue-style workloads.
191
179
 
180
+ ## When to use Grindsharp
181
+
182
+ Good fit:
183
+
184
+ - small/medium web apps
185
+ - internal tools and SaaS MVPs
186
+ - single-server deployments
187
+ - low-to-moderate job volume
188
+
189
+ Not the right fit:
190
+
191
+ - lots of workers spread across many machines
192
+ - you already run Redis/RabbitMQ and need advanced queue features
193
+ - complex workflow/DAG orchestration
194
+
192
195
  ## Design notes
193
196
 
194
197
  - Jobs are **at-least-once** (tasks should be idempotent).
195
198
  - Payloads must be **JSON-serializable**.
196
- - SQLite makes this a great fit for **small/medium single-node apps**. When you need distributed throughput, grow to a Postgres/Redis-style queue.
197
-
198
- ## Version 0.1.1
199
-
200
- Small production-hardening pass: worker timeout enforcement, graceful SIGINT/SIGTERM shutdown in the CLI worker, CI/release workflows, and tighter packaging/lint/test setup.
199
+ - SQLite is great for small/medium single-node apps. When you need distributed throughput, move to a Postgres/Redis-style queue.
201
200
 
202
201
  ## Development
203
202
 
@@ -215,3 +214,7 @@ python scripts/integration_test_backends.py
215
214
  ```
216
215
 
217
216
  This runs the same enqueue/retry/dead-job flow against real Postgres and Redis services.
217
+
218
+ ## License
219
+
220
+ MIT
File without changes
File without changes