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.2.0.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.2.0-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: luzapp-0.2.0.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.2.0.tar.gz
Algorithm Hash digest
SHA256 32be1c18aef7cca87327c9bea7921953d07e9679b974644abbb850dbeca9d2a6
MD5 838ac450deb1d2c0206834c9b2c5d45a
BLAKE2b-256 14013c4903ad21adb55a7a4396e372b808b1c9ffac4bc8b6b9ca5d0eb852ec5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for luzapp-0.2.0.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: luzapp-0.2.0-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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e63e6747626fea88b8c076da84d8090d163386ed88f11ac555b711c866cc0d3
MD5 0ee0eba7893eefa863973b8c9ba8b788
BLAKE2b-256 7777b61ed36b0c7965aacb250745c47c25f3777bbaf472ed9b09416ec82e24f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for luzapp-0.2.0-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