Metadata-Version: 2.4
Name: pyra3d
Version: 0.1.0
Summary: Write Python. Ship WebGPU. Python 3D web framework and optimizing compiler.
Author-email: Pyra3D Contributors <hello@pyra3d.dev>
Maintainer-email: Pyra3D Team <hello@pyra3d.dev>
License-Expression: MIT
Project-URL: Homepage, https://github.com/pyra3d/pyra
Project-URL: Documentation, https://github.com/pyra3d/pyra#readme
Project-URL: Repository, https://github.com/pyra3d/pyra.git
Project-URL: Issues, https://github.com/pyra3d/pyra/issues
Project-URL: Changelog, https://github.com/pyra3d/pyra/blob/main/CHANGELOG.md
Keywords: 3d,webgpu,webgl,compiler,web-framework,graphics,scene-graph,wasm,creative-coding
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Multimedia :: Graphics :: 3D Rendering
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Software Development :: User Interfaces
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: build>=1.0.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Dynamic: license-file

# Pyra3D (pyra)

**Write Python. Ship WebGPU.**

Pyra3D is a compiler-first Python 3D web framework. Python is the authoring language; the browser never receives or executes Python. 

Pyra compiles declarative Python scene graphs, custom shaders, and interactive AST handlers into an optimized binary scene representation (`scene.bin`) paired with a lightweight (<50KB) WebGPU/WebGL2 browser runtime.

```python
from pyra import Site, Scene, Camera
from pyra.objects import Cube
from pyra.materials import Glass

site = Site("My 3D Website")
scene = Scene()

cube = Cube(size=2, material=Glass())
scene.add(cube)

@scene.animation
def rotate(cube, t):
    cube.rotation.y = t * 2

@cube.on_click
def clicked(event):
    cube.animate(scale=1.4, duration=0.2, easing="ease_out")

scene.camera = Camera(position=(0, 1, 6), look_at=(0, 0, 0))
site.scene(scene)
site.run()
```

Run:
```bash
pyra build
```

Produces:
```
dist/
├── index.html
├── runtime.js
├── scene.bin
└── assets/
```

## Features

- **Pure Python Ergonomics**: Clean, pygame/Three.js-style scene graph.
- **Compiler-First**: Python AST analyzer compiles browser interactions and animation math into deterministic Action & Expression Bytecode.
- **Zero Python in Browser**: No Pyodide, no Brython, no interpreter overhead.
- **WebGPU Native**: WGSL-powered PBR, Glass refraction, and compute particles with automatic WebGL2 fallback.
- **Deterministic Binary Output**: `scene.bin` with Table-of-Contents (TOC) for zero-copy GPU buffer upload.
- **Instant CLI**: `pyra new`, `pyra dev`, `pyra build`, `pyra preview`, `pyra inspect`.
