Metadata-Version: 2.4
Name: accountr
Version: 0.1.1
Summary: A simple accounting application built with Python, Streamlit, and SQLAlchemy
Author-email: Nicolas Jacquemin <n.jacquemin1993@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Your Name
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/njacquemin1993/accounting
Project-URL: Bug Tracker, https://github.com/njacquemin1993/accounting/issues
Project-URL: Repository, https://github.com/njacquemin1993/accounting
Keywords: accounting,bookkeeping,streamlit,finance
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial :: Accounting
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: streamlit>=1.52.0
Requires-Dist: sqlalchemy>=2.0.23
Requires-Dist: pandas>=2.1.4
Requires-Dist: plotly>=5.17.0
Requires-Dist: xlsxwriter>=3.1.9
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: ruff>=0.14.8; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Dynamic: license-file

# Simple Accounting App

A simple accounting application built with Python, Streamlit, and SQLAlchemy.

## Features

- **Multi-language Support**: Available in English, French, and German
- **Chart of Accounts Management**: Add, edit, and manage accounts categorized as Active (Assets), Passive (Liabilities/Equity), Expenses, and Products (Revenue)
- **Journal Entries**: Record double-entry bookkeeping transactions with validation
- **Account Balances**: View balances for all accounts with filtering and detailed transaction history
- **Balance Sheet**: Generate and view balance sheet with automatic balance validation
- **Result Sheet (Income Statement)**: View revenue and expenses with net income calculation
- **Excel Export**: Export all accounting data to formatted Excel workbooks
- **Database Management**: Backup, restore, and manage database files
- **Year-End Closing**: Automated year-end closing with comprehensive backup packages

## Technologies Used

- **Frontend**: Streamlit for web interface
- **Database**: SQLite with SQLAlchemy ORM
- **Data Processing**: Pandas for data manipulation and analysis
- **Export**: XlsxWriter for Excel report generation
- **Visualization**: Plotly for charts (if needed)

## Installation

### From PyPI (Recommended)
```bash
pip install accountr
```

### From Source
1. Clone or download this repository
2. Install the package in development mode:
   ```bash
   pip install -e .
   ```

## Usage

### After Installation from PyPI
```bash
accounting-app
```

### From Source or Development
```bash
python main.py
```

Or alternatively:
```bash
streamlit run src/accounting/app.py
```

2. Open your web browser and navigate to the URL shown in the terminal (usually `http://localhost:8501`)

3. Select your preferred language from the dropdown (English, French, or German)

## Application Structure

The application follows a modular architecture with clear separation of concerns:

### Core Modules (`src/accounting/`)
- `app.py`: Main Streamlit application entry point with navigation
- `database.py`: SQLAlchemy models (Account, JournalEntry) and database configuration
- `constants.py`: Centralized configuration values and magic numbers
- `helpers.py`: Common helper functions for validation and formatting
- `accounting_utils.py`: Business logic for accounting calculations (balance, trial balance, etc.)
- `translation_utils.py`: Multi-language support utilities (English, French, German)
- `translations.py`: Translation strings for all supported languages

### Page Modules (`src/accounting/pages/`)
- `chart_of_accounts_page.py`: Chart of Accounts management
- `journal_entries_page.py`: Journal entry recording and editing
- `account_balances_page.py`: Account balance viewing with filtering
- `result_sheet_page.py`: Income Statement (Result Sheet) generation
- `balance_sheet_page.py`: Balance Sheet generation with validation

### File Management
- `database_switcher.py`: Database backup, restore, and file operations
- `database_management_ui.py`: UI components for file management and year-end closing
- `excel_utils.py`: Excel formatting utilities and configuration
- `excel_export.py`: Excel export logic for all accounting reports

### Database
- Default database stored in `src/accounting/server_files/`
- `requirements.txt`: Legacy dependency file (now replaced by `pyproject.toml`)

## Database

The application uses SQLite for data storage. The database file (`accounting.db`) will be created automatically in the same directory as the application.

## Features Overview

### Chart of Accounts Tab
- View all active accounts in a table format
- Add new accounts with account codes, names, types, and categories
- Deactivate accounts (soft delete)

### Journal Entries Tab
- View recent journal entries
- Add new journal entries with double-entry validation
- Select debit and credit accounts from dropdown menus

### Account Balances Tab
- View balances for all accounts
- Filter by category or account type
- Summary metrics showing totals by account type

### Balance Sheet Tab
- Traditional balance sheet format
- Shows Assets on the left, Liabilities and Equity on the right
- Automatic balance validation (Assets = Liabilities + Equity)

## Code Quality

This project follows professional coding standards:
- **No Magic Numbers**: All configuration values centralized in `constants.py`
- **DRY Principle**: Common functionality extracted into helper modules
- **Separation of Concerns**: Clear boundaries between UI, business logic, and data layers
- **Modular Architecture**: Focused modules with single responsibilities
- **Type Hints**: Function signatures include type information where appropriate
- **Documentation**: Functions include docstrings explaining purpose and parameters
