PYPI PACKAGE AUDIT v0.5.1 Gesundes Paket

gldf-rs-python

Python-Bindungen für die GLDF-Parsing-Bibliothek (General Lighting Data Format)

PyPkgScore gldf-rs-python
Methodik & Kriterien ♥ Donate
770 / 1000
Schnellinstallation
pip install gldf-rs-python
1. Governance
50/200
2. PEP-Metadaten
200/200
3. Sicherheit
200/200
4. Doku & SEO
155/200
5. CI-Engineering
165/200
📣 Prüfung teilen: Teilen Sie diesen Bericht und die Vorschau in der aktuellen Sprache
Advertisement
PYPI-TELEMETRIE

Downloads & Community-Verbreitung

Letzte 30 Tage (ohne Spiegelserver)
Letzte 7 Tage
476
Letzte 30 Tage
731
Gesamt (180 Tage)
1847
Metrik / Ökosystem Status / Wert Quelle
Downloads (30d / 180d) — PyPI Stats (without mirrors)
Trusted Publishing (PEP 740) ✓ Verified OIDC PyPI Integrity / Sigstore
Django Packages — djangopackages.org
PyTech / PyPkgScore 770 / 1000 PyPkgScore Engine

Gesundheits- & Engineering-Analyse (5 Säulen)

1. Governance & Community50 / 200 ▾
LICENSE✓ 50 pts
SECURITY.md✕ 0 pts
CONTRIBUTING.md✕ 0 pts
CODE_OF_CONDUCT.md✕ 0 pts
2. PEP-Metadaten & Paketierung200 / 200 ▾
Wheel (.whl)✓ 50 pts
pyproject.toml✓ 50 pts
Project URLs✓ 50 pts
Trove Classifiers✓ 50 pts
3. Sicherheit & Lieferkette200 / 200 ▾
Null CVEs (OSV)✓ 60 pts
Trusted Publishing (OIDC)✓ 50 pts
Snyk / Audit Link✓ 40 pts
HTTPS-Repository✓ 50 pts
4. Dokumentation, SEO & Ökosystem155 / 200 ▾
Strukturierte README✓ 60 pts
Read the Docs✓ 50 pts
Django Packages✕ 0 pts
Webseite / Fachartikel✓ 45 pts
5. Engineering, CI & Qualität165 / 200 ▾
Automatisierte Tests✓ 65 pts
GitHub Actions CI✓ 65 pts
CHANGELOG.md✓ 35 pts
Env & Lockfile (uv/rye/poetry/pdm/hatch)✕ 0 pts
Advertisement
README & DOCS

Offizielle Dokumentation & Nutzungsleitfaden — gldf-rs-python

PyPI Metadata v0.5.1
Vollständige Originaldokumentation anzeigen (Englisches README) ▾

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

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