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

Uploaded Python 3

File details

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

File metadata

  • Download URL: luzapp-0.2.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.2.1.tar.gz
Algorithm Hash digest
SHA256 0871016207510cea1ee09b5ee40fae59d24f6fd1592c727a87ab3796115f09ec
MD5 3f0bf10d553cd6b4f3497d5467dc9944
BLAKE2b-256 ad1570985ccf696e7323181a5059e3372d21acfb748c9638d5bd1cc618ce319d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: luzapp-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 25.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c2dcdacf26d14c8803a2c2822691d91865fbc2dee6cd78666e186f8761963078
MD5 077d53f833a79e58f7223511e8702217
BLAKE2b-256 797b3697ed5302e39b9b832e16c44a8c6188f9d3149d346a3652c233c6a17ce7

See more details on using hashes here.

Provenance

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