dbos 0.28.0a1__py3-none-any.whl → 0.28.0a6__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.
- dbos/_admin_server.py +3 -3
- dbos/_client.py +17 -9
- dbos/_conductor/conductor.py +1 -5
- dbos/_conductor/protocol.py +1 -1
- dbos/_context.py +26 -9
- dbos/_core.py +3 -8
- dbos/_dbos.py +14 -18
- dbos/_fastapi.py +2 -23
- dbos/_flask.py +3 -37
- dbos/_migrations/versions/933e86bdac6a_add_queue_priority.py +35 -0
- dbos/_recovery.py +1 -1
- dbos/_schemas/system_database.py +6 -1
- dbos/_sys_db.py +60 -61
- dbos/_utils.py +9 -0
- dbos/_workflow_commands.py +4 -8
- dbos/cli/cli.py +9 -0
- dbos-0.28.0a6.dist-info/METADATA +312 -0
- {dbos-0.28.0a1.dist-info → dbos-0.28.0a6.dist-info}/RECORD +21 -21
- dbos/_request.py +0 -35
- dbos-0.28.0a1.dist-info/METADATA +0 -144
- {dbos-0.28.0a1.dist-info → dbos-0.28.0a6.dist-info}/WHEEL +0 -0
- {dbos-0.28.0a1.dist-info → dbos-0.28.0a6.dist-info}/entry_points.txt +0 -0
- {dbos-0.28.0a1.dist-info → dbos-0.28.0a6.dist-info}/licenses/LICENSE +0 -0
@@ -1,26 +1,26 @@
|
|
1
|
-
dbos-0.28.
|
2
|
-
dbos-0.28.
|
3
|
-
dbos-0.28.
|
4
|
-
dbos-0.28.
|
1
|
+
dbos-0.28.0a6.dist-info/METADATA,sha256=EtDjmsRZNSxN7U8Yv-ifyxQjawPTEKkL-wylJYH6e4c,13268
|
2
|
+
dbos-0.28.0a6.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
3
|
+
dbos-0.28.0a6.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
|
4
|
+
dbos-0.28.0a6.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
|
5
5
|
dbos/__init__.py,sha256=-FdBlOlr-f2tY__C23J4v22MoCAXqcDN_-zXsJXdoZ0,1005
|
6
6
|
dbos/__main__.py,sha256=G7Exn-MhGrVJVDbgNlpzhfh8WMX_72t3_oJaFT9Lmt8,653
|
7
|
-
dbos/_admin_server.py,sha256=
|
7
|
+
dbos/_admin_server.py,sha256=CM02jyC9H21fM7Pjn1BhPxNwAOV7CXmMJd0SdaNq8dQ,9062
|
8
8
|
dbos/_app_db.py,sha256=3j8_5-MlSDY0otLRszFE-GfenU6JC20fcfSL-drSNYk,11800
|
9
9
|
dbos/_classproperty.py,sha256=f0X-_BySzn3yFDRKB2JpCbLYQ9tLwt1XftfshvY7CBs,626
|
10
|
-
dbos/_client.py,sha256=
|
11
|
-
dbos/_conductor/conductor.py,sha256=
|
12
|
-
dbos/_conductor/protocol.py,sha256=
|
13
|
-
dbos/_context.py,sha256=
|
14
|
-
dbos/_core.py,sha256=
|
10
|
+
dbos/_client.py,sha256=mGrricoU6437QM4SWV-6Vm806AgVru8ygKgGgK1LZGA,13823
|
11
|
+
dbos/_conductor/conductor.py,sha256=mWOHBzSvwHa4YTere8za90rDRspCvin4CWGQ1tHtZ00,16646
|
12
|
+
dbos/_conductor/protocol.py,sha256=jwX8ZjmAIlXu1vw9R3b5PfHSNdwofeYOKj8rkfAFVg0,6630
|
13
|
+
dbos/_context.py,sha256=Ly1CXF1nWxICQgIpDZSaONGlz1yERBs63gqmR-yqCzM,24476
|
14
|
+
dbos/_core.py,sha256=UDpSgRA9m_YuViNXR9tVgNFLC-zxKZPxjlkj2a-Kj00,48317
|
15
15
|
dbos/_croniter.py,sha256=XHAyUyibs_59sJQfSNWkP7rqQY6_XrlfuuCxk4jYqek,47559
|
16
|
-
dbos/_dbos.py,sha256=
|
16
|
+
dbos/_dbos.py,sha256=nne4oaIEC0tR2OV766y7mjTLjGaqKz7EnuY-T2CbTtc,48431
|
17
17
|
dbos/_dbos_config.py,sha256=L0Z0OOB5FoPM9g-joZqXGeJnlxWQsEUtgPtgtg9Uf48,21732
|
18
18
|
dbos/_debug.py,sha256=MNlQVZ6TscGCRQeEEL0VE8Uignvr6dPeDDDefS3xgIE,1823
|
19
19
|
dbos/_docker_pg_helper.py,sha256=NmcgqmR5rQA_4igfeqh8ugNT2z3YmoOvuep_MEtxTiY,5854
|
20
20
|
dbos/_error.py,sha256=EN4eVBjMT3k7O7hfqJl6mIf4sxWPsiAOM086yhcGH_g,8012
|
21
21
|
dbos/_event_loop.py,sha256=NmaLbEQFfEK36S_0KhVD39YdYrGce3qSKCTJ-5RqKQ0,2136
|
22
|
-
dbos/_fastapi.py,sha256=
|
23
|
-
dbos/_flask.py,sha256=
|
22
|
+
dbos/_fastapi.py,sha256=m4SL3H9P-NBQ_ZrbFxAWMOqNyIi3HGEn2ODR7xAK038,3118
|
23
|
+
dbos/_flask.py,sha256=Npnakt-a3W5OykONFRkDRnumaDhTQmA0NPdUCGRYKXE,1652
|
24
24
|
dbos/_kafka.py,sha256=pz0xZ9F3X9Ky1k-VSbeF3tfPhP3UPr3lUUhUfE41__U,4198
|
25
25
|
dbos/_kafka_message.py,sha256=NYvOXNG3Qn7bghn1pv3fg4Pbs86ILZGcK4IB-MLUNu0,409
|
26
26
|
dbos/_logger.py,sha256=qv2srteCF2rSRjCK1VGOck3ieIkwUe9Lvbv60mJc16E,4069
|
@@ -31,6 +31,7 @@ dbos/_migrations/versions/27ac6900c6ad_add_queue_dedup.py,sha256=56w1v6TdofW3V18
|
|
31
31
|
dbos/_migrations/versions/50f3227f0b4b_fix_job_queue.py,sha256=ZBYrtTdxy64HxIAlOes89fVIk2P1gNaJack7wuC_epg,873
|
32
32
|
dbos/_migrations/versions/5c361fc04708_added_system_tables.py,sha256=Xr9hBDJjkAtymlauOmAy00yUHj0VVUaEz7kNwEM9IwE,6403
|
33
33
|
dbos/_migrations/versions/83f3732ae8e7_workflow_timeout.py,sha256=Q_R35pb8AfVI3sg5mzKwyoPfYB88Ychcc8gwxpM9R7A,1035
|
34
|
+
dbos/_migrations/versions/933e86bdac6a_add_queue_priority.py,sha256=yZX2kGF33skpXIBdMXtDNx-Nl_orFatKeHB8c-3K8-c,773
|
34
35
|
dbos/_migrations/versions/a3b18ad34abe_added_triggers.py,sha256=Rv0ZsZYZ_WdgGEULYsPfnp4YzaO5L198gDTgYY39AVA,2022
|
35
36
|
dbos/_migrations/versions/d76646551a6b_job_queue_limiter.py,sha256=8PyFi8rd6CN-mUro43wGhsg5wcQWKZPRHD6jw8R5pVc,986
|
36
37
|
dbos/_migrations/versions/d76646551a6c_workflow_queue.py,sha256=G942nophZ2uC2vc4hGBC02Ptng1715roTjY3xiyzZU4,729
|
@@ -38,16 +39,15 @@ dbos/_migrations/versions/eab0cc1d9a14_job_queue.py,sha256=uvhFOtqbBreCePhAxZfIT
|
|
38
39
|
dbos/_migrations/versions/f4b9b32ba814_functionname_childid_op_outputs.py,sha256=m90Lc5YH0ZISSq1MyxND6oq3RZrZKrIqEsZtwJ1jWxA,1049
|
39
40
|
dbos/_outcome.py,sha256=EXxBg4jXCVJsByDQ1VOCIedmbeq_03S6d-p1vqQrLFU,6810
|
40
41
|
dbos/_queue.py,sha256=aKCGahWBGJOLOv5PCOOId96Va3YQ4ICuHWXy-eQXohE,3526
|
41
|
-
dbos/_recovery.py,sha256=
|
42
|
+
dbos/_recovery.py,sha256=jVMexjfCCNopzyn8gVQzJCmGJaP9G3C1EFaoCQ_Nh7g,2564
|
42
43
|
dbos/_registrations.py,sha256=EZzG3ZfYmWA2bHX2hpnSIQ3PTi3-cXsvbcmXjyOusMk,7302
|
43
|
-
dbos/_request.py,sha256=cX1B3Atlh160phgS35gF1VEEV4pD126c9F3BDgBmxZU,929
|
44
44
|
dbos/_roles.py,sha256=iOsgmIAf1XVzxs3gYWdGRe1B880YfOw5fpU7Jwx8_A8,2271
|
45
45
|
dbos/_scheduler.py,sha256=SR1oRZRcVzYsj-JauV2LA8JtwTkt8mru7qf6H1AzQ1U,2027
|
46
46
|
dbos/_schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
47
47
|
dbos/_schemas/application_database.py,sha256=SypAS9l9EsaBHFn9FR8jmnqt01M74d9AF1AMa4m2hhI,1040
|
48
|
-
dbos/_schemas/system_database.py,sha256=
|
48
|
+
dbos/_schemas/system_database.py,sha256=3Z0L72bOgHnusK1hBaETWU9RfiLBP0QnS-fdu41i0yY,5835
|
49
49
|
dbos/_serialization.py,sha256=bWuwhXSQcGmiazvhJHA5gwhrRWxtmFmcCFQSDJnqqkU,3666
|
50
|
-
dbos/_sys_db.py,sha256=
|
50
|
+
dbos/_sys_db.py,sha256=GjRTrN64jUMNUnEhLSkqGMiwJWOZhB9WFeuihJs35aM,82163
|
51
51
|
dbos/_templates/dbos-db-starter/README.md,sha256=GhxhBj42wjTt1fWEtwNriHbJuKb66Vzu89G4pxNHw2g,930
|
52
52
|
dbos/_templates/dbos-db-starter/__package/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
53
53
|
dbos/_templates/dbos-db-starter/__package/main.py,sha256=nJMN3ZD2lmwg4Dcgmiwqc-tQGuCJuJal2Xl85iA277U,2453
|
@@ -59,12 +59,12 @@ dbos/_templates/dbos-db-starter/migrations/script.py.mako,sha256=MEqL-2qATlST9TA
|
|
59
59
|
dbos/_templates/dbos-db-starter/migrations/versions/2024_07_31_180642_init.py,sha256=MpS7LGaJS0CpvsjhfDkp9EJqvMvVCjRPfUp4c0aE2ys,941
|
60
60
|
dbos/_templates/dbos-db-starter/start_postgres_docker.py,sha256=lQVLlYO5YkhGPEgPqwGc7Y8uDKse9HsWv5fynJEFJHM,1681
|
61
61
|
dbos/_tracer.py,sha256=yN6GRDKu_1p-EqtQLNarMocPfga2ZuqpzStzzSPYhzo,2732
|
62
|
-
dbos/_utils.py,sha256=
|
63
|
-
dbos/_workflow_commands.py,sha256=
|
62
|
+
dbos/_utils.py,sha256=UbpMYRBSyvJqdXeWAnfSw8xXM1R1mfnyl1oTunhEjJM,513
|
63
|
+
dbos/_workflow_commands.py,sha256=2E8FRUv_nLYkpBTwfhh_ELhySYpMrm8qGB9J44g6DSE,3872
|
64
64
|
dbos/cli/_github_init.py,sha256=Y_bDF9gfO2jB1id4FV5h1oIxEJRWyqVjhb7bNEa5nQ0,3224
|
65
65
|
dbos/cli/_template_init.py,sha256=-WW3kbq0W_Tq4WbMqb1UGJG3xvJb3woEY5VspG95Srk,2857
|
66
|
-
dbos/cli/cli.py,sha256=
|
66
|
+
dbos/cli/cli.py,sha256=gXKELYAK9_CTejQ-WbNEIqnEYByJndXHDYSX4naFg8g,19106
|
67
67
|
dbos/dbos-config.schema.json,sha256=8KcwJb_sQc4-6tQG2TLmjE_nratfrQa0qVLl9XPsvWE,6367
|
68
68
|
dbos/py.typed,sha256=QfzXT1Ktfk3Rj84akygc7_42z0lRpCq0Ilh8OXI6Zas,44
|
69
69
|
version/__init__.py,sha256=L4sNxecRuqdtSFdpUGX3TtBi9KL3k7YsZVIvv-fv9-A,1678
|
70
|
-
dbos-0.28.
|
70
|
+
dbos-0.28.0a6.dist-info/RECORD,,
|
dbos/_request.py
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
from dataclasses import dataclass
|
2
|
-
from typing import Any, Mapping, NamedTuple, Optional
|
3
|
-
|
4
|
-
request_id_header = "x-request-id"
|
5
|
-
|
6
|
-
|
7
|
-
class Address(NamedTuple):
|
8
|
-
hostname: str
|
9
|
-
port: int
|
10
|
-
|
11
|
-
|
12
|
-
@dataclass
|
13
|
-
class Request:
|
14
|
-
"""
|
15
|
-
Serializable HTTP Request object.
|
16
|
-
|
17
|
-
Attributes:
|
18
|
-
base_url(str): Base of URL requested, as in application code
|
19
|
-
client(Optional[Address]): HTTP Client
|
20
|
-
cookies(Mapping[str, str]): HTTP Cookies
|
21
|
-
headers(Mapping[str, str]): HTTP headers
|
22
|
-
method(str): HTTP verb
|
23
|
-
path_params(Mapping[str, Any]): Parameters extracted from URL path sections
|
24
|
-
query_params(Mapping[str, str]): URL query string parameters
|
25
|
-
url(str): Full URL accessed
|
26
|
-
"""
|
27
|
-
|
28
|
-
headers: Mapping[str, str]
|
29
|
-
path_params: Mapping[str, Any]
|
30
|
-
query_params: Mapping[str, str]
|
31
|
-
url: str
|
32
|
-
base_url: str
|
33
|
-
client: Optional[Address]
|
34
|
-
cookies: Mapping[str, str]
|
35
|
-
method: str
|
dbos-0.28.0a1.dist-info/METADATA
DELETED
@@ -1,144 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: dbos
|
3
|
-
Version: 0.28.0a1
|
4
|
-
Summary: Ultra-lightweight durable execution in Python
|
5
|
-
Author-Email: "DBOS, Inc." <contact@dbos.dev>
|
6
|
-
License: MIT
|
7
|
-
Requires-Python: >=3.9
|
8
|
-
Requires-Dist: pyyaml>=6.0.2
|
9
|
-
Requires-Dist: jsonschema>=4.23.0
|
10
|
-
Requires-Dist: alembic>=1.13.3
|
11
|
-
Requires-Dist: typing-extensions>=4.12.2; python_version < "3.10"
|
12
|
-
Requires-Dist: typer>=0.12.5
|
13
|
-
Requires-Dist: jsonpickle>=3.3.0
|
14
|
-
Requires-Dist: opentelemetry-api>=1.27.0
|
15
|
-
Requires-Dist: opentelemetry-sdk>=1.27.0
|
16
|
-
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.27.0
|
17
|
-
Requires-Dist: python-dateutil>=2.9.0.post0
|
18
|
-
Requires-Dist: fastapi[standard]>=0.115.2
|
19
|
-
Requires-Dist: tomlkit>=0.13.2
|
20
|
-
Requires-Dist: psycopg[binary]>=3.1
|
21
|
-
Requires-Dist: docker>=7.1.0
|
22
|
-
Requires-Dist: cryptography>=43.0.3
|
23
|
-
Requires-Dist: rich>=13.9.4
|
24
|
-
Requires-Dist: pyjwt>=2.10.1
|
25
|
-
Requires-Dist: websockets>=15.0
|
26
|
-
Description-Content-Type: text/markdown
|
27
|
-
|
28
|
-
|
29
|
-
<div align="center">
|
30
|
-
|
31
|
-
# DBOS Transact: A Lightweight Durable Execution Library Built on Postgres
|
32
|
-
|
33
|
-
#### [Documentation](https://docs.dbos.dev/) • [Examples](https://docs.dbos.dev/examples) • [Github](https://github.com/dbos-inc) • [Discord](https://discord.com/invite/jsmC6pXGgX)
|
34
|
-
</div>
|
35
|
-
|
36
|
-
---
|
37
|
-
|
38
|
-
DBOS Transact is a Python library for **ultra-lightweight durable execution**.
|
39
|
-
For example:
|
40
|
-
|
41
|
-
```python
|
42
|
-
@DBOS.step()
|
43
|
-
def step_one():
|
44
|
-
...
|
45
|
-
|
46
|
-
@DBOS.step()
|
47
|
-
def step_two():
|
48
|
-
...
|
49
|
-
|
50
|
-
@DBOS.workflow()
|
51
|
-
def workflow()
|
52
|
-
step_one()
|
53
|
-
step_two()
|
54
|
-
```
|
55
|
-
|
56
|
-
Durable execution means your program is **resilient to any failure**.
|
57
|
-
If it is ever interrupted or crashes, all your workflows will automatically resume from the last completed step.
|
58
|
-
Durable execution helps solve many common problems:
|
59
|
-
|
60
|
-
- Orchestrating long-running or business-critical workflows so they seamlessly recover from any failure.
|
61
|
-
- Running reliable background jobs with no timeouts.
|
62
|
-
- Processing incoming events (e.g. from Kafka) exactly once.
|
63
|
-
- Running a fault-tolerant distributed task queue.
|
64
|
-
- Running a reliable cron scheduler.
|
65
|
-
- Operating an AI agent, or anything that connects to an unreliable or non-deterministic API.
|
66
|
-
|
67
|
-
What’s unique about DBOS's implementation of durable execution is that it’s implemented in a **lightweight library** that’s **totally backed by Postgres**.
|
68
|
-
To use DBOS, just `pip install` it and annotate your program with DBOS decorators.
|
69
|
-
Under the hood, those decorators store your program's execution state (which workflows are currently executing and which steps they've completed) in a Postgres database.
|
70
|
-
If your program crashes or is interrupted, they automatically recover its workflows from their stored state.
|
71
|
-
So all you need to use DBOS is Postgres—there are no other dependencies you have to manage, no separate workflow server.
|
72
|
-
|
73
|
-
One big advantage of this approach is that you can add DBOS to **any** Python application—**it’s just a library**.
|
74
|
-
You can use DBOS to add reliable background jobs or cron scheduling or queues to your app with no external dependencies except Postgres.
|
75
|
-
|
76
|
-
## Getting Started
|
77
|
-
|
78
|
-
Install and configure with:
|
79
|
-
|
80
|
-
```shell
|
81
|
-
python3 -m venv dbos-example/.venv
|
82
|
-
cd dbos-example
|
83
|
-
source .venv/bin/activate
|
84
|
-
pip install dbos
|
85
|
-
dbos init --config
|
86
|
-
```
|
87
|
-
|
88
|
-
Then, try it out with this simple program:
|
89
|
-
|
90
|
-
```python
|
91
|
-
from fastapi import FastAPI
|
92
|
-
from dbos import DBOS
|
93
|
-
|
94
|
-
app = FastAPI()
|
95
|
-
DBOS(fastapi=app)
|
96
|
-
|
97
|
-
@DBOS.step()
|
98
|
-
def step_one():
|
99
|
-
print("Step one completed!")
|
100
|
-
|
101
|
-
@DBOS.step()
|
102
|
-
def step_two():
|
103
|
-
print("Step two completed!")
|
104
|
-
|
105
|
-
@DBOS.workflow()
|
106
|
-
def dbos_workflow():
|
107
|
-
step_one()
|
108
|
-
for _ in range(5):
|
109
|
-
print("Press Control + C twice to stop the app...")
|
110
|
-
DBOS.sleep(1)
|
111
|
-
step_two()
|
112
|
-
|
113
|
-
@app.get("/")
|
114
|
-
def fastapi_endpoint():
|
115
|
-
dbos_workflow()
|
116
|
-
```
|
117
|
-
|
118
|
-
Save the program into `main.py` and start it with `fastapi run`.
|
119
|
-
Visit `localhost:8000` in your browser to start the workflow.
|
120
|
-
When prompted, press `Control + C` (You may need to press `Control + C` twice quickly, or press `Control + \`, if `Control + C` is not effective in your environment) to force quit your application.
|
121
|
-
It should crash midway through the workflow, having completed step one but not step two.
|
122
|
-
Then, restart your app with `fastapi run`.
|
123
|
-
It should resume the workflow from where it left off, completing step two without re-executing step one.
|
124
|
-
|
125
|
-
To learn how to build more complex workflows, see the [programming guide](https://docs.dbos.dev/python/programming-guide) or [examples](https://docs.dbos.dev/examples).
|
126
|
-
|
127
|
-
## Documentation
|
128
|
-
|
129
|
-
[https://docs.dbos.dev](https://docs.dbos.dev)
|
130
|
-
|
131
|
-
## Examples
|
132
|
-
|
133
|
-
|
134
|
-
- [**AI-Powered Slackbot**](https://docs.dbos.dev/python/examples/rag-slackbot) — A Slackbot that answers questions about previous Slack conversations, using DBOS to durably orchestrate its RAG pipeline.
|
135
|
-
- [**Widget Store**](https://docs.dbos.dev/python/examples/widget-store) — An online storefront that uses DBOS durable workflows to be resilient to any failure.
|
136
|
-
- [**Scheduled Reminders**](https://docs.dbos.dev/python/examples/scheduled-reminders) — In just three lines of code, schedule an email to send days, weeks, or months in the future.
|
137
|
-
|
138
|
-
More examples [here](https://docs.dbos.dev/examples)!
|
139
|
-
|
140
|
-
## Community
|
141
|
-
|
142
|
-
If you're interested in building with us, please star our repository and join our community on [Discord](https://discord.gg/fMwQjeW5zg)!
|
143
|
-
If you see a bug or have a feature request, don't hesitate to open an issue here on GitHub.
|
144
|
-
If you're interested in contributing, check out our [contributions guide](./CONTRIBUTING.md).
|
File without changes
|
File without changes
|
File without changes
|