Skip to main content

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

GLDF Viewer

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

Converting LDT/IES to GLDF

import gldf_rs_python

# Convert LDT to GLDF JSON
with open("luminaire.ldt", "rb") as f:
    gldf_json = gldf_rs_python.ldt_to_gldf_json(f.read(), "luminaire.ldt")

# Convert LDT to GLDF file
with open("luminaire.ldt", "rb") as f:
    gldf_bytes = gldf_rs_python.ldt_to_gldf_bytes(f.read(), "luminaire.ldt")
    with open("luminaire.gldf", "wb") as out:
        out.write(gldf_bytes)

# Works with IES files too
with open("luminaire.ies", "rb") as f:
    gldf_json = gldf_rs_python.ldt_to_gldf_json(f.read(), "luminaire.ies")

Working with GLDF Bytes

import gldf_rs_python

# Load GLDF from bytes (useful for web apps, streaming)
with open("product.gldf", "rb") as f:
    json_data = gldf_rs_python.gldf_from_bytes(f.read())

# Export GLDF JSON back to bytes
gldf_bytes = gldf_rs_python.gldf_json_to_bytes(json_data)

API Reference

Function Description
gldf_to_xml(path) Load GLDF file and convert to XML string
gldf_to_json(path) Load GLDF file and convert to JSON string
json_from_xml_str(xml_str) Parse XML string to JSON
xml_from_json(json_str) Parse JSON string to XML
gldf_from_bytes(data) Load GLDF from bytes and return JSON
ldt_to_gldf_json(data, filename) Convert LDT/IES to GLDF JSON
ldt_to_gldf_bytes(data, filename) Convert LDT/IES to GLDF bytes (ZIP)
gldf_json_to_bytes(json_str) Export GLDF JSON to bytes (ZIP)

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

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.3

  • New: ldt_to_gldf_json() - Convert LDT/IES photometry to GLDF JSON
  • New: ldt_to_gldf_bytes() - Convert LDT/IES photometry to GLDF bytes (ZIP)
  • New: gldf_from_bytes() - Load GLDF from bytes and return JSON
  • New: gldf_json_to_bytes() - Export GLDF JSON to bytes (ZIP)
  • Improved error handling with proper PyValueError exceptions
  • Added eulumdat feature for LDT/IES conversion support

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

Metadata

Release files for gldf-rs-python 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gldf-rs-python 0.5.1
File Size Uploaded Provenance Actions
gldf_rs_python-0.5.1.tar.gz 419.6 kB With provenance Details for gldf_rs_python-0.5.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for gldf-rs-python 0.5.1
File Actions
gldf_rs_python-0.5.1-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for gldf_rs_python-0.5.1-cp38-abi3-win_amd64.whl
gldf_rs_python-0.5.1-cp38-abi3-musllinux_1_2_x86_64.whl CPython 3.8 abi3 Linux musl 1.2+ x86-64 Details for gldf_rs_python-0.5.1-cp38-abi3-musllinux_1_2_x86_64.whl
gldf_rs_python-0.5.1-cp38-abi3-musllinux_1_2_aarch64.whl CPython 3.8 abi3 Linux musl 1.2+ ARM64 Details for gldf_rs_python-0.5.1-cp38-abi3-musllinux_1_2_aarch64.whl
gldf_rs_python-0.5.1-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details for gldf_rs_python-0.5.1-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
gldf_rs_python-0.5.1-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details for gldf_rs_python-0.5.1-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
gldf_rs_python-0.5.1-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for gldf_rs_python-0.5.1-cp38-abi3-macosx_11_0_arm64.whl
gldf_rs_python-0.5.1-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details for gldf_rs_python-0.5.1-cp38-abi3-macosx_10_12_x86_64.whl

Total release size: 26.7 MB

Release files / gldf_rs_python-0.5.1.tar.gz

Download URL gldf_rs_python-0.5.1.tar.gz
Size 419.6 kB
Tags Source
SHA-256 checksum
How to use checksums
307f209ef481ced7ff760e427c807cc01bce3fdbc64339861a5be23e1f5eafab
BLAKE2b-256 checksum
How to use checksums
3294a51913bd8334202a4b4c148d6996eaf53b2e4e2a9f63a0f78f32ad4d6665
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / gldf_rs_python-0.5.1-cp38-abi3-win_amd64.whl

Download URL gldf_rs_python-0.5.1-cp38-abi3-win_amd64.whl
Size 3.5 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
5d10d222530f541ed49fc62f8971e9cdef25dc3a5da985ccf9cf50888d6c0766
BLAKE2b-256 checksum
How to use checksums
a260ac125377ca311db5c925778a7109c1f046336ecd51a47646bf7831d03d2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / gldf_rs_python-0.5.1-cp38-abi3-musllinux_1_2_x86_64.whl

Download URL gldf_rs_python-0.5.1-cp38-abi3-musllinux_1_2_x86_64.whl
Size 4.2 MB
Tags CPython 3.8 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
639ee66b7bd22ccb2b9f7fb4e4b0edd9cc22fabb02c6c4e9cb8d4e8737afee32
BLAKE2b-256 checksum
How to use checksums
c1891fd8ed58bef512901a99a4c9535bdb29bc14a4af1b1143358ef2cde882e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / gldf_rs_python-0.5.1-cp38-abi3-musllinux_1_2_aarch64.whl

Download URL gldf_rs_python-0.5.1-cp38-abi3-musllinux_1_2_aarch64.whl
Size 4.0 MB
Tags CPython 3.8 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
6c41c7dfed1162a2e2620e698496fb7e6524375a38a2473dce3ea2a28127d89b
BLAKE2b-256 checksum
How to use checksums
2340810c1892c46700e35134f7b91aac9203da7b35ccb152e28933eee9d533d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / gldf_rs_python-0.5.1-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL gldf_rs_python-0.5.1-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 3.9 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
022617a6b292885a40ce2288e84bf48607cce65f0a84a44c76df6f83fd957e0c
BLAKE2b-256 checksum
How to use checksums
ef0b70f0a2c1e210d3554e4f145c802bb73ef3f94322ac7a645ce39e7b770383
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / gldf_rs_python-0.5.1-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL gldf_rs_python-0.5.1-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 3.8 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
cd33db9750ba6f2ffabf2adf6b03cf27a05f04d7cada765cb8b555286b72017d
BLAKE2b-256 checksum
How to use checksums
6f80a5a4d10ff2f8e80cccf1ffaee1023a658c64313a0c2c0aef3477452fb5ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / gldf_rs_python-0.5.1-cp38-abi3-macosx_11_0_arm64.whl

Download URL gldf_rs_python-0.5.1-cp38-abi3-macosx_11_0_arm64.whl
Size 3.4 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cec7a1c9a11bd1b909c93e3e732654868e7832299915d9cb7c5163987320d3c3
BLAKE2b-256 checksum
How to use checksums
b9e65b2dbaca308cc206290d3d6d6dadae5ca0edffbc1a588e8709e0263211ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / gldf_rs_python-0.5.1-cp38-abi3-macosx_10_12_x86_64.whl

Download URL gldf_rs_python-0.5.1-cp38-abi3-macosx_10_12_x86_64.whl
Size 3.5 MB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
273f6a165ea023009a0ca7ff72fed64efd3f56d27557ec8ec436ac82c19d69cc
BLAKE2b-256 checksum
How to use checksums
5378225866be820588ab4ff17e02498d2da28072ef5a2957a4ba8d28476d36a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for gldf-rs-python 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for gldf_rs_python-0.5.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page