Metadata-Version: 2.5
Name: protobean
Version: 0.3.0
Summary: Generated Python bindings for Beancount protobuf schemas.
Project-URL: Repository, https://github.com/otaj/protobean
License-Expression: GPL-3.0-only
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: protobuf>=6.33.5
Description-Content-Type: text/markdown

# protobean

Protobuf schemas for [Beancount](https://beancount.github.io/) ledgers, plus generated [Dart](https://dart.dev/) and [Python](https://www.python.org/) packages (`protobean`) that bind those messages.

The schemas cover a **parsed** ledger (parser output, including elided amounts and parse-time cost specs) and a **processed** ledger (booked, interpolated, and consistency-checked).

## Protobuf

Sources live under `proto/beancount/`. Lint and format with [Buf](https://buf.build/) 1.72.0 (see `buf.yaml`):

```bash
buf lint
buf format --diff --exit-code
```

## Dart package

Generated code is not committed. After `fvm use` (or otherwise putting Dart on `PATH`) and installing Buf:

```bash
./tool/generate_dart.sh
dart pub get
dart analyze --fatal-infos
```

```dart
import 'package:protobean/protobean.dart';
```

The Dart SDK is pinned via FVM in `.fvmrc`.

## Python package

Generated code is not committed. After installing [uv](https://docs.astral.sh/uv/) and Buf:

```bash
./tool/generate_python.sh
uv sync --group dev
uv run ruff check
uv run ruff format --check
```

```python
from protobean import ledger_pb2
```

The Python version is pinned in `.python-version`.

## Contributing

Commits follow [Conventional Commits](https://www.conventionalcommits.org/) and should be atomic (one concern each). Local hooks are in `.pre-commit-config.yaml`.

Every pull request either adds **one** changelog line under `## [Unreleased]` in `CHANGELOG.md`, or cuts a release.

An entry line is the squash-merge subject (the PR title) and the PR number:

```markdown
- feat(proto): add processed ledger messages (#12)
```

Put that line in its **own** commit that only touches `CHANGELOG.md`. Open the PR first so you have a number, then add the changelog commit.

A release PR bumps the version in both `pubspec.yaml` and `pyproject.toml` and moves every Unreleased bullet under `## [<version>] - YYYY-MM-DD`, leaving Unreleased empty. Publishing a `v*` tag fails unless Unreleased is empty.

CI runs `./tool/check-changelog.sh` and rejects PRs that skip this.

## License

[GPL-3.0](LICENSE)
