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, parse, validate, generate

# 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-1.0.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

holoscript-1.0.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for holoscript-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1d8f329f7d2cf46b33bfccb44e918516fe9e494b305c8466e9c0c1be3eca52e1
MD5 7b154b9f596d55586e3d1284a289527d
BLAKE2b-256 8602061e580e19027444a5ab82ea21c4277c8abe0706b383334138a2249d0d28

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for holoscript-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7670058092a9c1edc2692a55e8e2784273a76e68733adae863ccbf4e2eb4ea2
MD5 10913647ed4609b5406c4cde1c1c8de0
BLAKE2b-256 a072934c5ef234020f3e06810314ebcb2620385e4b787b17d35e2406ef50bd0f

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