Skip to main content

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.

The README you see on pypi.org/project/holoscript comes from this file in the published wheel and sdist. Bump the package version (e.g. 6.0.7) when refreshing PyPI-facing docs so the project page picks up changes after the next release.

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

holoscript-6.0.7.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

holoscript-6.0.7-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file holoscript-6.0.7.tar.gz.

File metadata

  • Download URL: holoscript-6.0.7.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for holoscript-6.0.7.tar.gz
Algorithm Hash digest
SHA256 0cfefe289d9ddaa35bc657ab2b939a5f831307964979583514a361a564731d0d
MD5 eeee0595c1311561387ed25d78096c8a
BLAKE2b-256 f0d343e23889f5322ffeedc10bd40f248d0a1866e5dd490612461471a7400373

See more details on using hashes here.

File details

Details for the file holoscript-6.0.7-py3-none-any.whl.

File metadata

  • Download URL: holoscript-6.0.7-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for holoscript-6.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7130d12457194d212442975cba116b3864abb52cd83bdebae42bac498cc0b744
MD5 f4b8fc68e0f02da2de3512c8d01748b8
BLAKE2b-256 c7c2590d6b400c71d770315b16d76eca208ddcefc555042f9fa452433ca7f1c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page