drkm 0.0.0.dev0__tar.gz → 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.
drkm-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,97 @@
1
+ Metadata-Version: 2.5
2
+ Name: drkm
3
+ Version: 0.1.0
4
+ Summary: Python SDK for Darkmatter: durable jobs, Broom fleet pipelines, fleet discovery and sandbox tools.
5
+ Project-URL: Homepage, https://drkm.ai
6
+ Project-URL: Documentation, https://drkm.ai/docs/python-sdk
7
+ Author: Darkmatter
8
+ License-Expression: LicenseRef-Proprietary
9
+ License-File: LICENSE
10
+ Classifier: License :: Other/Proprietary License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Typing :: Typed
17
+ Requires-Python: >=3.12
18
+ Requires-Dist: pydantic>=2.13
19
+ Provides-Extra: keyring
20
+ Requires-Dist: keyring>=25.6; extra == 'keyring'
21
+ Description-Content-Type: text/markdown
22
+
23
+ # drkm
24
+
25
+ Python SDK for [Darkmatter](https://drkm.ai): submit durable jobs, build distributed
26
+ Broom model and data pipelines (`drkm.broom`), inspect your fleet of isotopes, and call
27
+ platform tools inside an agent sandbox.
28
+
29
+ ## Install
30
+
31
+ Requires Python 3.12 or later.
32
+
33
+ ```bash
34
+ pip install drkm
35
+ ```
36
+
37
+ To reuse credentials stored in your OS keyring by `drkm console login`, install with
38
+ the `keyring` extra:
39
+
40
+ ```bash
41
+ pip install "drkm[keyring]"
42
+ ```
43
+
44
+ For automation without a keyring, pass `token=` or set `DRKM_TOKEN` from your secret
45
+ manager at runtime.
46
+
47
+ ## Connect and submit a job
48
+
49
+ Inside an agent sandbox, `import drkm` talks to the sandbox bridge with no connection
50
+ step. From a laptop, script, or CI, call `drkm.connect()` first:
51
+
52
+ ```python
53
+ import drkm
54
+
55
+ # Reuse the active `drkm console login` profile, or set DRKM_URL / DRKM_TOKEN
56
+ drkm.connect()
57
+
58
+ # Or name an isotope and API key explicitly
59
+ # drkm.connect("https://isotope.example", token="drkm_ak_...")
60
+
61
+ print(drkm.isotopes())
62
+
63
+ worker = drkm.package("worker.py:run", ["worker.py"])
64
+ job_id = drkm.submit(
65
+ worker,
66
+ inputs=[{"id": "sensor-a", "data": {"temperature": 86}}],
67
+ name="Check sensor temperatures",
68
+ )
69
+ drkm.wait(job_id)
70
+ print(drkm.rows(job_id))
71
+ ```
72
+
73
+ ## Broom pipelines (`drkm.broom`)
74
+
75
+ Build multi-stage pipelines combining data transforms, catalog detectors, local model
76
+ completions, and per-row Python workloads placed across your fleet:
77
+
78
+ ```python
79
+ from drkm.broom import F, connect, lineage, sources
80
+
81
+ broom = connect()
82
+ labelled = broom.read(sources.rows([{"line": "Failed password for invalid user admin"}])).complete(
83
+ "qwen3-4b",
84
+ F.concat(F.lit("Log line: "), "line"),
85
+ system="Answer with one word: attack, admin or other.",
86
+ max_tokens=4,
87
+ output="label",
88
+ )
89
+ labelled.explain()
90
+ job = labelled.run()
91
+ for row in job.rows:
92
+ print(row["label"], lineage(row).describe())
93
+ ```
94
+
95
+ ## Documentation
96
+
97
+ Full guides and API reference: [https://drkm.ai/docs/python-sdk](https://drkm.ai/docs/python-sdk)
drkm-0.1.0/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # drkm
2
+
3
+ Python SDK for [Darkmatter](https://drkm.ai): submit durable jobs, build distributed
4
+ Broom model and data pipelines (`drkm.broom`), inspect your fleet of isotopes, and call
5
+ platform tools inside an agent sandbox.
6
+
7
+ ## Install
8
+
9
+ Requires Python 3.12 or later.
10
+
11
+ ```bash
12
+ pip install drkm
13
+ ```
14
+
15
+ To reuse credentials stored in your OS keyring by `drkm console login`, install with
16
+ the `keyring` extra:
17
+
18
+ ```bash
19
+ pip install "drkm[keyring]"
20
+ ```
21
+
22
+ For automation without a keyring, pass `token=` or set `DRKM_TOKEN` from your secret
23
+ manager at runtime.
24
+
25
+ ## Connect and submit a job
26
+
27
+ Inside an agent sandbox, `import drkm` talks to the sandbox bridge with no connection
28
+ step. From a laptop, script, or CI, call `drkm.connect()` first:
29
+
30
+ ```python
31
+ import drkm
32
+
33
+ # Reuse the active `drkm console login` profile, or set DRKM_URL / DRKM_TOKEN
34
+ drkm.connect()
35
+
36
+ # Or name an isotope and API key explicitly
37
+ # drkm.connect("https://isotope.example", token="drkm_ak_...")
38
+
39
+ print(drkm.isotopes())
40
+
41
+ worker = drkm.package("worker.py:run", ["worker.py"])
42
+ job_id = drkm.submit(
43
+ worker,
44
+ inputs=[{"id": "sensor-a", "data": {"temperature": 86}}],
45
+ name="Check sensor temperatures",
46
+ )
47
+ drkm.wait(job_id)
48
+ print(drkm.rows(job_id))
49
+ ```
50
+
51
+ ## Broom pipelines (`drkm.broom`)
52
+
53
+ Build multi-stage pipelines combining data transforms, catalog detectors, local model
54
+ completions, and per-row Python workloads placed across your fleet:
55
+
56
+ ```python
57
+ from drkm.broom import F, connect, lineage, sources
58
+
59
+ broom = connect()
60
+ labelled = broom.read(sources.rows([{"line": "Failed password for invalid user admin"}])).complete(
61
+ "qwen3-4b",
62
+ F.concat(F.lit("Log line: "), "line"),
63
+ system="Answer with one word: attack, admin or other.",
64
+ max_tokens=4,
65
+ output="label",
66
+ )
67
+ labelled.explain()
68
+ job = labelled.run()
69
+ for row in job.rows:
70
+ print(row["label"], lineage(row).describe())
71
+ ```
72
+
73
+ ## Documentation
74
+
75
+ Full guides and API reference: [https://drkm.ai/docs/python-sdk](https://drkm.ai/docs/python-sdk)