Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python License

✨ EvoParse

Parse DIALux EVO project files (ISO 10303-21 / STEP) into type-safe Pydantic models.
.dat.py → validated Python objects


📖 Overview

EvoParse reads .evo / .dat project files exported by DIALux EVO (lighting design software) in the ISO 10303-21 (STEP) format and converts them into fully-typed Pydantic v2 models.

What you can do:

  • 🔍 Inspect project structure programmatically (scenes, luminaires, spaces, materials)
  • 🧪 Write automated tests that validate project data
  • 🔄 Generate Python model code from the XML schema shipped with DIALux
  • 🏗️ Build CI/CD pipelines that check project data integrity

🚀 Quickstart

# ── Install ──
pip install evoparse

# ── Parse a .dat file ──
python -m evoparse.parse_project MyProject.dat

Output:

ObjectManager: next_id=55
  30 collections, 18 total objects
    InstanceObject (12): ControlGroup, FloorElement, LightScene, ...
    RelAggregates (1): RelAggregates
    RelContainedInSpatialStructure (1): RelContainedInSpatialStructure
    ...

📦 What's inside

Module Purpose
evoparse.models 50+ Pydantic models matching the DIALux EVO XML schema
evoparse.generate_models Code generator: ProjectData.xmlmodels.py
evoparse.parse_project STEP parser: ProjectData.dat → model instances

🔧 Usage Examples

Programmatic access

from evoparse import parse_project as pp

# Load the full project graph
result = pp.load_project("ProjectData.dat")

# Find the Project object
for cls, items in result.object_collections:
    for item in items:
        if type(item).__name__ == "Project":
            print(f"ID: {item.object_id}")
            print(f"Property sets: {len(item.property_sets)}")
            # Each property set is a typed Pydantic model
            for ps in item.property_sets:
                print(f"  - {type(ps).__name__}")

Inspecting a light scene

from evoparse import parse_project as pp

result = pp.load_project("ProjectData.dat")

for cls, items in result.object_collections:
    for item in items:
        if type(item).__name__ == "LightScene":
            ls = item
            print(f"Active: {ls.is_active}, Default: {ls.is_default}")
            print(f"CoordSys: {ls.local_coord_sys.origin}")

Regenerating models from XML

python -m evoparse.generate_models ProjectData.xml -o models.py

🧪 Running Tests

# Install dev dependencies
pip install pytest pytest-cov ruff

# Run all tests
pytest

# With coverage
pytest --cov=evoparse --cov-report=term-missing

Test structure:

Test file What it covers
tests/test_models.py All 50+ models match the XML schema (175 tests)
tests/test_generate_models.py Code generator functions (58 tests)
tests/test_parse_project.py STEP tokenizer, parser, type coercion, full pipeline (75 tests)

Current status: ✅ 308 tests passing


🏗️ Project Structure

evoparse/
├── evoparse/
│   ├── __init__.py
│   ├── models.py              # Pydantic models (50+ classes)
│   ├── generate_models.py     # XML → Python code generator
│   └── parse_project.py       # STEP file parser
├── tests/
│   ├── test_models.py
│   ├── test_generate_models.py
│   └── test_parse_project.py
├── ProjectData.xml            # DIALux EVO schema definition
├── ProjectData.dat            # Example project data
├── pyproject.toml
└── README.md

🤝 How to Contribute

  1. Fork the repository
  2. Create a branch (git checkout -b feature/my-idea)
  3. Make your changes — keep the coding style consistent (no comments, concise)
  4. Run tests (pytest) — all 308 must pass
  5. Lint with ruff (ruff check .)
  6. Open a Pull Request

Guidelines

  • ✏️ Follow existing patterns (naming, imports, type annotations)
  • 🧪 Add tests for any new functionality
  • 📝 Keep the README updated if you change the public API
  • 🚫 Never commit secrets or .dat files with sensitive data

📄 License

MIT © Luciodias

About

Parse DIALux EVO project files (.dat/.evo) into type-safe Pydantic models with Python.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages