Metadata-Version: 2.4
Name: moneymanager-parser
Version: 0.1.0
Summary: Typed parser and query SDK for Realbyte Money Manager .mmbak backups.
Project-URL: Homepage, https://github.com/shubham1172/moneymanager-parser
Project-URL: Repository, https://github.com/shubham1172/moneymanager-parser
Project-URL: Issues, https://github.com/shubham1172/moneymanager-parser/issues
Author-email: Shubham Sharma <shubhamsharma1172@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: finance,mmbak,money-manager,realbyte,sqlite
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.2; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# moneymanager-parser

[![CI](https://github.com/shubham1172/moneymanager-parser/actions/workflows/ci.yml/badge.svg)](https://github.com/shubham1172/moneymanager-parser/actions/workflows/ci.yml)
![PyPI](https://img.shields.io/badge/PyPI-unpublished-lightgrey)

Typed Python SDK and offline CLI for Realbyte Money Manager `.mmbak` exports.

A `.mmbak` export is a ZIP-wrapped SQLite database. This package reads the export locally,
resolves common schema aliases across app versions, and exposes transactions, summaries, flexible
queries, schema inspection, categories, accounts, and currencies. Core parsing uses only the Python
standard library. Income is exposed by the API, but expense-oriented analysis should treat it as
informational because Money Manager exports can vary by installation.

The backup's currencies are read from the `CURRENCY` table when present. `currency()` returns the main
currency (`ISO`, `symbol`, `name`); amounts are stored in the account/transaction currency and are not
converted.

## Install

After the first release:

```bash
pip install moneymanager-parser
```

## Quickstart

```python
from moneymanager_parser import MoneyManagerBackup

with MoneyManagerBackup.from_file("backup.mmbak") as backup:
    main = backup.currency()
    if main:
        print(main.iso, main.symbol)
    for txn in backup.transactions():
        print(txn.date, txn.kind, txn.category, txn.amount)
    print(backup.query(month="2026-01", group_by="category").as_dict())
```

Custom transaction type maps are supported:

```python
MoneyManagerBackup.from_file("backup.mmbak", type_map={0: "income", 1: "expense", 7: "transfer"})
```

## CLI

```bash
mmbak query backup.mmbak --month 2026-01 --group-by category --top 10
mmbak schema backup.mmbak
mmbak currency backup.mmbak
```

All commands print JSON and never contact external services.

## Development

```bash
python3 -m venv .venv
. .venv/bin/activate
pip install -e '.[dev]'
ruff check .
ruff format --check .
mypy src
pytest --cov
```

## Contributing

Issues and pull requests are welcome. Please include tests for schema variants and avoid committing
personal exports; test backups should be generated synthetically.

## License

MIT © 2026 Shubham Sharma
