Python bindings for HoloScript — parsing, validation, and domain bridges for scientific computing
Project description
holoscript
Python bindings for HoloScript — parse, validate, and bridge domain-specific scientific tools into the HoloScript spatial computing ecosystem.
Install
pip install holoscript
Quick Start
import holoscript
# Parse a .holo composition
result = holoscript.parse('object Cube { position: [0, 1, 0] }')
print(result.success) # True
print(result.ast) # {"type": "composition", "source": "..."}
# Validate
validation = holoscript.validate('object Cube { position: [0, 1, 0] }')
print(validation.valid) # True
# List available traits
traits = holoscript.list_traits()
print(traits) # ["@grabbable", "@physics", "@clickable", "@color", "@position"]
Domain Bridges
HoloScript bridges Python scientific libraries into spatial computing. Install the extras you need:
pip install holoscript[medical] # DICOM imaging
pip install holoscript[alphafold] # Protein structure prediction
pip install holoscript[astronomy] # Radio astronomy
pip install holoscript[robotics] # ROS2 integration
pip install holoscript[scientific] # Molecular docking (AutoDock)
pip install holoscript[all] # Everything
Medical — DICOM Bridge
from holoscript.bridges.medical import load_dicom_series, extract_volume
# Load a DICOM series and extract 3D volume for HoloScript visualization
series = load_dicom_series("/path/to/dicom/")
volume = extract_volume(series)
Requires: pydicom, numpy
AlphaFold — Protein Structure
from holoscript.bridges.alphafold import AlphaFoldBridge
bridge = AlphaFoldBridge(api_key="your_key")
structure = bridge.predict("MKFLILLFNILCLFPVLAADNHGVS")
Requires: requests
Astronomy — Radio Telescope Data
from holoscript.bridges.radio_astronomy import calculate_synchrotron
flux = calculate_synchrotron({
"magnetic_field_gauss": 1e-4,
"frequency_hz": 1.4e9
})
Robotics — ROS2
from holoscript.bridges.robotics import ROS2Bridge
bridge = ROS2Bridge("ws://localhost:9090")
bridge.connect()
bridge.publish_joint_command("/joint_states", {"position": [0, 0.5, 1.0]})
Requires: roslibpy
Scientific — Molecular Docking
from holoscript.bridges.scientific import AutoDockBridge
bridge = AutoDockBridge()
results = bridge.run_docking({
"protein_pdb": "receptor.pdb",
"ligand_mol": "compound.mol"
})
MCP Server
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.
# No auth needed for parsing
curl -X POST https://mcp.holoscript.net/api/compile \
-H "Content-Type: application/json" \
-d '{"code": "object Cube { position: [0,1,0] }", "target": "r3f"}'
npm Ecosystem
The full HoloScript ecosystem is on npm:
npx create-holoscript my-app # Scaffold a project
npm install @holoscript/core # Core library
Links
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file holoscript-6.0.6.tar.gz.
File metadata
- Download URL: holoscript-6.0.6.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d485bf53f3dea29f7d19a0f3e83e3865819272653fe0760c0803de86adf6f738
|
|
| MD5 |
fda60bb938538ed429d5684bc495bbd8
|
|
| BLAKE2b-256 |
6fd290cf8fd6b42e67d51c29ac670c62366f2ba50638e6a9aa456d6a11a0e614
|
File details
Details for the file holoscript-6.0.6-py3-none-any.whl.
File metadata
- Download URL: holoscript-6.0.6-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
212cf08d0b9bc1141e0be0d46ad4fb333c20ff8292fdb0ea433f6729a18f7c57
|
|
| MD5 |
f2a35cb3187d952d22888b4e66da19b8
|
|
| BLAKE2b-256 |
28b4531aee0ca9a3ab2070aa0c972edb7d4a04ca4a6d7a5957a88685aa041806
|