AmEle: simple condo manager

AmEle is a small Streamlit application for managing a condominium archive with a hierarchical structure:

The app lets you work on the data through a graphical interface, saving it to the data.json file.

AmEle screenshot

Project structure

Data model

The hierarchy is as follows:

Class diagram

classDiagram
    class CondominiumArchive {
        +condominiums: list[Condominium]
        +total_balance()
        +total_buildings()
        +total_apartments()
    }

    class Condominium {
        +name: str
        +address: str
        +notes: str
        +transactions: list[Transaction]
        +buildings: list[Building]
        +balance()
        +total_balance()
    }

    class Building {
        +name: str
        +notes: str
        +transactions: list[Transaction]
        +apartments: list[Apartment]
        +balance()
        +total_balance()
    }

    class Apartment {
        +code: str
        +unit: str
        +floor: str
        +area_sqm: float
        +shares: float
        +notes: str
        +transactions: list[Transaction]
        +balance()
    }

    class Person {
        +first_name: str
        +last_name: str
        +phone: str
        +email: str
        +tax_code: str
        +full_name
    }

    class Transaction {
        +description: str
        +amount: float
        +type: str
        +transaction_date: str
    }

    CondominiumArchive "1" --> "*" Condominium
    Condominium "1" --> "*" Building
    Building "1" --> "*" Apartment
    Condominium "1" --> "*" Transaction
    Building "1" --> "*" Transaction
    Apartment "1" --> "*" Transaction
    Apartment "1" --> "1" Person : owner
    Apartment "1" --> "1" Person : occupant

Balances

Balances are kept separate per level:

So:

Main features

The app is organized into three sections:

In each section you can:

Main flow

flowchart TD
    A[Start Streamlit app] --> B[Load data.json]
    B --> C[Choose section: Condominiums, Buildings, Apartments]
    C --> D[Select current component]
    D --> E[User action]
    E --> F[Add, edit, or delete]
    E --> G[Manage statement]
    E --> H[Open export dialog]
    F --> I[Save to data.json]
    G --> I
    H --> L[Choose format: PDF, Word, or Excel]
    L --> N[Download the file]
    I --> M[Reload interface with updated state]

Statements

Each section also contains the statement of the selected component. From here you can:

Owner and occupant

Both an owner and an occupant are managed for every apartment.

Rule used in the app:

Document export

From every section you can export the selected component by opening a dedicated dialog:

Available formats:

Exported documents contain:

Export flow diagram

flowchart TD
    A[Click Export condominium/building/apartment] --> B[Open Export dialog]
    B --> C[Download PDF]
    B --> D[Download Word]
    B --> E[Download Excel]
    C --> F[Close dialog and download]
    D --> F
    E --> F

Data file compatibility

Data is saved to data.json.

The loader in models.py also handles data normalization:

Requirements

Python dependencies:

You can install them with:

pip install -r requirements.txt

Running the app

Create and activate a virtual environment, install the dependencies, then start the app:

python3 -m venv .venv
source .venv/bin/activate  # on Windows: .venv\Scripts\activate
pip install -r requirements.txt
streamlit run app.py

If you already have a virtual environment, just activate it first, or call the correct binary directly.

Generated and ignored files

The repository includes a .gitignore that ignores:

Practical notes