Metadata-Version: 2.4
Name: katicas
Version: 0.1.5
Summary: Шаблоны Python-приложений для демонстрационного экзамена: PostgreSQL, Tkinter, авторизация, CRUD.
Author: Demo Exam Student
License: MIT
Keywords: demo-exam,crud,postgresql,tkinter,template
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: psycopg2-binary>=2.9.9
Requires-Dist: openpyxl>=3.1.2

# katicas

`katicas` is a PyPI-ready helper library for building demo exam desktop apps in Python.
It is domain-neutral: the same code can become a shoe store, restaurant, zoo, library, hotel, clinic, or warehouse app by changing a JSON specification.

## What it gives you

- PostgreSQL connection helper for pgAdmin-created databases.
- Login by `login` and `password` from a `users` table.
- Role-based access: guest, client, manager, administrator.
- Tkinter UI with required exam-style screens: login, entity list, search, filtering, sorting, CRUD.
- SQL generator for users, roles and your main entities.
- Import helper for official exam `.xlsx`, `.csv` and `.txt` files.
- Project generator: `demexam-new`.

Russian documentation:

- `GUIDE_RU.md` - detailed usage, exam workflow and PyPI notes.
- `MODULES_RU.md` - explanation of every module.
- `examples/custom_template.json` - blank domain template.

Each generated project also contains:

- `01_ALGORITHM.md` - step-by-step exam workflow.
- `02_DATABASE_3NF.md` - database and 3NF checklist.
- `03_AUTH.md` - login window and role checklist.
- `04_IMPORT_EXCEL.md` - Excel/CSV import checklist.
- `05_DB_CONNECTION.md` - PostgreSQL connection checklist.
- `06_MODELS.md` - models, entities and fields.
- `07_PAGES_TRANSITIONS.md` - screens and navigation.
- `08_ROLE_PAGES.md` - what guest/client/manager/admin see.
- `09_MODULES_MAP.md` - where every module lives.
- `10_FINAL_CHECKLIST.md` - final submission checklist.
- `11_FLOWCHARTS.md` - flowchart templates for auth, CRUD, import and app logic.

## Install locally while testing

```bash
pip install -e .
```

After publishing to PyPI:

```bash
pip install katicas
```

## Generate an exam project

```bash
demexam-new --preset store --out my_exam_app
cd my_exam_app
python app.py
```

Or use your own domain file:

```bash
demexam-new --spec restaurant.json --out restaurant_app
```

The generated project is standalone: it contains a local `examlib` folder, so the app does not break after removing the installed generator package.

## Database environment variables

```bash
set DEMEXAM_DB_NAME=demo_exam
set DEMEXAM_DB_USER=postgres
set DEMEXAM_DB_PASSWORD=postgres
set DEMEXAM_DB_HOST=localhost
set DEMEXAM_DB_PORT=5432
```

On PowerShell:

```powershell
$env:DEMEXAM_DB_NAME="demo_exam"
$env:DEMEXAM_DB_USER="postgres"
$env:DEMEXAM_DB_PASSWORD="postgres"
```

Run generated SQL in pgAdmin first:

```bash
python app.py --print-sql
```

Then import official exam files from the `Импорт` folder:

```bash
python app.py --import-dir "Импорт"
```

The generated `schema.sql` does not add fake business rows. If you need quick demo rows for local testing only:

```bash
python app.py --print-sql --with-sample-data
```

Before leaving the exam computer, if required by the rules:

```bash
pip uninstall katicas -y
```

Do not delete the generated project files you wrote for the solution.

## Domain idea

The task changes words, not the architecture:

- Store: products, orders, clients.
- Restaurant: dishes, tables, bookings/orders.
- Zoo: animals, enclosures, visits.
- Library: books, readers, loans.

Change `spec.json`, keep the code.

## Important

No package can guarantee passing an exam by itself. This library is meant to save time on repetitive CRUD, auth, PostgreSQL and Tkinter structure so you can adapt the app quickly to the exact task.
