Skip to main content

Python bindings for HoloScript — parse, validate, generate, and render spatial scenes (.holo/.hs/.hsplus). Includes CLI, trait tools, robotics export (URDF/SDF/ROS 2), and MCP client.

Project description

HoloScript Python Bindings

Python bindings for HoloScript - parse, validate, and generate HoloScript code from Python.

Installation

pip install holoscript

Quick Start

from holoscript import HoloScript

# Initialize
hs = HoloScript()

# Parse HoloScript code
ast = hs.parse("""
composition "My Scene" {
  object "Crystal" @grabbable @glowing {
    geometry: "sphere"
    color: "#00ffff"
  }
}
""")

# Validate code
result = hs.validate(ast)
if result.valid:
    print("✅ Valid HoloScript!")
else:
    for error in result.errors:
        print(f"❌ Line {error.line}: {error.message}")

# Generate from natural language
scene = hs.generate("a floating island with glowing crystals")
print(scene.code)

# Create shareable link
share = hs.share(scene.code, title="My VR Scene", platform="x")
print(f"Playground: {share.playground_url}")
print(f"Tweet: {share.tweet_text}")

Features

  • Parsing: Parse .hs, .hsplus, and .holo files
  • Validation: Validate syntax with AI-friendly error messages
  • Generation: Generate HoloScript from natural language
  • Rendering: Generate preview images/GIFs
  • Sharing: Create X-optimized shareable links

For AI Agents (Grok, etc.)

# Grok integration example
from holoscript import HoloScript

hs = HoloScript(api_key="your-api-key")  # Optional for remote rendering

# Generate scene from user prompt
user_prompt = "Create a VR scene with a floating castle"
scene = hs.generate(user_prompt)

# Validate
if hs.validate(scene.code).valid:
    # Create shareable preview
    preview = hs.render(scene.code, format="gif", duration=3000)
    share = hs.share(scene.code, title="Floating Castle", platform="x")

    # Return to user
    print(f"Here's your VR scene: {share.playground_url}")
    print(f"Preview: {preview.url}")

API Reference

See full documentation for complete API reference.

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-5.2.0.tar.gz (34.0 kB view details)

Uploaded Source

Built Distribution

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

holoscript-5.2.0-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for holoscript-5.2.0.tar.gz
Algorithm Hash digest
SHA256 bb7e897082c274b1c46b47669ff8b7a8955f77c793f417bafb12ed7b4aa216e6
MD5 5650011d5be400893921f548085c9fe6
BLAKE2b-256 ccd7d316b96da5d46163eb6f4e4c9fc882adcab9cccd04e8c14329c981837e03

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for holoscript-5.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 095decb058ff49743b68ccc0e4402967009e59a4401d565ff88cbee65df35d24
MD5 72629fd65a3b284ae340dd3d55b5da65
BLAKE2b-256 623a086157c87e0604b6747eb2a79ba5ec79b35141c1dcbd9a00a3fa9f3db1aa

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