{"id":17644551,"url":"https://github.com/zacchiro/beangrep","last_synced_at":"2025-05-05T21:12:00.082Z","repository":{"id":239425171,"uuid":"799496875","full_name":"zacchiro/beangrep","owner":"zacchiro","description":"Beangrep - grep-like filter for Beancount","archived":false,"fork":false,"pushed_at":"2024-08-09T10:06:00.000Z","size":155,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-05T21:11:53.495Z","etag":null,"topics":["accounting","beancount","grep","ledger","plaintext","plaintext-accounting"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zacchiro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-GPL-2.0-or-later","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-12T10:29:52.000Z","updated_at":"2024-09-10T08:52:43.000Z","dependencies_parsed_at":"2024-05-15T13:18:37.401Z","dependency_job_id":"ec84813e-aac2-49b0-83b2-e40ac14dfd2f","html_url":"https://github.com/zacchiro/beangrep","commit_stats":null,"previous_names":["zacchiro/beangrep"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zacchiro%2Fbeangrep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zacchiro%2Fbeangrep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zacchiro%2Fbeangrep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zacchiro%2Fbeangrep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zacchiro","download_url":"https://codeload.github.com/zacchiro/beangrep/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252577020,"owners_count":21770721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["accounting","beancount","grep","ledger","plaintext","plaintext-accounting"],"created_at":"2024-10-23T10:06:56.772Z","updated_at":"2025-05-05T21:12:00.064Z","avatar_url":"https://github.com/zacchiro.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![CI status](https://github.com/zacchiro/beangrep/actions/workflows/python-package.yml/badge.svg)\n\n\nBeangrep - grep-like filter for Beancount\n=========================================\n\n[Beangrep][beangrep-home] is a [grep][grep-wikipedia]-like filter for the\n[Beancount][beancount-home] plain text accounting system.\n\n[beangrep-home]: https://github.com/zacchiro/beangrep\n[grep-wikipedia]: https://en.wikipedia.org/wiki/Grep\n[beancount-home]: http://beancount.github.io/\n\n\nInstallation\n------------\n\n### Prebuilt package\n\n```console\n$ python3 -m venv ./venv    # optional but recommended\n$ source venv/bin/activate\n\n$ pip install beangrep\n[...]\nSuccessfully installed beancount-2.3.6 beangrep-...\n\n$ bean-grep --help\nUsage: bean-grep [OPTIONS] FILENAME\n[...]\n```\n\n### From source\n\n```console\n$ git clone https://github.com/zacchiro/beangrep\n$ cd beangrep\n\n$ python3 -m venv ./venv    # optional but recommended\n$ source venv/bin/activate\n\n$ pip install -e .\n[...]\nSuccessfully installed beancount-2.3.6 beangrep-...\n\n$ bean-grep --help\nUsage: bean-grep [OPTIONS] FILENAME\n[...]\n```\n\n\nUsage\n-----\n\nThe CLI says it all when invoked as `bean-grep --help`:\n\n```\nUsage: bean-grep [OPTIONS] [PATTERN] FILENAME...\n\n  Search for entries matching given criteria in Beancount journals. Pretty\n  print matching entries to standard output.\n\n  Search criteria can be specified with the options below and/or providing an\n  explicit \"smart\" PATTERN. If given, PATTERN is interpreted as described\n  below under \"Patterns\". If not given, search criteria are defined by\n  explicit options.\n\n  Multiple options, options given mutiple times, and PATTERN(s) are logically\n  joined (AND-ed) together.\n\n  The granularity of matching (and results) is that of individual entries,\n  e.g., full transactions, balances, notes, etc. By default only transactions\n  are returned; use the --type/-T option to override.\n\n  To read from standard input, pass \"-\" as FILENAME, but beware that it\n  implies on-disk buffering of stdin.\n\nOptions:\n  -a, --account REGEX             Only return entries referencing accounts\n                                  with names matching given regex.\n  -A, --amount \"[OP]AMOUNT [REGEX]\"\n                                  Only return entries with amounts matching\n                                  the given amount predicate. An amount\n                                  predicate start with an optional comparison\n                                  operator (one of \"\u003c\", \"\u003c=\", \"=\", \"\u003e=\", \"\u003e\",\n                                  with \"=\" being the default), followed by a\n                                  decimal number (using \".\" as decimal\n                                  separator), followed by an optional currency\n                                  regex. Multiple amount predicates can be\n                                  given to express complex amount ranges.\n  -d, --date [OP]DATE             Only return entries with dates matching the\n                                  given date predicate. A date predicate start\n                                  with an optional comparison operator (one of\n                                  \"\u003c\", \"\u003c=\", \"=\", \"\u003e=\", \"\u003e\", with \"=\" being\n                                  the default), and is followed by a date in\n                                  the form YYYY-[MM[-DD]]. Multiple date\n                                  predicates can be given to express complex\n                                  date ranges.\n  -f, --flag REGEX                Only return transactions with at least one\n                                  flag matching the given regex (usually a\n                                  single character, properly escaped).  Both\n                                  transaction and posting flags are used for\n                                  matching.\n  -l, --link REGEX                Only return entries with at least one link\n                                  matching given regex.\n  -m, --meta, --metadata REGEX[:REGEX]\n                                  Only return entries with at least one\n                                  metadata key/value pair matching given\n                                  pattern. A pattern is a pair of regexs\n                                  separated by \":\", the former matching on\n                                  metadata key, the latter on metadata value.\n                                  The second regex is optional and defaults to\n                                  \".*\".\n  -n, --narration REGEX           Only return entries whose narrations match\n                                  given regex.\n  -p, --payee REGEX               Only return entries whose payees match given\n                                  regex.\n  -s, --somewhere, --anywhere REGEX\n                                  Only return entries with a value in them,\n                                  anywhere, matching given regex.\n  -t, --tag REGEX                 Only return entries with at least one tag\n                                  matching given regex. The tag can be located\n                                  anywhere.\n  -T, --type TYPE(S)              Only return entries of certain types.  Types\n                                  are specified as a \",\"-separated list of\n                                  type names; type names are: open, close,\n                                  commodity, pad, balance, transaction, note,\n                                  event, query, price, document, custom. The\n                                  special value \"all\" means: all directive\n                                  types. [default: transaction]\n  --case-sensitive                Search case sensitively. Overrides:\n                                  -i/--ignore-case and -S/--smart-case.\n  -i, --ignore-case               Search case insensitively. Overrides\n                                  -S/--smart-case; overridden by --case-\n                                  sensitive.\n  -S, --smart-case                Search case insensitively if all criteria\n                                  are lowercase, sensitively otherwise.\n                                  Overridden by: --case-sensitive and\n                                  -i/--ignore-case.  [default: True]\n  --posting-tags-meta TEXT        Metadata key used to attach tags to\n                                  transaction postings.  [default: tags]\n  -q, --quiet / --no-quiet        Quiet, do not write anything to standard\n                                  output. Exit successfully immediately if any\n                                  match is found.  [default: no-quiet]\n  --skip-internals / --no-skip-internals\n                                  When matching, ignore internal information\n                                  not visible in the ledger. This includes the\n                                  automatic metadata: filename, lineno.\n                                  [default: skip-internals]\n  -v, --invert-match              Invert the sense of matching: return entries\n                                  that do *not* match given criteria. This\n                                  clears the default \"--type transaction\"\n                                  criteria, to avoid only returning non-\n                                  transaction entries by default.\n  --verbose                       Increase logging verbosity. Default\n                                  verbosity is at WARNING level; passing this\n                                  option once will increase it to INFO, twice\n                                  or more to DEBUG.\n  -V, --version                   Show the version and exit.\n  --help                          Show this message and exit.\n\n  Patterns:\n\n  When given the \"smart\" PATTERN is interpreted according to the following\n  heuristics, tried in order, first match wins:\n\n  - if it is in the form \"YYYY-MM-DD\" -\u003e then it is interpreted as --date\n\n  - \"#tag\" -\u003e --tag\n\n  - \"^link\" -\u003e --link\n\n  - \"@payee\" -\u003e --payee\n\n  - if it starts with one of the five account types (\"Assets\", \"Equity\",\n  \"Expenses\",   \"Income\", \"Liabilities\") -\u003e --account\n\n  - \"key:value\" -\u003e --metadata\n\n  - otherwise -\u003e --somewhere\n\n  Environment:\n\n  All options can be set via environment variables, which is most useful if\n  you want to override the defaults. Each environment variable consists of the\n  prefix BEANGREP_ followed by the option name in uppercase.  e.g.,\n  BEANGREP_VERBOSE, BEANGREP_CASE_SENSITIVE, BEANGREP_QUIET,\n  BEANGREP_NO_SKIP_INTERNALS, etc. Boolean options are enabled/disabled by\n  setting the corresponding variables to 1/0 respectively, e.g.,\n  BEANGREP_QUIET=1.\n\n  The FILENAME can alternatively be specified via the environment variable\n  BEANCOUNT_FILENAME. This allows not having to specify it explicitly every\n  time bean-grep is run. Only a single FILENAME is allowed to be specified\n  this way.\n\n  Exit status:\n\n  Exit status is 0 (success) if a match is found, 1 if no match is found, 2 if\n  an error occurred.\n```\n\n\nAuthor\n------\n\n* [Stefano Zacchiroli][zack-home] [`\u003czack@upsilon.cc\u003e`][zack-email]\n\n[zack-home]: https://upsilon.cc/~zack\n[zack-email]: mailto:zack@upsilon.cc\n\n\nLicense\n-------\n\nBeangrep is free software; you can redistribute it and/or modify it under the\nterms of the GNU General Public License as published by the Free Software\nFoundation; either version 2 of the License, or (at your option) any later\nversion.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE.  See the GNU General Public License for more details.\n\nA copy of the GNU General Public License is [distributed with Beangrep][gpl2-here]\nas well as from the [official license page][gpl2-home].\n\n[gpl2-here]: https://github.com/zacchiro/beangrep/blob/main/LICENSE-GPL-2.0-or-later\n[gpl2-home]: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzacchiro%2Fbeangrep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzacchiro%2Fbeangrep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzacchiro%2Fbeangrep/lists"}