{"id":33185588,"url":"https://github.com/sarvjeets/lakshmi","last_synced_at":"2026-01-14T10:23:18.782Z","repository":{"id":37938539,"uuid":"356963053","full_name":"sarvjeets/lakshmi","owner":"sarvjeets","description":"Investing library and command-line interface inspired by the Bogleheads philosophy","archived":false,"fork":false,"pushed_at":"2025-10-06T23:24:24.000Z","size":2508,"stargazers_count":138,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-10-07T01:14:20.265Z","etag":null,"topics":["asset-allocation","bogleheads","command-line-tool","commandline","finance","investing","portfolio","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/sarvjeets.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-04-11T19:41:47.000Z","updated_at":"2025-10-06T23:24:25.000Z","dependencies_parsed_at":"2023-11-18T05:26:15.679Z","dependency_job_id":"fbad0a21-4709-4e17-82a5-12fc5c6ba709","html_url":"https://github.com/sarvjeets/lakshmi","commit_stats":{"total_commits":420,"total_committers":5,"mean_commits":84.0,"dds":"0.12142857142857144","last_synced_commit":"e2d9b7c8f0097f7eda34a0b6b8bd95afed638fb8"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/sarvjeets/lakshmi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarvjeets%2Flakshmi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarvjeets%2Flakshmi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarvjeets%2Flakshmi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarvjeets%2Flakshmi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sarvjeets","download_url":"https://codeload.github.com/sarvjeets/lakshmi/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarvjeets%2Flakshmi/sbom","scorecard":{"id":800954,"data":{"date":"2025-08-11","repo":{"name":"github.com/sarvjeets/lakshmi","commit":"d744ecf50eebf646d421452fbb969d9da1f92d36"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/22 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'develop'","Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T10:28:22.611Z","repository_id":37938539,"created_at":"2025-08-23T10:28:22.611Z","updated_at":"2025-08-23T10:28:22.611Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28417023,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:18:03.274Z","status":"ssl_error","status_checked_at":"2026-01-14T10:16:11.865Z","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":["asset-allocation","bogleheads","command-line-tool","commandline","finance","investing","portfolio","python"],"created_at":"2025-11-16T05:00:20.096Z","updated_at":"2026-01-14T10:23:18.776Z","avatar_url":"https://github.com/sarvjeets.png","language":"Python","funding_links":[],"categories":["Productivity","\u003ca name=\"financial\"\u003e\u003c/a\u003eFinancial tools"],"sub_categories":["Finance"],"readme":"# Lakshmi\n\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/sarvjeets/lakshmi/develop.svg)](https://results.pre-commit.ci/latest/github/sarvjeets/lakshmi/develop)\n[![Downloads](https://pepy.tech/badge/lakshmi)](https://pepy.tech/project/lakshmi)\n[![Downloads](https://pepy.tech/badge/lakshmi/month)](https://pepy.tech/project/lakshmi)\n\n![Screenshot of lak in action](./docs/lak.png)\n(Screenshot of the `lak` command in action)\n\n## Background\nThis project is inspired by\n[Bogleheads forum](http://bogleheads.org). Bogleheads focus on a simple but\n[powerful philosophy](https://www.bogleheads.org/wiki/Bogleheads%C2%AE_investment_philosophy)\nthat allows investors to achieve above-average\nreturns after costs. This tool is built around the same principles to help\nan _average_ investor manage their investing portfolio.\n\nLakshmi (meaning \"She who leads to one's goal\") is one of the principal\ngoddesses in Hinduism. She is the goddess of wealth, fortune, power, health,\nlove, beauty, joy and prosperity.\n\n## Introduction\nThis project consists of a library module (`lakshmi`) and a command-line\ntool (`lak`) that exposes some of the functionality of the library. The library\nprovides useful abstractions and tools to manage your investing portfolio.\n\n[Bogleheads wiki](https://www.bogleheads.org/wiki/Main_Page) is a great\nresource for introduction to basic investing concepts like asset-allocation,\nasset-location, etc.\n\nThe following features are currently available:\n\n- Specify and track asset allocation across accounts.\n- Ability to add/edit/delete accounts and assets (funds, stocks, ETFs, etc.)\ninside those accounts. The market value of these assets is automatically\nupdated.\n- Support for running what-if scenarios to see how it impacts the overall asset\nallocation.\n- Suggests which funds to allocate new money to (or withdraw money from) to\nkeep the actual asset allocation close to the desired asset allocation.\n- Suggests how to rebalance the funds in a given account to bring the actual\nasset allocation close to the desired asset allocation.\n- Ability to track portfolio performance\n([IRR](https://www.investopedia.com/terms/i/irr.asp#:~:text=The%20internal%20rate%20of%20return,a%20discounted%20cash%20flow%20analysis.))\nand cash flows.\n- Supports manual assets, assets with ticker, Vanguard funds (that don't\nhave associated ticker symbols),\n[EE Bonds](https://www.treasurydirect.gov/indiv/products/prod_eebonds_glance.htm)\nand\n[I Bonds](https://www.treasurydirect.gov/indiv/research/indepth/ibonds/res_ibonds.htm).\n- Listing current values of assets, asset allocation and asset location.\n- Tracking of tax-lot information for assets.\n- Analysis of portfolio to identify if there is need to rebalance or\nif there are losses that can be\n[harvested](https://www.bogleheads.org/wiki/Tax_loss_harvesting).\n\n## Installation\n\nThis project can be installed via [pip](https://pip.pypa.io/en/stable/).\nTo install the library and the lak command line tool, run:\n\n```\npip install lakshmi\n```\n\n## Command-line interface\n\nFor detailed help on the CLI, please see [lak user guide](./docs/lak.md).\nFor tips and tricks, please refer to [Lakshmi Recipes](./docs/recipes.md).\n\nThe simplest way to use this project is via the `lak` command. To access the\nup to date help, run:\n\n```\n$ lak --help\nUsage: lak [OPTIONS] COMMAND [ARGS]...\n\n  lak is a simple command line tool inspired by Bogleheads philosophy.\n  Detailed user guide is available at:\n  https://sarvjeets.github.io/lakshmi/docs/lak.html\n\nOptions:\n  --version          Show the version and exit.\n  -r, --refresh      Re-fetch all data instead of using previously cached\n                     data. For large portfolios, this would be extremely slow.\n  -c, --config PATH  The configuration file.  [env var: LAK_CONFIG; default:\n                     ~/.lakrc]\n  --debug            If set, prints stack track when an exception is raised.\n  --help             Show this message and exit.\n\nCommands:\n  add      Add new entities to the portfolio.\n  analyze  Analyze the portfolio.\n  delete   Delete different entities from the portfolio.\n  edit     Edit parts of the portfolio.\n  info     Print detailed information about parts of the portfolio.\n  init     Initializes a new portfolio by adding asset classes.\n  list     Command to list various parts of the portfolio.\n  whatif   Run hypothetical what if scenarios by modifying the total...\n```\nThe following section gives a quick summary of how to create a new portfolio.\nFor detailed help, please read\n[creating a portfolio](./docs/lak.md#creating-a-portfolio) section of the\n[lak user guide](./docs/lak.md).\n\nA new portfolio can be created by either:\n\n1. Copying an [existing](./docs/portfolio.yaml)\nportfolio file to ~/portfolio.yaml and editing it, OR\n2. Using the `lak` commands to create a new portfolio.\n\nThe following command will open up an editor to input the desired asset\nallocation:\n\n```\n$ lak init\n```\n\nAccounts (His/Her 401(k), Roth IRAs, Taxable, etc.) can be added via\nthe `lak add account` command:\n\n```\n$ lak add account\n# Use the above command multiple times to add more accounts.\n```\n\nAssets can be added to an account via the `lak add asset` command. Different\nkinds of assets can be added to a portfolio. For a complete list, pull up the\nhelp for the command:\n\n```\n$ lak add asset --help\nUsage: lak add asset [OPTIONS]\n\n  Add a new asset to the portfolio.\n\nOptions:\n  -p, --asset-type [ManualAsset|TickerAsset|VanguardFund|IBonds|EEBonds]\n                                  Add this type of asset.  [required]\n  -t, --account substr            Add asset to this account (a substring that\n                                  matches the account name).  [required]\n  --help                          Show this message and exit.\n```\n\nTickerAsset represents an asset with a ticker symbol. The value of these assets\nis updated automatically. To add a TickerAsset:\n\n```\nlak add asset -p TickerAsset -t account_str\n```\nwhere account_str is a sub-string that uniquely matches an account added previously.\n\nThat's it. To view all the assets, asset allocation and asset location, run:\n\n```\nlak list assets total aa al\n```\n\n## Library\n\nThe `lakshmi` library can also be used directly. The modules and classes are\nwell documented and there are numerous examples for using each method or class\nin the [tests](https://github.com/sarvjeets/lakshmi/tree/develop/tests)\naccompanying this package. The\n[example portfolio](./docs/portfolio.yaml) can be constructed and the asset\nallocation, etc. can be printed by the following piece of python code:\n\n```python\nfrom lakshmi import Account, AssetClass, Portfolio\nfrom lakshmi.assets import TaxLot, TickerAsset\nfrom lakshmi.table import Table\n\n\ndef main():\n    asset_class = (\n        AssetClass('All')\n        .add_subclass(0.6, AssetClass('Equity')\n                      .add_subclass(0.6, AssetClass('US'))\n                      .add_subclass(0.4, AssetClass('Intl')))\n        .add_subclass(0.4, AssetClass('Bonds')))\n    portfolio = Portfolio(asset_class)\n\n    (portfolio\n     .add_account(Account('Schwab Taxable', 'Taxable')\n                  .add_asset(TickerAsset('VTI', 1, {'US': 1.0})\n                             .set_lots([TaxLot('2021/07/31', 1, 226)]))\n                  .add_asset(TickerAsset('VXUS', 1, {'Intl': 1.0})\n                             .set_lots([TaxLot('2021/07/31', 1, 64.94)])))\n     .add_account(Account('Roth IRA', 'Tax-Exempt')\n                  .add_asset(TickerAsset('VXUS', 1, {'Intl': 1.0})))\n     .add_account(Account('Vanguard 401(k)', 'Tax-Deferred')\n                  .add_asset(TickerAsset('VBMFX', 20, {'Bonds': 1.0}))))\n\n    # Save the portfolio\n    # portfolio.Save('portfolio.yaml')\n    print('\\n' + portfolio.asset_allocation_compact().string() + '\\n')\n    print(Table(2, coltypes=['str', 'dollars'])\n          .add_row(['Total Assets', portfolio.total_value()]).string())\n    print('\\n' + portfolio.asset_allocation(['US', 'Intl', 'Bonds']).string())\n    print('\\n' + portfolio.assets().string() + '\\n')\n    print(portfolio.asset_location().string())\n\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## Development\nHere are the steps to download the source code and start developing on\nLakshmi:\n\n```shell\n# Fork and clone this repo.\n$ git clone https://github.com/yourusername/lakshmi.git\n$ cd lakshmi\n\n# All development is done on the 'develop' branch\n$ git checkout develop\n\n# Setting up a virtual environment is strongly recommended. Install virtualenv\n# by one of the following:\n# pip install virtualenv --user  # If you have pip installed\n# sudo apt-get install python-virtualenv # Ubuntu\n# sudo pacman -S python-virtualenv  # Arch linux\n$ virtualenv venv\n# Activate the virtual environment\n$ source venv/bin/activate\n\n# Install all the dependencies\n$ pip install -r requirements.txt\n\n# Run unittests\n$ python -m unittest\n\n# Install pre-commit hooks to run it automatically on commits\n$ pre-commit install\n# Run pre-commit manually\n$ pre-commit run --all-files\n\n# Create your own bug or feature branch and start developing. Remember to\n# run tests (and add them when necessary) and pre-commit hooks on changes.\n```\n\n## License\nDistributed under the MIT License. See `LICENSE` for more information.\n\n## Acknowledgements\n\nI am indebted to the following folks whose wisdom has helped me\ntremendously in my investing journey:\n[John Bogle](https://en.wikipedia.org/wiki/John_C._Bogle),\n[Taylor Larimore](https://www.bogleheads.org/wiki/Taylor_Larimore),\n[Nisiprius](https://www.bogleheads.org/forum/viewtopic.php?t=242756),\n[Livesoft](https://www.bogleheads.org/forum/viewtopic.php?t=237269),\n[Mel Lindauer](https://www.bogleheads.org/wiki/Mel_Lindauer) and\n[LadyGeek](https://www.bogleheads.org/blog/2018/12/04/interview-with-ladygeek-bogleheads-site-administrator/).\n\nThis project would not have been possible without my wife\n[Niharika](http://niharika.org), who helped me come up with the initial idea\nand encouraged me to start working on this project.\n\n\n## The not-so-fine print\n\n_The author is not a financial adviser and you agree to treat this tool\nfor informational purposes only. The author does not promise or guarantee\nthat the information provided by this tool is correct, current, or complete,\nand it may contain technical inaccuracies or errors. The author is not\nliable for any losses that you might incur by acting on the information\nprovided by this tool. Accordingly, you should confirm the accuracy and\ncompleteness of all content, and seek professional advice taking into\naccount your own personal situation, before making any decision based\non information from this tool._\n\nIn a nutshell:\n* The information provided by this tool is not financial advice.\n* The author is not an expert or financial adviser.\n* Consult a financial and/or tax adviser before taking action.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarvjeets%2Flakshmi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarvjeets%2Flakshmi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarvjeets%2Flakshmi/lists"}