{"id":21135474,"url":"https://github.com/alecloudenback/ledger","last_synced_at":"2026-02-07T15:03:50.514Z","repository":{"id":152741046,"uuid":"264758974","full_name":"alecloudenback/Ledger","owner":"alecloudenback","description":null,"archived":false,"fork":false,"pushed_at":"2020-05-17T21:21:59.000Z","size":6,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T14:42:39.375Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","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/alecloudenback.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-17T21:20:36.000Z","updated_at":"2020-05-17T21:22:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"757ab0d1-f806-49b0-9874-1b0a60f6c14c","html_url":"https://github.com/alecloudenback/Ledger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alecloudenback/Ledger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecloudenback%2FLedger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecloudenback%2FLedger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecloudenback%2FLedger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecloudenback%2FLedger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alecloudenback","download_url":"https://codeload.github.com/alecloudenback/Ledger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecloudenback%2FLedger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29197667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T14:35:27.868Z","status":"ssl_error","status_checked_at":"2026-02-07T14:25:51.081Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2024-11-20T06:55:56.096Z","updated_at":"2026-02-07T15:03:50.480Z","avatar_url":"https://github.com/alecloudenback.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ledger\n\n[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://alecloudenback.github.io/Ledger.jl/stable)\n[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://alecloudenback.github.io/Ledger.jl/dev)\n\nPrimary interface:\n- Defining a `Ledger.ValuationBasis`\n- Defining how to account for that with `Ledger.value(::ValuationBasis,myType)`\n\n## Example\n\nDefine a new valuation basis and a simple asset type:\n\n```julia\n    # Extending the interface for my own types/valuation basis\n\n    struct MyValuationBasis \u003c: Ledger.ValuationBasis end\n\n    struct MyCash \u003c: Ledger.Asset\n        balance\n    end\n\n    Ledger.value(::MyValuationBasis,b::MyCash) = b.balance\n\n```\n\nNow create a `GeneralLedger` which will contain references to the underlying objects and be able to value them:\n\n```julia\n    gl = GeneralLedger()\n    \n    addAsset!(gl,MyCash(100))\n```\n\nWith a single asset in the ledger, show the assets, liabilities, and equity:\n\n```julia\n    bal = Balance(MyValuationBasis(),gl)\n\n    @test sum(bal.assets) == 100.0\n    @test length(bal.liabilities) == 0\n    @test sum(bal.equity) == 100.0\n```\n\nExtending the example to include a liability with a more complex `value` function:\n\n```julia\n    struct myDebt \u003c: Ledger.Liability\n        balance\n        int_rate\n        years_due\n    end\n\n    Ledger.value(::MyValuationBasis,b::myDebt) = b.balance / (1+ b.int_rate) ^ b.years_due\n    \n    addLiability!(gl,myDebt(50,0.05,3))\n\n    bal = Balance(MyValuationBasis(),gl)\n\n    @test sum(bal.assets) == 100.0\n    @test sum(bal.liabilities) == 50 / 1.05 ^ 3\n    @test sum(bal.equity) == 100.0 - 50 / 1.05 ^ 3\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecloudenback%2Fledger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falecloudenback%2Fledger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecloudenback%2Fledger/lists"}