Skip to content

About

Python console app for managing people, events and enrollments. Layered architecture, file persistence, reports, custom sorting algorithms and unit tests.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Event Manager

A console application written in Python for organizing events and managing their participants. It manages people, events and enrollments. Data is stored in text files, and the app includes reports, random data generation and a unit test suite.

I built it during the 1st semester of my first year at university (2025) for the Fundamentals of Programming course. The UI text is in Romanian.

Features

  • People: add, delete, update, search by ID and list. Each person has an ID, name, address and height.
  • Events: add, delete, update, search by ID and list. Each event has an ID, date, time and description.
  • Enrollments: register a person for an event. Duplicate enrollments are rejected.
  • Cascading deletes: deleting a person or an event also removes their enrollments.
  • Random data generation for people and events
  • Reports:
    1. the events a person attends, sorted by description and then by date
    2. the people who attend the most events
    3. the top 20% of events by number of participants
    4. the 5 events with the fewest participants
  • Persistence: data is saved to and loaded from text files. An in-memory mode can be enabled in app_coordinator.py.
  • Validation with descriptive error messages, for example rejecting events dated in the past

Architecture

The project uses a layered architecture:

Layer Folder Responsibility
Domain domain/ Entities (Person, Event, Enrollment), DTOs used by the reports, validators, custom exception hierarchy
Repository repository/ In-memory repositories, and file-backed repositories that extend them
Service service/ Business logic, cascading deletes, reports, random generation
UI ui/ Text-based console interface
Utils utils/ Hand-written selection sort and cocktail shaker sort. Both support key, a custom comparator and reverse, like Python's built-in sorted.

The layers are wired together in app_coordinator.py. Each service receives its validator and repositories through its constructor.

Running

The app needs Python 3.10 or newer and no external packages.

Run it from the project folder, because the data files are opened with relative paths:

python app_coordinator.py

Commands: adauga (add), sterge (delete), modifica (update), cauta (search), afiseaza (list), genereaza (generate), rapoarte (reports) and exit.

Tests

The project has 35 unit tests written with unittest. They cover the entities, validators, repositories and services.

python -m unittest tests.teste

Project structure

app_coordinator.py     # entry point, wires the layers together
domain/                # entities, validation, exceptions
repository/            # in-memory and file repositories
service/               # business logic and reports
ui/                    # console interface
utils/                 # custom sorting algorithms
tests/                 # unit tests
persoane.txt           # stored people
evenimente.txt         # stored events
inscrieri.txt          # stored enrollments
lista_*.txt            # sample names, addresses and descriptions used for random generation

Notes

  • The random generators are implemented recursively, so very large batches (around 1,000 items or more) hit Python's recursion limit.
  • All people in the data files are fictional.

About

Python console app for managing people, events and enrollments. Layered architecture, file persistence, reports, custom sorting algorithms and unit tests.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages