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.holofiles - 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.1.tar.gz
(31.8 kB
view details)
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-5.3.1.tar.gz.
File metadata
- Download URL: holoscript-5.3.1.tar.gz
- Upload date:
- Size: 31.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 |
0cb20caf8c0a022327d0467d4a1e97e6b35b6eddd5d919eca1cbcc7d93e7ea56
|
|
| MD5 |
082dcc3fe3dc3f47df8bc9d115717dfb
|
|
| BLAKE2b-256 |
e0cacc6bcec098f7ea5d1216548159b6f222c687254135fa467685564085ba34
|
File details
Details for the file holoscript-5.3.1-py3-none-any.whl.
File metadata
- Download URL: holoscript-5.3.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2cf1f2fc7ec5de1f977fda9878a057ff5eeb8efb7c0e850037573aa7fffab74
|
|
| MD5 |
c0be6e7fe864e2be5c5c45ab1d241c9d
|
|
| BLAKE2b-256 |
3357eab3c47ccc3c47d22f3474fb717441e3fd4ea367efcdea0d116a10972991
|