gldf_rs_python 0.3.1

Python Module of the GLDF (General Lighting Data Format) parser and writer for Rust, specifically for the Rust/WASM target as such designed for JSON format
Documentation

CI PyPI

gldf-rs-python

Python bindings for the gldf-rs GLDF parsing library.

Overview

gldf-rs-python provides Python access to GLDF (General Lighting Data Format) file parsing and manipulation. It wraps the high-performance Rust gldf-rs library using PyO3/maturin.

GLDF files are ZIP containers containing product.xml definitions along with embedded images, photometry files (Eulumdat/IES), and L3D 3D models.

Learn more at: https://gldf.io

Installation

pip install gldf-rs-python

Quick Start

import gldf_rs_python

# Load GLDF and convert to XML
xml = gldf_rs_python.gldf_to_xml('path/to/file.gldf')

# Load GLDF and convert to JSON
json = gldf_rs_python.gldf_to_json('path/to/file.gldf')

# Round-trip: JSON back to XML
xml2 = gldf_rs_python.xml_from_json(json)

assert xml == xml2  # True

Development

# Create virtual environment
python -m venv .venv
source .venv/bin/activate

# Install maturin
pip install maturin

# Build and install in development mode
maturin develop

# Build release wheel
maturin build --release

Live Demo

Try the WASM-based GLDF viewer at: https://gldf.icu

Related Crates

Crate Description
gldf-rs Core Rust library
gldf_rs_wasm WebAssembly viewer application
l3d-rs L3D 3D model format parsing
eulumdat Eulumdat/LDT photometry parsing

Release Notes

0.3.1

  • Updated to gldf-rs 0.3.1 with quick-xml parser
  • Part of gldf-rs monorepo restructure

0.2.0

  • Support for URL file types
  • Support for BOM-encoded UTF8 product.xml

License

MIT License