{"id":26319140,"url":"https://github.com/ralfebert/ledgerjournal","last_synced_at":"2025-03-15T15:17:54.362Z","repository":{"id":46740113,"uuid":"258988924","full_name":"ralfebert/ledgerjournal","owner":"ralfebert","description":"ledgerjournal is a Ruby gem to read and write ledger accounting files.","archived":false,"fork":false,"pushed_at":"2021-10-29T15:33:56.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T16:17:54.869Z","etag":null,"topics":["accounting","ledger-cli","ruby-gem"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/ralfebert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-26T09:21:31.000Z","updated_at":"2022-11-16T11:51:48.000Z","dependencies_parsed_at":"2022-07-22T11:02:19.217Z","dependency_job_id":null,"html_url":"https://github.com/ralfebert/ledgerjournal","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralfebert%2Fledgerjournal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralfebert%2Fledgerjournal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralfebert%2Fledgerjournal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralfebert%2Fledgerjournal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ralfebert","download_url":"https://codeload.github.com/ralfebert/ledgerjournal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243746239,"owners_count":20341204,"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","ledger-cli","ruby-gem"],"created_at":"2025-03-15T15:17:53.619Z","updated_at":"2025-03-15T15:17:54.356Z","avatar_url":"https://github.com/ralfebert.png","language":"Ruby","readme":"# ledgerjournal\n\n[![Gem Version](https://badge.fury.io/rb/ledgerjournal.svg)](https://badge.fury.io/rb/ledgerjournal)\n[![Build Status](https://travis-ci.org/ralfebert/ledgerjournal.svg?branch=master)](https://travis-ci.org/github/ralfebert/ledgerjournal)\n[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](https://www.rubydoc.info/gems/ledgerjournal/)\n\nledgerjournal is a Ruby gem to read and write [ledger](https://www.ledger-cli.org/) accounting files.\nFor parsing, it uses the [ledger xml command](https://www.ledger-cli.org/3.0/doc/ledger3.html#The-xml-command). For outputting, it formats the ledger data as String in Ruby.\nThe ledger binary needs to be installed to parse and pretty-print.\n\n## Usage\n\nParsing a ledger journal file: \n\n```ruby\njournal = Ledger::Journal.new(path: \"example_journal.dat\")\njournal.transactions.each do |tx|\n  puts tx.date, tx.payee\nend\n```\n\nCreating a ledger file from scratch:\n\n```ruby\njournal = Ledger::Journal.new()\n\njournal.transactions \u003c\u003c Ledger::Transaction.new(\n  date: Date.new(2020, 1, 2),\n  payee: 'Example Payee',\n  metadata: { \"Foo\" =\u003e \"Bar\", \"Description\" =\u003e \"Example Transaction\" },\n  postings: [\n    Ledger::Posting.new(account: \"Expenses:Unknown\", currency: \"EUR\", amount: BigDecimal('1234.56'), metadata: { \"Foo\" =\u003e \"Bar\", \"Description\" =\u003e \"Example Posting\" }),\n    Ledger::Posting.new(account: \"Assets:Checking\", currency: \"EUR\", amount: BigDecimal('-1234.56'))\n  ]\n)\n\nputs(journal.to_s)\n```\n\nAppending to a ledger journal: \n\n```ruby\njournal = Ledger::Journal.new(path: \"example_journal.dat\")\njournal.transactions \u003c\u003c Ledger::Transaction.new(\n  date: Date.new(2020, 1, 2),\n  payee: 'Example Payee',\n  postings: [\n    Ledger::Posting.new(account: \"Expenses:Unknown\", currency: \"EUR\", amount: BigDecimal('1234.56')),\n    Ledger::Posting.new(account: \"Assets:Checking\", currency: \"EUR\", amount: BigDecimal('-1234.56'))\n  ]\n)\njournal.save!\n```\n\nRunning ledger commands:\n\n```ruby\nputs Ledger.defaults.run('--version')\n```\n\n### Locale-specific settings\n\nBy default ledgerjournal expects the date format '%Y/%m/%d' and amounts with decimal point (1234.56). This is configurable:\n\n```ruby\nLedger.defaults = Options.new(date_format: '%d.%m.%Y', decimal_comma: true)\n```\n\nor:\n\n```ruby\nLedger.defaults = Ledger::Options.for_locale(:de)\n```\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'ledgerjournal'\n```\n\nOr install it yourself as:\n\n    $ gem install ledgerjournal\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/ralfebert/ledgerjournal.\n\n## License\n\nledgerjournal is released under the MIT License. See LICENSE.md.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralfebert%2Fledgerjournal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fralfebert%2Fledgerjournal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralfebert%2Fledgerjournal/lists"}