splime 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 (79) hide show
  1. splime-0.1.2/LICENSE +201 -0
  2. splime-0.1.2/NOTICE +8 -0
  3. splime-0.1.2/PKG-INFO +189 -0
  4. splime-0.1.2/README.md +137 -0
  5. splime-0.1.2/pyproject.toml +125 -0
  6. splime-0.1.2/setup.cfg +4 -0
  7. splime-0.1.2/src/spl/__init__.py +14 -0
  8. splime-0.1.2/src/spl/client.py +1364 -0
  9. splime-0.1.2/src/spl/core/__init__.py +23 -0
  10. splime-0.1.2/src/spl/core/common.py +350 -0
  11. splime-0.1.2/src/spl/core/entities/__init__.py +0 -0
  12. splime-0.1.2/src/spl/core/entities/adapter.py +210 -0
  13. splime-0.1.2/src/spl/core/entities/artifact.py +141 -0
  14. splime-0.1.2/src/spl/core/entities/control.py +45 -0
  15. splime-0.1.2/src/spl/core/entities/distribution.py +65 -0
  16. splime-0.1.2/src/spl/core/entities/function.py +254 -0
  17. splime-0.1.2/src/spl/core/entities/local_function.py +286 -0
  18. splime-0.1.2/src/spl/core/entities/misc.py +14 -0
  19. splime-0.1.2/src/spl/core/entities/module.py +88 -0
  20. splime-0.1.2/src/spl/core/entities/node.py +286 -0
  21. splime-0.1.2/src/spl/core/entities/node_function.py +79 -0
  22. splime-0.1.2/src/spl/core/entities/node_remote.py +295 -0
  23. splime-0.1.2/src/spl/core/entities/pipeline.py +436 -0
  24. splime-0.1.2/src/spl/core/entities/scalar.py +55 -0
  25. splime-0.1.2/src/spl/core/ir/__init__.py +0 -0
  26. splime-0.1.2/src/spl/core/ir/common.py +34 -0
  27. splime-0.1.2/src/spl/core/ir/parse.py +79 -0
  28. splime-0.1.2/src/spl/core/ir/unparse.py +29 -0
  29. splime-0.1.2/src/spl/core/ir/utils.py +163 -0
  30. splime-0.1.2/src/spl/daemon/__init__.py +23 -0
  31. splime-0.1.2/src/spl/daemon/__main__.py +11 -0
  32. splime-0.1.2/src/spl/daemon/cli.py +582 -0
  33. splime-0.1.2/src/spl/daemon/client.py +43 -0
  34. splime-0.1.2/src/spl/daemon/docker_environment.py +329 -0
  35. splime-0.1.2/src/spl/daemon/docker_pool.py +516 -0
  36. splime-0.1.2/src/spl/daemon/environment.py +228 -0
  37. splime-0.1.2/src/spl/daemon/environment_base.py +479 -0
  38. splime-0.1.2/src/spl/daemon/heartbeat_service.py +119 -0
  39. splime-0.1.2/src/spl/daemon/metadata.py +427 -0
  40. splime-0.1.2/src/spl/daemon/remote_client.py +457 -0
  41. splime-0.1.2/src/spl/daemon/repositories/__init__.py +17 -0
  42. splime-0.1.2/src/spl/daemon/repositories/env.py +323 -0
  43. splime-0.1.2/src/spl/daemon/repositories/library.py +181 -0
  44. splime-0.1.2/src/spl/daemon/repositories/object.py +997 -0
  45. splime-0.1.2/src/spl/daemon/repositories/run.py +279 -0
  46. splime-0.1.2/src/spl/daemon/repositories/server_connection.py +657 -0
  47. splime-0.1.2/src/spl/daemon/repositories/sync_event.py +129 -0
  48. splime-0.1.2/src/spl/daemon/routes/__init__.py +1 -0
  49. splime-0.1.2/src/spl/daemon/routes/_helpers.py +147 -0
  50. splime-0.1.2/src/spl/daemon/routes/artifacts.py +77 -0
  51. splime-0.1.2/src/spl/daemon/routes/diagnostics.py +114 -0
  52. splime-0.1.2/src/spl/daemon/routes/envs.py +82 -0
  53. splime-0.1.2/src/spl/daemon/routes/libraries.py +129 -0
  54. splime-0.1.2/src/spl/daemon/routes/objects.py +174 -0
  55. splime-0.1.2/src/spl/daemon/routes/remote.py +56 -0
  56. splime-0.1.2/src/spl/daemon/routes/runs.py +96 -0
  57. splime-0.1.2/src/spl/daemon/routes/server_connections.py +86 -0
  58. splime-0.1.2/src/spl/daemon/runtime_backend.py +368 -0
  59. splime-0.1.2/src/spl/daemon/runtime_config.py +133 -0
  60. splime-0.1.2/src/spl/daemon/runtime_dependencies.py +459 -0
  61. splime-0.1.2/src/spl/daemon/secret_store.py +187 -0
  62. splime-0.1.2/src/spl/daemon/server.py +2224 -0
  63. splime-0.1.2/src/spl/daemon/server_connection.py +267 -0
  64. splime-0.1.2/src/spl/daemon/services/__init__.py +1 -0
  65. splime-0.1.2/src/spl/daemon/services/sync.py +76 -0
  66. splime-0.1.2/src/spl/daemon/signature.py +376 -0
  67. splime-0.1.2/src/spl/daemon/storage_base.py +542 -0
  68. splime-0.1.2/src/spl/daemon/store.py +436 -0
  69. splime-0.1.2/src/spl/daemon/worker.py +526 -0
  70. splime-0.1.2/src/spl/daemon_client.py +945 -0
  71. splime-0.1.2/src/spl/pipeline_widget.py +1452 -0
  72. splime-0.1.2/src/spl/py.typed +0 -0
  73. splime-0.1.2/src/spl/server_client.py +787 -0
  74. splime-0.1.2/src/splime.egg-info/PKG-INFO +189 -0
  75. splime-0.1.2/src/splime.egg-info/SOURCES.txt +77 -0
  76. splime-0.1.2/src/splime.egg-info/dependency_links.txt +1 -0
  77. splime-0.1.2/src/splime.egg-info/entry_points.txt +2 -0
  78. splime-0.1.2/src/splime.egg-info/requires.txt +31 -0
  79. splime-0.1.2/src/splime.egg-info/top_level.txt +1 -0
