Crates.io | pta-generator |
lib.rs | pta-generator |
version | |
source | src |
created_at | 2025-04-07 04:11:03.450202+00 |
updated_at | 2025-04-13 16:43:36.534206+00 |
description | Test data generator for PTA applications |
homepage | |
repository | https://github.com/tackler-ng/pta-generator |
max_upload_size | |
id | 1623639 |
Cargo.toml error: | TOML parse error at line 25, column 1 | 25 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
PTA-Generator generates plain text accounting data sets ("journals") for test and demo usage.
It creates journals with or without commodities and journals with audit data for tackler. PTA-Generator can also crete journals of different sizes, and it also supports different journal storing strategies.
Currently it has following features:
comm
: Journal with commodities
plain
: The simplest journal
audit
: Journal with transaction audit data
single
: Single journal
month
: Shard by transaction date
txn
: Shard by transaction (each txn is in own file)
Tools: tackler
For full command line help, see help for each subcommands:
pta-generator help audit
pta-generator help plain
pta-generator help comm
# Generate 10_000 (1e4) txns single file journals under `data` directory
pta-generator plain --path data --set-size 1e4 --shard-type single --flavor tackler
pta-generator plain --path data --set-size 1e4 --shard-type single --flavor ledger
# Run balance report with this test data
tackler --config data/plain/set-1e4-single.toml
ledger -no-pager -f data/plain/set-1e4-single/txns/1e4.journal
hledger -f data/plain/set-1e4-single/txns/1e4.journal
# Generate 10_000 (1e4) txns single file journals under `data` directory
pta-generator comm --path data --set-size 1e4 --shard-type single --flavor tackler
pta-generator comm --path data --set-size 1e4 --shard-type single --flavor ledger
pta-generator comm --path data --set-size 1e4 --shard-type single --flavor beancount
# Run balance report with this test data
tackler --config data/comm/set-1e4-single.toml
ledger -no-pager -f data/comm/set-1e4-single/txns/1e4.journal bal
hledger -f data/comm/set-1e4-single/txns/1e4.journal bal
bean-query data/comm/set-1e4-single/txns/1e4.beancount 'balances from year = 2024'
Tackler can produce cryptographic proofs of used accounting data with reports. Audit mode produce test data for this.
# Generate 10_000 (1e4) audit txns set ("journal") under `data` directory
pta-generator audit --path data --set-size 1e4 --shard-type month
# Run balance report with this test data
tackler --config data/audit/set-1e4-month.toml
To run full account auditing report, do following extra steps:
cd data/audit/set-1e4-month
git init .
git add .
git commit -m "Journal for year 2024"
cd ../../..
tackler --config data/audit/set-1e4-month.toml --input.storage git
This will produce following report:
Git Storage
commit : bd3baa9204607d8ef556dcd480ff10703ccfc168
reference : main
directory : txns
suffix : .txn
message : Journal for year 2024
Txn Set Checksum
SHA-256 : cd00114244ec332d3aac3c301c9c9d04bb2b4e64e7b0d9e336d59cde04e7693f
Set size : 10000
**********************************************************************************
Account Selector Checksum
None : select all
Tackler: 1e4 (10_000) Balance Report
------------------------------------
-13568.0000848 a:ay2024:am01
...
The commit id will change but Txn Set Checksum will be the same. This identifies uniquely all transactions used to produce this report, and git commit id will verify the content of journal. The report is calculated directly from repository data, the working copy is not used for this and the repository could be even bare.
# Latest released version
cargo install --locked pta-generator
# Latest development version
cargo install --locked --git https://github.com/tackler-ng/pta-generator
You can install tackler directly with cargo
:
# Latest released version
cargo install --locked tackler
# Latest development version
cargo install --locked --git https://github.com/tackler-ng/tackler tackler
Full documentation how to install the tools can be found here:
Tackler: Tour of Tackler
Ledger: Download
HLedger: Install
Beancount: Installing Beancount
See Design Documentation for high level description of PTA-Generator and possible extension points.
See Contributing Guidelines and Developer Documention how to work with the PTA-Generator project.
See Security Policy how to report security findings.
PTA-Generator is licensed under the Apache License, version 2.0.