Skip to main content

Luzapp management library

Project description

pyluzapp

Python library for reading and writing LuzApp schedule repositories.

A LuzApp schedule repository is a git-tracked directory of XML files that LuzApp uses to store and sync school timetables. This library lets you read, modify, and export those schedules from Python without running LuzApp itself.

Installation

# TODO: Add local repository instructions
pip install luzapp

Or with uv:

# TODO: Add local repository instructions
uv add luzapp

Requires Python 3.13+.

Quick start

from luzapp import ScheduleRepo

repo = ScheduleRepo("/path/to/school-repo")

# List available weeks
print(repo.list_weeks())  # [1, 2, 3, ...]

# Load lessons for a week
lessons = repo.get_lessons(week_number=1)
for lesson in lessons:
    print(lesson.start_time, lesson.array, lesson.display)

# Export weeks 1–3 to an iCalendar file
ics = repo.export_ics([1, 2, 3])
with open("schedule.ics", "w", encoding="utf-8") as f:
    f.write(ics)

Repository layout

The library expects a directory with the following structure:

<root>/
  config.school          # school configuration (XML)
  weeks/
    week01/
      week01.luzng       # week configuration (XML)
      _obj/
        <id>.luzngl      # one file per lesson (XML)
    week02/
      ...

The weeks/ directory name and config.school filename are configurable:

repo = ScheduleRepo(root_path, config_file="school.xml", weeks_dir="schedule")

Translations

Subject codes and group names are school-specific. Implement Translator in your school package to map them:

from luzapp import DictTranslator

translator = DictTranslator(
    subjects={"MATH": "Mathematics", "ENG": "English"},
    groups={"AlphaGroup": "alpha@school.example.com"},
)

ics = repo.export_ics([1, 2], translator=translator)

DictTranslator covers simple lookup tables. For more complex logic, subclass luzapp.Translator directly.

Creating and modifying lessons

All models are immutable. Use model_copy(update={...}) to produce a modified copy, then save it:

from luzapp import Lesson
from datetime import datetime, timedelta

lesson = Lesson(
    lesson_id=repo.generate_lesson_id(),
    array="MATH",
    subject="Algebra",
    start_time=datetime(2026, 3, 16, 9, 0),
    wanted_length=timedelta(hours=1),
    actual_length=timedelta(hours=1),
    groups=("Alpha",),
    is_critical=True,   # adds "קריטי" to the bizur tags
)

repo.save_lesson(week_number=1, lesson=lesson)

Bizur flags

Three scheduling tags can be set via constructor kwargs or read as properties:

Property Bizur tag Meaning
is_hidden Hidden Excluded from exports and consumer views
is_fake פיקטיבי Placeholder concealing a real event
is_critical קריטי Marked as critical

Syncing via git

from luzapp import git

git.git_pull("/path/to/school-repo")
# ... make changes ...
git.git_push("/path/to/school-repo", message="update week 5")

Development

uv sync
uv run pytest
uv run pytest --cov=src/luzapp   # with coverage

Legal Notice

This library is open-source under the Apache License, with the copyright holder being the State of Israel. However, LuzApp itself is proprietary software, of which usage and modification is restricted to authorized personnel only.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

luzapp-0.1.1.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

luzapp-0.1.1-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file luzapp-0.1.1.tar.gz.

File metadata

  • Download URL: luzapp-0.1.1.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for luzapp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b682e5d450b2122b045bf025837afb3fdbcb01d907d580327d35963913f9c9a4
MD5 d3da0ae43cb4cc495dc2545ee7e4b751
BLAKE2b-256 df0fe1507cc15992fea73a102c63f933630cfca38b886a700fc494f36bdf7c15

See more details on using hashes here.

Provenance

The following attestation bundles were made for luzapp-0.1.1.tar.gz:

Publisher: publish.yml on rootatkali/pyluzapp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file luzapp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: luzapp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for luzapp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d4c7336175303bc5cae738a4ffdec81aa422359fee689e98aa906c8cb8c2fde
MD5 036d673659d9dc262c2547e9bc8a0ce1
BLAKE2b-256 9baaa2e489a2d068c976a865091a5b2f1e20146f129cc96dd36428f68a8b921c

See more details on using hashes here.

Provenance

The following attestation bundles were made for luzapp-0.1.1-py3-none-any.whl:

Publisher: publish.yml on rootatkali/pyluzapp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page