splime-0.1.2/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Kirill Yastrebov
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
splime-0.1.2/NOTICE ADDED
@@ -0,0 +1,8 @@
1
+ splime
2
+ Copyright 2026 Kirill Yastrebov
3
+
4
+ This product includes software developed as part of the splime project
5
+ (https://splime.io).
6
+
7
+ Licensed under the Apache License, Version 2.0. You may obtain a copy of
8
+ the License at http://www.apache.org/licenses/LICENSE-2.0.
splime-0.1.2/PKG-INFO ADDED
@@ -0,0 +1,189 @@
1
+ Metadata-Version: 2.4
2
+ Name: splime
3
+ Version: 0.1.2
4
+ Summary: Reuse Python functions across projects without rewriting or redeploying them.
5
+ Author-email: Yastrebov Kirill <yastrebovks@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://splime.io
8
+ Project-URL: Documentation, https://splime.io
9
+ Project-URL: Repository, https://github.com/yastrebovks/splime
10
+ Project-URL: Issues, https://github.com/yastrebovks/splime/issues
11
+ Keywords: splime,spl,python,functions,reuse,nodes,pipeline,remote-execution,registry
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: Topic :: System :: Distributed Computing
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.13
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ License-File: NOTICE
24
+ Requires-Dist: pyyaml==6.0.3
25
+ Requires-Dist: keyring==25.7.0
26
+ Requires-Dist: quart==0.20.0
27
+ Provides-Extra: dev
28
+ Requires-Dist: ipykernel==7.3.0; extra == "dev"
29
+ Requires-Dist: ipywidgets==8.1.8; extra == "dev"
30
+ Requires-Dist: matplotlib==3.11.0; extra == "dev"
31
+ Requires-Dist: seaborn==0.13.2; extra == "dev"
32
+ Requires-Dist: nbformat==5.10.4; extra == "dev"
33
+ Requires-Dist: numpy==2.5.0; extra == "dev"
34
+ Requires-Dist: sympy==1.14.0; extra == "dev"
35
+ Requires-Dist: scikit-learn==1.9.0; extra == "dev"
36
+ Requires-Dist: xgboost-cpu==3.3.0; extra == "dev"
37
+ Requires-Dist: dominate==2.9.1; extra == "dev"
38
+ Provides-Extra: test
39
+ Requires-Dist: python-dotenv[cli]; extra == "test"
40
+ Requires-Dist: pyexpect; extra == "test"
41
+ Requires-Dist: mypy==2.1.0; extra == "test"
42
+ Requires-Dist: pytest==9.1.1; extra == "test"
43
+ Requires-Dist: pytest-asyncio; extra == "test"
44
+ Provides-Extra: docs
45
+ Requires-Dist: sphinx==9.1.0; extra == "docs"
46
+ Requires-Dist: sphinx-rtd-theme==3.1.0; extra == "docs"
47
+ Requires-Dist: sphinx-autodoc-typehints==3.11.0; extra == "docs"
48
+ Provides-Extra: build
49
+ Requires-Dist: build==1.5.0; extra == "build"
50
+ Requires-Dist: pip-tools==7.5.3; extra == "build"
51
+ Dynamic: license-file
52
+
53
+ # splime
54
+
55
+ **Reuse Python functions across projects without rewriting or redeploying them.**
56
+
57
+ splime turns trusted Python functions into versioned, portable **nodes** that can be
58
+ reused across projects and executed locally or remotely. You publish a function to a
59
+ private library once, then any project can call it by name, run it where the data or the
60
+ hardware lives, and read back the result and artifacts — without copying code or
61
+ redeploying.
62
+
63
+ - **Python-first.** Plain Python functions and pipelines, no DSL to learn.
64
+ - **Reuse-first.** Publish once, call by name from anywhere.
65
+ - **Private-team-first.** Your own libraries and workers, with explicit ownership and scoped access.
66
+ - **Local or remote.** The same call runs on your machine during development, or on a private worker that has the data, the GPU, or the credentials.
67
+
68
+ > splime is a private node registry and execution layer — not a workflow orchestrator, a
69
+ > scheduler, or a public marketplace. It does not replace Airflow, Prefect, or Temporal.
70
+
71
+ ---
72
+
73
+ ## Requirements
74
+
75
+ - Python **3.13+**
76
+
77
+ ## Install
78
+
79
+ ```bash
80
+ pip install splime
81
+ ```
82
+
83
+ The distribution is named `splime`; the Python import package is `spl`.
84
+
85
+ ## Quickstart
86
+
87
+ **1. Start the local daemon** (it stores your objects and runs workers):
88
+
89
+ ```bash
90
+ spl-daemon serve # listens on http://127.0.0.1:8765 by default
91
+ ```
92
+
93
+ **2. Publish a function and call it** — a plain `SPLClient()` is fully local and never
94
+ contacts a server:
95
+
96
+ ```python
97
+ from spl.client import SPLClient
98
+
99
+ def daily_total(date: str) -> float:
100
+ prices = {"2026-06-08": [11.0, 6.5, 24.5]}
101
+ return sum(prices.get(date, []))
102
+
103
+ client = SPLClient() # local-first; no server contact
104
+ client.publish(daily_total, name="daily_total")
105
+
106
+ result = client.call("daily_total", kwargs={"date": "2026-06-08"})
107
+ print(result.mode) # "local"
108
+ print(result.value) # 42.0
109
+ ```
110
+
111
+ That is the whole loop: define a function, `publish` it as a versioned node, then `call`
112
+ it by name and get back the value (plus logs and any artifacts).
113
+
114
+ ## Run it where the data lives
115
+
116
+ The same `call` becomes a remote run when you point it at a library, an owner, or a
117
+ target machine. This requires a connected splime server and a private worker; the local
118
+ daemon builds an isolated environment on the worker before executing.
119
+
120
+ ```python
121
+ client = SPLClient(user_token="…", machine_token="…") # connect the daemon to your server
122
+
123
+ result = client.call(
124
+ "daily_total",
125
+ kwargs={"date": "2026-06-08"},
126
+ target_machine="gpu-box", # hand the run to a private worker
127
+ )
128
+ print(result.mode) # "server"
129
+ ```
130
+
131
+ `SPLClient()` without tokens stays entirely local — connecting to a server is always
132
+ optional.
133
+
134
+ ## Libraries
135
+
136
+ Libraries group versioned objects and control who can see and run them. Creating and
137
+ curating libraries uses a server-connected client:
138
+
139
+ ```python
140
+ client.create_library("risk", display_name="Risk", visibility="private")
141
+ client.publish(risk_score, name="risk_score", library="risk")
142
+
143
+ # Grant scoped access to a teammate
144
+ client.grant_library("risk", "analyst1", scopes=["metadata:read", "objects:read", "execute"])
145
+ ```
146
+
147
+ A library can also reference a live object from another library (`add_reference`, follows
148
+ `latest`) or take an owned snapshot with provenance (`copy_object`).
149
+
150
+ ## Security & trust
151
+
152
+ splime runs code that you publish on purpose, on machines you control. It is built around:
153
+
154
+ - **explicit ownership** of every published object,
155
+ - **scoped access** grants per library (read metadata, read objects, execute),
156
+ - **private worker boundaries** — the server coordinates, your own workers execute,
157
+ - **isolated environments** built by the daemon before a run,
158
+ - an **auditable run history**.
159
+
160
+ ## How it fits together
161
+
162
+ | Piece | What it does |
163
+ | --- | --- |
164
+ | `spl.core` | Serializes Python functions and pipelines to a portable SPL/YAML form. |
165
+ | `SPLClient` | The user-facing client: publish, call, manage libraries and runs. |
166
+ | `spl-daemon` | A local runtime that stores objects, builds environments, and executes workers. |
167
+
168
+ ## Development
169
+
170
+ ```bash
171
+ git clone https://github.com/yastrebovks/splime
172
+ cd splime
173
+ pip install -e '.[test]'
174
+ pytest
175
+ ```
176
+
177
+ ## Project status
178
+
179
+ Alpha (`0.1.0`). The API may change between releases. Feedback and issues are welcome at
180
+ the [issue tracker](https://github.com/yastrebovks/splime/issues).
181
+
182
+ ## Links
183
+
184
+ - Website: https://splime.io
185
+ - Source: https://github.com/yastrebovks/splime
186
+
187
+ ## License
188
+
189
+ Licensed under the [Apache License 2.0](LICENSE).
splime-0.1.2/README.md ADDED
@@ -0,0 +1,137 @@
1
+ # splime
2
+
3
+ **Reuse Python functions across projects without rewriting or redeploying them.**
4
+
5
+ splime turns trusted Python functions into versioned, portable **nodes** that can be
6
+ reused across projects and executed locally or remotely. You publish a function to a
7
+ private library once, then any project can call it by name, run it where the data or the
8
+ hardware lives, and read back the result and artifacts — without copying code or
9
+ redeploying.
10
+
11
+ - **Python-first.** Plain Python functions and pipelines, no DSL to learn.
12
+ - **Reuse-first.** Publish once, call by name from anywhere.
13
+ - **Private-team-first.** Your own libraries and workers, with explicit ownership and scoped access.
14
+ - **Local or remote.** The same call runs on your machine during development, or on a private worker that has the data, the GPU, or the credentials.
15
+
16
+ > splime is a private node registry and execution layer — not a workflow orchestrator, a
17
+ > scheduler, or a public marketplace. It does not replace Airflow, Prefect, or Temporal.
18
+
19
+ ---
20
+
21
+ ## Requirements
22
+
23
+ - Python **3.13+**
24
+
25
+ ## Install
26
+
27
+ ```bash
28
+ pip install splime
29
+ ```
30
+
31
+ The distribution is named `splime`; the Python import package is `spl`.
32
+
33
+ ## Quickstart
34
+
35
+ **1. Start the local daemon** (it stores your objects and runs workers):
36
+
37
+ ```bash
38
+ spl-daemon serve # listens on http://127.0.0.1:8765 by default
39
+ ```
40
+
41
+ **2. Publish a function and call it** — a plain `SPLClient()` is fully local and never
42
+ contacts a server:
43
+
44
+ ```python
45
+ from spl.client import SPLClient
46
+
47
+ def daily_total(date: str) -> float:
48
+ prices = {"2026-06-08": [11.0, 6.5, 24.5]}
49
+ return sum(prices.get(date, []))
50
+
51
+ client = SPLClient() # local-first; no server contact
52
+ client.publish(daily_total, name="daily_total")
53
+
54
+ result = client.call("daily_total", kwargs={"date": "2026-06-08"})
55
+ print(result.mode) # "local"
56
+ print(result.value) # 42.0
57
+ ```
58
+
59
+ That is the whole loop: define a function, `publish` it as a versioned node, then `call`
60
+ it by name and get back the value (plus logs and any artifacts).
61
+
62
+ ## Run it where the data lives
63
+
64
+ The same `call` becomes a remote run when you point it at a library, an owner, or a
65
+ target machine. This requires a connected splime server and a private worker; the local
66
+ daemon builds an isolated environment on the worker before executing.
67
+
68
+ ```python
69
+ client = SPLClient(user_token="…", machine_token="…") # connect the daemon to your server
70
+
71
+ result = client.call(
72
+ "daily_total",
73
+ kwargs={"date": "2026-06-08"},
74
+ target_machine="gpu-box", # hand the run to a private worker
75
+ )
76
+ print(result.mode) # "server"
77
+ ```
78
+
79
+ `SPLClient()` without tokens stays entirely local — connecting to a server is always
80
+ optional.
81
+
82
+ ## Libraries
83
+
84
+ Libraries group versioned objects and control who can see and run them. Creating and
85
+ curating libraries uses a server-connected client:
86
+
87
+ ```python
88
+ client.create_library("risk", display_name="Risk", visibility="private")
89
+ client.publish(risk_score, name="risk_score", library="risk")
90
+
91
+ # Grant scoped access to a teammate
92
+ client.grant_library("risk", "analyst1", scopes=["metadata:read", "objects:read", "execute"])
93
+ ```
94
+
95
+ A library can also reference a live object from another library (`add_reference`, follows
96
+ `latest`) or take an owned snapshot with provenance (`copy_object`).
97
+
98
+ ## Security & trust
99
+
100
+ splime runs code that you publish on purpose, on machines you control. It is built around:
101
+
102
+ - **explicit ownership** of every published object,
103
+ - **scoped access** grants per library (read metadata, read objects, execute),
104
+ - **private worker boundaries** — the server coordinates, your own workers execute,
105
+ - **isolated environments** built by the daemon before a run,
106
+ - an **auditable run history**.
107
+
108
+ ## How it fits together
109
+
110
+ | Piece | What it does |
111
+ | --- | --- |
112
+ | `spl.core` | Serializes Python functions and pipelines to a portable SPL/YAML form. |
113
+ | `SPLClient` | The user-facing client: publish, call, manage libraries and runs. |
114
+ | `spl-daemon` | A local runtime that stores objects, builds environments, and executes workers. |
115
+
116
+ ## Development
117
+
118
+ ```bash
119
+ git clone https://github.com/yastrebovks/splime
120
+ cd splime
121
+ pip install -e '.[test]'
122
+ pytest
123
+ ```
124
+
125
+ ## Project status
126
+
127
+ Alpha (`0.1.0`). The API may change between releases. Feedback and issues are welcome at
128
+ the [issue tracker](https://github.com/yastrebovks/splime/issues).
129
+
130
+ ## Links
131
+
132
+ - Website: https://splime.io
133
+ - Source: https://github.com/yastrebovks/splime
134
+
135
+ ## License
136
+
137
+ Licensed under the [Apache License 2.0](LICENSE).
@@ -0,0 +1,125 @@
1
+ [build-system]
2
+ requires = ["setuptools==82.0.1", "wheel==0.47.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "splime"
7
+ version = "0.1.2"
8
+
9
+ description = "Reuse Python functions across projects without rewriting or redeploying them."
10
+ readme = "README.md"
11
+ license = "Apache-2.0"
12
+ license-files = ["LICENSE", "NOTICE"]
13
+ keywords = ["splime", "spl", "python", "functions", "reuse", "nodes", "pipeline", "remote-execution", "registry"]
14
+
15
+ authors = [
16
+ {name = "Yastrebov Kirill", email = "yastrebovks@gmail.com"}]
17
+
18
+ requires-python = ">= 3.13"
19
+
20
+ dependencies = [
21
+ "pyyaml==6.0.3",
22
+ "keyring==25.7.0",
23
+ "quart==0.20.0",
24
+ ]
25
+
26
+ classifiers = [
27
+ "Development Status :: 3 - Alpha",
28
+ "Intended Audience :: Developers",
29
+ "Programming Language :: Python :: 3",
30
+ "Programming Language :: Python :: 3.13",
31
+ "Operating System :: OS Independent",
32
+ "Topic :: Software Development :: Libraries :: Python Modules",
33
+ "Topic :: System :: Distributed Computing",
34
+ "Typing :: Typed",
35
+ ]
36
+
37
+ [project.optional-dependencies]
38
+ dev = [
39
+ "ipykernel==7.3.0",
40
+ "ipywidgets==8.1.8",
41
+ "matplotlib==3.11.0",
42
+ "seaborn==0.13.2",
43
+ "nbformat==5.10.4",
44
+
45
+ # example dependencies
46
+ "numpy==2.5.0",
47
+ "sympy==1.14.0",
48
+ "scikit-learn==1.9.0",
49
+ "xgboost-cpu==3.3.0",
50
+ "dominate==2.9.1"]
51
+
52
+ test = [
53
+ "python-dotenv[cli]",
54
+ "pyexpect",
55
+ "mypy==2.1.0",
56
+ "pytest==9.1.1",
57
+ "pytest-asyncio"]
58
+
59
+ docs = [
60
+ "sphinx==9.1.0",
61
+ "sphinx-rtd-theme==3.1.0",
62
+ "sphinx-autodoc-typehints==3.11.0"]
63
+
64
+ build = [
65
+ "build==1.5.0",
66
+ "pip-tools==7.5.3"]
67
+
68
+
69
+ [project.scripts]
70
+ spl-daemon = "spl.daemon.cli:main"
71
+
72
+
73
+ [project.urls]
74
+ Homepage = "https://splime.io"
75
+ Documentation = "https://splime.io"
76
+ Repository = "https://github.com/yastrebovks/splime"
77
+ Issues = "https://github.com/yastrebovks/splime/issues"
78
+
79
+
80
+ [tool.setuptools.packages.find]
81
+ namespaces = true
82
+ where = ["src"]
83
+ include = ["spl*"]
84
+
85
+ [tool.setuptools.package-data]
86
+ "*" = ["py.typed"]
87
+
88
+ [tool.uv]
89
+ constraint-dependencies = [
90
+ "pip<25.3"]
91
+
92
+
93
+ [tool.mypy]
94
+ mypy_path = "stubs"
95
+ namespace_packages = true
96
+ explicit_package_bases = false
97
+ implicit_optional = false
98
+ implicit_reexport = true
99
+ plugins = []
100
+ strict = true
101
+
102
+
103
+ [tool.ruff]
104
+ line-length = 120
105
+
106
+ [tool.ruff.lint]
107
+ select = []
108
+ ignore = []
109
+
110
+
111
+ [tool.pytest.ini_options]
112
+ addopts = "-raq --strict-markers"
113
+
114
+ python_files = ["test_*.py", "tests.py"]
115
+ testpaths = ["tests"]
116
+
117
+ log_cli = 1
118
+ log_cli_level = "INFO"
119
+ log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
120
+ log_cli_date_format = "%Y-%m-%d %H:%M:%S"
121
+
122
+ asyncio_mode = "strict"
123
+
124
+ markers = [
125
+ "smoke"]
splime-0.1.2/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,14 @@
1
+ from __future__ import annotations
2
+
3
+ __path__ = __import__("pkgutil").extend_path(__path__, __name__)
4
+
5
+ from spl.client import PublishedObject, RemoteResult, RemoteRun, SPLClient
6
+ from spl.core.entities.node_remote import NodeRemote
7
+
8
+ __all__ = [
9
+ "SPLClient",
10
+ "RemoteRun",
11
+ "RemoteResult",
12
+ "PublishedObject",
13
+ "NodeRemote",
14
+ ]