Skip to main content

Python bindings for HoloScript - VR scene description language

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.3.0.tar.gz (31.6 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.3.0-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for holoscript-5.3.0.tar.gz
Algorithm Hash digest
SHA256 d39d9b4c898c2abd2bd05a5349b23d6da4716c4818d4661edbe5990b6096b08e
MD5 edad3381f7aba71d20efc55823e717df
BLAKE2b-256 d0970f70748513ccd388242d72927164e45d8926965c5bbc852c42e3b2041c5d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: holoscript-5.3.0-py3-none-any.whl
  • Upload date:
  • Size: 23.1 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 27cc98686fb3441154efd13566919d36484ddd29af36a8d0758a28bcdc794b4a
MD5 84dba7156e20b9869d92a2a4db9ca150
BLAKE2b-256 0897c11ce715ded788c293d9816b0f45ab60f999cbe7deaa5258b9f8c9b3311c

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