{"id":47819090,"url":"https://github.com/filiphanes/awk-pta","last_synced_at":"2026-04-03T19:01:37.420Z","repository":{"id":39731760,"uuid":"507162804","full_name":"filiphanes/awk-pta","owner":"filiphanes","description":"Plain text accounting in awk","archived":false,"fork":false,"pushed_at":"2024-10-19T21:39:50.000Z","size":36,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-20T17:09:07.683Z","etag":null,"topics":["awk","beancount","ledger","plaintext-accounting"],"latest_commit_sha":null,"homepage":"","language":"Awk","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/filiphanes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-24T22:52:14.000Z","updated_at":"2024-10-19T21:39:53.000Z","dependencies_parsed_at":"2023-02-10T18:00:20.917Z","dependency_job_id":null,"html_url":"https://github.com/filiphanes/awk-pta","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/filiphanes/awk-pta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filiphanes%2Fawk-pta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filiphanes%2Fawk-pta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filiphanes%2Fawk-pta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filiphanes%2Fawk-pta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/filiphanes","download_url":"https://codeload.github.com/filiphanes/awk-pta/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filiphanes%2Fawk-pta/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31371636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["awk","beancount","ledger","plaintext-accounting"],"created_at":"2026-04-03T19:01:02.620Z","updated_at":"2026-04-03T19:01:37.401Z","avatar_url":"https://github.com/filiphanes.png","language":"Awk","readme":"# Plain text accounting with AWK\nPlaintext accounting with plaintext scripts without installing additional software.\n\n## Features\n\n- balance report\n- register report\n- print report\n- filtering transactions\n- group by month report\n- filtering postings\n- accounts list\n- timelog\n- periodic transactions\n- awk's `-M` option calculates with arbitrary precision arithmetic \n- 2-3x faster that ledger with single currency (4x faster using mawk).\n- commodities as account prefix (EUR:assets:cash)\n- TODO:\n  - validating input file\n  - equity report\n  - commodity pricing\n\n# Ideas\n\n- Simple dependencies: gnu awk, gnu date, sort.\n- Simple development or customization: no compilation.\n- Small readable scripts.\n- Filtering language using awk syntax\n- Can be kept and customized directly in your accounting repo.\n- Awk knowledge is reusable in other tasks, unlike ledger specific syntax.\n\nQuotes from one of the authors of AWK: https://a-z.readthedocs.io/en/latest/awk.html\n\u003e As with a number of languages, it was born from the necessity to meet a need. As a researcher at Bell Labs in the early 1970s, I found myself keeping track of budgets, ...\n\n\u003e Some Wall Street financial houses used AWK when it first came out to balance their books because it was so easy to write data-processing programs in AWK.\n\n# Syntax\n\n- Account names without space\n- All posting lines needs to have amount\n- ISO date format YYYY-MM-DD but regex can be changed\n- line starting with date without following numeric amount means following postings will inherit same date\n- empty line ends transaction\n- postings can optionally have spaces for indentation\n- higher level syntax for transactions, budgeting, auto-transaction needs to be converted to postings lines\n- Reasons because amount number is before account and other tags:\n   1. amount is more important than account\n   2. pretty indenting doesn't need so much spaces\n   3. to allow grouping postings by account without duplicating account on each line and still have valid syntax\n- default ACCOUNT_REGEX is `^([A-Z]+:)?(expenses|assets|liabilities|income|equity)(:[^ ])?`\n- account aliases can be used after amount or date. In 1st field can be alias only if it matches ACCOUNT_REGEX\n- account on line has priority over account from transaction\n- string COM@price will create 2 auto-postings\n\n```\nalias food expenses:food\n\n2024-12-01 tesco\n   5 food bread\n   5 expenses:food milk\n -10 assets:cash\n\n 2024-12-02 bitcoin\n       1 BTC:assets EUR@62000\n  -62000 EUR:assets:cash\n```\n\nwill generate these postings lines:\n\n```\n2024-12-31 5 expenses:food bread tesco\n2024-12-31 5 expenses:food milk tesco\n2024-12-31 10 assets:cash tesco\n2024-12-02 1 BTC:assets bitcoin EUR@62000\n2024-12-02 -1 BTC:equity bitcoin autotxn\n2024-12-02 62000 EUR:assets:BTC bitcoin autotxn\n2024-12-02 -62000 EUR:assets:cash bitcoin\n```\n\nIn this way date of each posting in transaction can be customized.\n\n## File per account\nOur syntax allows to group postings by account, not only by transaction. This makes any register listing valid input.\nBasically this is what double-entry means - you need to enter each transaction in two places=accounts.\nPractically this may not be the most convenient way of entering transactions.\nOne reason is that transactions are hard to match. Although they can be matched by adding transaction id as tag to both postings.\nSecond is that user need to open, append and save two files for each transaction.\n\n```\nAssets:Checking\n2024-01-01 10 employer\n2024-01-02 -1 water\n2024-01-03 -2 food\n```\n\n```\nIncome:Employer\n2024-01-01 -10 employer\n```\n\n```\nExpenses:Groceries\n2024-01-02 1 water\n2024-01-03 2 food\n```\n\n## Postings syntax\n- can be processed using other tools grep, sort, filter\n- 1 line = 1 posting\n- human readable but not intended for human use\n- format: YYYY-MM-DD amount CUR account other tags notes arguments\n- example: 2024-12-31 5 EUR expenses:food bread tesco\n\n## Usage\n\n    ./pta \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiliphanes%2Fawk-pta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffiliphanes%2Fawk-pta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiliphanes%2Fawk-pta/lists"}