Metadata-Version: 2.4
Name: moneywiz-db-api
Version: 0.1.1
Summary: A Python api to access moneywiz sqlite database (fork of moneywiz-api)
Author-email: philoveritas <philoveritas@example.com>
Maintainer-email: philoveritas <philoveritas@example.com>
Project-URL: Homepage, https://github.com/philoveritas/moneywiz-api
Project-URL: Bug Tracker, https://github.com/philoveritas/moneywiz-api/issues
Project-URL: Original Project, https://github.com/ileodo/moneywiz-api
Keywords: moneywiz,sqlite,personal-finance,database-api
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.3.1
Requires-Dist: pandas
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# moneywiz-db-api

> 这是 [moneywiz-api](https://github.com/ileodo/moneywiz-api) 的 fork 版本。
> 原项目已数月未更新，此版本用于持续维护和功能增强。感谢原作者 [iLeoDo](https://github.com/ileodo) 的贡献。

![Static Badge](https://img.shields.io/badge/Python-3-blue?style=flat&logo=Python)
![PyPI](https://img.shields.io/pypi/v/moneywiz-db-api)

A Python API to access MoneyWiz Sqlite database.

## Get Started

```bash
pip install moneywiz-db-api
# 或使用 uv
uv add moneywiz-db-api
```

```python
from pathlib import Path
from moneywiz_api import MoneywizApi

# macOS 默认数据库路径
DB_PATH = Path("~/Library/Containers/com.moneywiz.personalfinance"
               "/Data/Documents/.AppData/ipadMoneyWiz.sqlite").expanduser()

with MoneywizApi(DB_PATH) as api:
    # 获取所有交易
    transactions = api.transaction_manager.get_all()

    # 获取所有分类
    categories = api.category_manager.get_all()

    # 查询无分类交易
    uncategorized = api.transaction_manager.get_uncategorized()

# 或指定其他路径
with MoneywizApi(Path("/path/to/ipadMoneyWiz.sqlite")) as api:
    record = api.accessor.get_record(record_id)
    print(record)
```

## Interactive CLI

本包提供交互式命令行工具 `moneywiz-cli`：

```bash
# 使用默认数据库路径
moneywiz-cli

# 指定数据库路径
moneywiz-cli /path/to/moneywiz.sqlite
```

## 文档

完整接口参考（含所有 Manager 方法、数据模型字段、使用示例及 AI Agent 调用指引）：

[docs/api-reference.md](docs/api-reference.md)

## Contribution

This project is in very early stage, all contributions are welcomed!
