holoscript 6.0.4__tar.gz → 6.0.6__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.
@@ -0,0 +1,166 @@
1
+ Metadata-Version: 2.4
2
+ Name: holoscript
3
+ Version: 6.0.6
4
+ Summary: Python bindings for HoloScript — parsing, validation, and domain bridges for scientific computing
5
+ Author: Brian X Base Team
6
+ License: MIT
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Requires-Python: >=3.8
18
+ Description-Content-Type: text/markdown
19
+ Provides-Extra: dev
20
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
21
+ Requires-Dist: mypy>=1.11.0; extra == "dev"
22
+ Provides-Extra: medical
23
+ Requires-Dist: pydicom>=2.4.0; extra == "medical"
24
+ Requires-Dist: numpy>=1.24.0; extra == "medical"
25
+ Provides-Extra: alphafold
26
+ Requires-Dist: requests>=2.31.0; extra == "alphafold"
27
+ Provides-Extra: astronomy
28
+ Requires-Dist: numpy>=1.24.0; extra == "astronomy"
29
+ Provides-Extra: robotics
30
+ Requires-Dist: roslibpy>=1.6.0; extra == "robotics"
31
+ Provides-Extra: scientific
32
+ Requires-Dist: numpy>=1.24.0; extra == "scientific"
33
+ Provides-Extra: all
34
+ Requires-Dist: holoscript[alphafold,astronomy,medical,robotics,scientific]; extra == "all"
35
+
36
+ # holoscript
37
+
38
+ Python bindings for [HoloScript](https://github.com/brianonbased-dev/HoloScript) — parse, validate, and bridge domain-specific scientific tools into the HoloScript spatial computing ecosystem.
39
+
40
+ ## Install
41
+
42
+ ```bash
43
+ pip install holoscript
44
+ ```
45
+
46
+ ## Quick Start
47
+
48
+ ```python
49
+ import holoscript
50
+
51
+ # Parse a .holo composition
52
+ result = holoscript.parse('object Cube { position: [0, 1, 0] }')
53
+ print(result.success) # True
54
+ print(result.ast) # {"type": "composition", "source": "..."}
55
+
56
+ # Validate
57
+ validation = holoscript.validate('object Cube { position: [0, 1, 0] }')
58
+ print(validation.valid) # True
59
+
60
+ # List available traits
61
+ traits = holoscript.list_traits()
62
+ print(traits) # ["@grabbable", "@physics", "@clickable", "@color", "@position"]
63
+ ```
64
+
65
+ ## Domain Bridges
66
+
67
+ HoloScript bridges Python scientific libraries into spatial computing. Install the extras you need:
68
+
69
+ ```bash
70
+ pip install holoscript[medical] # DICOM imaging
71
+ pip install holoscript[alphafold] # Protein structure prediction
72
+ pip install holoscript[astronomy] # Radio astronomy
73
+ pip install holoscript[robotics] # ROS2 integration
74
+ pip install holoscript[scientific] # Molecular docking (AutoDock)
75
+ pip install holoscript[all] # Everything
76
+ ```
77
+
78
+ ### Medical — DICOM Bridge
79
+
80
+ ```python
81
+ from holoscript.bridges.medical import load_dicom_series, extract_volume
82
+
83
+ # Load a DICOM series and extract 3D volume for HoloScript visualization
84
+ series = load_dicom_series("/path/to/dicom/")
85
+ volume = extract_volume(series)
86
+ ```
87
+
88
+ Requires: `pydicom`, `numpy`
89
+
90
+ ### AlphaFold — Protein Structure
91
+
92
+ ```python
93
+ from holoscript.bridges.alphafold import AlphaFoldBridge
94
+
95
+ bridge = AlphaFoldBridge(api_key="your_key")
96
+ structure = bridge.predict("MKFLILLFNILCLFPVLAADNHGVS")
97
+ ```
98
+
99
+ Requires: `requests`
100
+
101
+ ### Astronomy — Radio Telescope Data
102
+
103
+ ```python
104
+ from holoscript.bridges.radio_astronomy import calculate_synchrotron
105
+
106
+ flux = calculate_synchrotron({
107
+ "magnetic_field_gauss": 1e-4,
108
+ "frequency_hz": 1.4e9
109
+ })
110
+ ```
111
+
112
+ ### Robotics — ROS2
113
+
114
+ ```python
115
+ from holoscript.bridges.robotics import ROS2Bridge
116
+
117
+ bridge = ROS2Bridge("ws://localhost:9090")
118
+ bridge.connect()
119
+ bridge.publish_joint_command("/joint_states", {"position": [0, 0.5, 1.0]})
120
+ ```
121
+
122
+ Requires: `roslibpy`
123
+
124
+ ### Scientific — Molecular Docking
125
+
126
+ ```python
127
+ from holoscript.bridges.scientific import AutoDockBridge
128
+
129
+ bridge = AutoDockBridge()
130
+ results = bridge.run_docking({
131
+ "protein_pdb": "receptor.pdb",
132
+ "ligand_mol": "compound.mol"
133
+ })
134
+ ```
135
+
136
+ ## MCP Server
137
+
138
+ HoloScript also runs as an MCP server with 214 tools (verify via `curl mcp.holoscript.net/health`). The Python package provides local parsing — the MCP server provides compilation, rendering, and deployment.
139
+
140
+ ```bash
141
+ # No auth needed for parsing
142
+ curl -X POST https://mcp.holoscript.net/api/compile \
143
+ -H "Content-Type: application/json" \
144
+ -d '{"code": "object Cube { position: [0,1,0] }", "target": "r3f"}'
145
+ ```
146
+
147
+ ## npm Ecosystem
148
+
149
+ The full HoloScript ecosystem is on npm:
150
+
151
+ ```bash
152
+ npx create-holoscript my-app # Scaffold a project
153
+ npm install @holoscript/core # Core library
154
+ ```
155
+
156
+ ## Links
157
+
158
+ - [GitHub](https://github.com/brianonbased-dev/HoloScript)
159
+ - [MCP Server](https://mcp.holoscript.net)
160
+ - [Store](https://store.holoscript.net)
161
+ - [npm](https://www.npmjs.com/org/holoscript)
162
+ - [PyPI](https://pypi.org/project/holoscript/)
163
+
164
+ ## License
165
+
166
+ MIT
@@ -0,0 +1,131 @@
1
+ # holoscript
2
+
3
+ Python bindings for [HoloScript](https://github.com/brianonbased-dev/HoloScript) — parse, validate, and bridge domain-specific scientific tools into the HoloScript spatial computing ecosystem.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pip install holoscript
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```python
14
+ import holoscript
15
+
16
+ # Parse a .holo composition
17
+ result = holoscript.parse('object Cube { position: [0, 1, 0] }')
18
+ print(result.success) # True
19
+ print(result.ast) # {"type": "composition", "source": "..."}
20
+
21
+ # Validate
22
+ validation = holoscript.validate('object Cube { position: [0, 1, 0] }')
23
+ print(validation.valid) # True
24
+
25
+ # List available traits
26
+ traits = holoscript.list_traits()
27
+ print(traits) # ["@grabbable", "@physics", "@clickable", "@color", "@position"]
28
+ ```
29
+
30
+ ## Domain Bridges
31
+
32
+ HoloScript bridges Python scientific libraries into spatial computing. Install the extras you need:
33
+
34
+ ```bash
35
+ pip install holoscript[medical] # DICOM imaging
36
+ pip install holoscript[alphafold] # Protein structure prediction
37
+ pip install holoscript[astronomy] # Radio astronomy
38
+ pip install holoscript[robotics] # ROS2 integration
39
+ pip install holoscript[scientific] # Molecular docking (AutoDock)
40
+ pip install holoscript[all] # Everything
41
+ ```
42
+
43
+ ### Medical — DICOM Bridge
44
+
45
+ ```python
46
+ from holoscript.bridges.medical import load_dicom_series, extract_volume
47
+
48
+ # Load a DICOM series and extract 3D volume for HoloScript visualization
49
+ series = load_dicom_series("/path/to/dicom/")
50
+ volume = extract_volume(series)
51
+ ```
52
+
53
+ Requires: `pydicom`, `numpy`
54
+
55
+ ### AlphaFold — Protein Structure
56
+
57
+ ```python
58
+ from holoscript.bridges.alphafold import AlphaFoldBridge
59
+
60
+ bridge = AlphaFoldBridge(api_key="your_key")
61
+ structure = bridge.predict("MKFLILLFNILCLFPVLAADNHGVS")
62
+ ```
63
+
64
+ Requires: `requests`
65
+
66
+ ### Astronomy — Radio Telescope Data
67
+
68
+ ```python
69
+ from holoscript.bridges.radio_astronomy import calculate_synchrotron
70
+
71
+ flux = calculate_synchrotron({
72
+ "magnetic_field_gauss": 1e-4,
73
+ "frequency_hz": 1.4e9
74
+ })
75
+ ```
76
+
77
+ ### Robotics — ROS2
78
+
79
+ ```python
80
+ from holoscript.bridges.robotics import ROS2Bridge
81
+
82
+ bridge = ROS2Bridge("ws://localhost:9090")
83
+ bridge.connect()
84
+ bridge.publish_joint_command("/joint_states", {"position": [0, 0.5, 1.0]})
85
+ ```
86
+
87
+ Requires: `roslibpy`
88
+
89
+ ### Scientific — Molecular Docking
90
+
91
+ ```python
92
+ from holoscript.bridges.scientific import AutoDockBridge
93
+
94
+ bridge = AutoDockBridge()
95
+ results = bridge.run_docking({
96
+ "protein_pdb": "receptor.pdb",
97
+ "ligand_mol": "compound.mol"
98
+ })
99
+ ```
100
+
101
+ ## MCP Server
102
+
103
+ HoloScript also runs as an MCP server with 214 tools (verify via `curl mcp.holoscript.net/health`). The Python package provides local parsing — the MCP server provides compilation, rendering, and deployment.
104
+
105
+ ```bash
106
+ # No auth needed for parsing
107
+ curl -X POST https://mcp.holoscript.net/api/compile \
108
+ -H "Content-Type: application/json" \
109
+ -d '{"code": "object Cube { position: [0,1,0] }", "target": "r3f"}'
110
+ ```
111
+
112
+ ## npm Ecosystem
113
+
114
+ The full HoloScript ecosystem is on npm:
115
+
116
+ ```bash
117
+ npx create-holoscript my-app # Scaffold a project
118
+ npm install @holoscript/core # Core library
119
+ ```
120
+
121
+ ## Links
122
+
123
+ - [GitHub](https://github.com/brianonbased-dev/HoloScript)
124
+ - [MCP Server](https://mcp.holoscript.net)
125
+ - [Store](https://store.holoscript.net)
126
+ - [npm](https://www.npmjs.com/org/holoscript)
127
+ - [PyPI](https://pypi.org/project/holoscript/)
128
+
129
+ ## License
130
+
131
+ MIT
@@ -1,53 +1,53 @@
1
- from dataclasses import dataclass, field
2
- from typing import Dict, List
3
-
4
- # Release version injected by CI from git tag. Dev version for local use.
5
- __version__ = "6.0.4"
6
-
7
-
8
- @dataclass
9
- class ParseResult:
10
- success: bool
11
- ast: Dict[str, str]
12
- errors: List[str] = field(default_factory=list)
13
- warnings: List[str] = field(default_factory=list)
14
- format: str = "holo"
15
-
16
-
17
- @dataclass
18
- class ValidationResult:
19
- valid: bool
20
- errors: List[str] = field(default_factory=list)
21
- warnings: List[str] = field(default_factory=list)
22
-
23
-
24
- def parse(code: str) -> ParseResult:
25
- stripped = code.strip()
26
- if not stripped:
27
- return ParseResult(success=False, ast={}, errors=["Input is empty"])
28
-
29
- return ParseResult(
30
- success=True,
31
- ast={"type": "composition", "source": stripped},
32
- )
33
-
34
-
35
- def validate(code: str) -> ValidationResult:
36
- if not code.strip():
37
- return ValidationResult(valid=False, errors=["Input is empty"])
38
-
39
- return ValidationResult(valid=True)
40
-
41
-
42
- def list_traits() -> List[str]:
43
- return ["@grabbable", "@physics", "@clickable", "@color", "@position"]
44
-
45
-
46
- __all__ = [
47
- "__version__",
48
- "ParseResult",
49
- "ValidationResult",
50
- "parse",
51
- "validate",
52
- "list_traits",
53
- ]
1
+ from dataclasses import dataclass, field
2
+ from typing import Dict, List
3
+
4
+ # Release version injected by CI from git tag. Dev version for local use.
5
+ __version__ = "6.0.6"
6
+
7
+
8
+ @dataclass
9
+ class ParseResult:
10
+ success: bool
11
+ ast: Dict[str, str]
12
+ errors: List[str] = field(default_factory=list)
13
+ warnings: List[str] = field(default_factory=list)
14
+ format: str = "holo"
15
+
16
+
17
+ @dataclass
18
+ class ValidationResult:
19
+ valid: bool
20
+ errors: List[str] = field(default_factory=list)
21
+ warnings: List[str] = field(default_factory=list)
22
+
23
+
24
+ def parse(code: str) -> ParseResult:
25
+ stripped = code.strip()
26
+ if not stripped:
27
+ return ParseResult(success=False, ast={}, errors=["Input is empty"])
28
+
29
+ return ParseResult(
30
+ success=True,
31
+ ast={"type": "composition", "source": stripped},
32
+ )
33
+
34
+
35
+ def validate(code: str) -> ValidationResult:
36
+ if not code.strip():
37
+ return ValidationResult(valid=False, errors=["Input is empty"])
38
+
39
+ return ValidationResult(valid=True)
40
+
41
+
42
+ def list_traits() -> List[str]:
43
+ return ["@grabbable", "@physics", "@clickable", "@color", "@position"]
44
+
45
+
46
+ __all__ = [
47
+ "__version__",
48
+ "ParseResult",
49
+ "ValidationResult",
50
+ "parse",
51
+ "validate",
52
+ "list_traits",
53
+ ]
@@ -0,0 +1,11 @@
1
+ """
2
+ HoloScript Domain Bridges — Python integrations for scientific computing.
3
+
4
+ Install domain extras:
5
+ pip install holoscript[medical] # DICOM imaging
6
+ pip install holoscript[alphafold] # Protein structure prediction
7
+ pip install holoscript[astronomy] # Radio astronomy / synchrotron
8
+ pip install holoscript[robotics] # ROS2 integration
9
+ pip install holoscript[scientific] # AutoDock molecular docking
10
+ pip install holoscript[all] # Everything
11
+ """