{"id":16809985,"url":"https://github.com/wowinter13/finance_rb","last_synced_at":"2025-03-17T03:31:29.554Z","repository":{"id":52266349,"uuid":"342964136","full_name":"wowinter13/finance_rb","owner":"wowinter13","description":"A ruby port of numpy-financial functions and more.","archived":false,"fork":false,"pushed_at":"2023-10-12T00:10:27.000Z","size":43,"stargazers_count":18,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-27T17:34:43.189Z","etag":null,"topics":["finance","financial","gem","ruby","rubygem"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/finance_rb","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/wowinter13.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-02-27T21:41:34.000Z","updated_at":"2024-10-04T22:20:28.000Z","dependencies_parsed_at":"2024-10-27T12:12:23.536Z","dependency_job_id":null,"html_url":"https://github.com/wowinter13/finance_rb","commit_stats":{"total_commits":31,"total_committers":2,"mean_commits":15.5,"dds":"0.032258064516129004","last_synced_commit":"90e3c3fdc2e55ad73c7e3f2f195d2f7c685a6cff"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wowinter13%2Ffinance_rb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wowinter13%2Ffinance_rb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wowinter13%2Ffinance_rb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wowinter13%2Ffinance_rb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wowinter13","download_url":"https://codeload.github.com/wowinter13/finance_rb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841207,"owners_count":20356443,"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":["finance","financial","gem","ruby","rubygem"],"created_at":"2024-10-13T10:14:20.227Z","updated_at":"2025-03-17T03:31:29.255Z","avatar_url":"https://github.com/wowinter13.png","language":"Ruby","readme":"# finance_rb\n\nThis package is a ruby native port of the numpy-financial package with some helpful additional functions.\n\nThe functions in this package are a scalar version of their vectorised counterparts in the [numpy-financial](https://github.com/numpy/numpy-financial) library.\n\n![tests](https://github.com/wowinter13/finance_rb/actions/workflows/tests.yml/badge.svg) [![Release](https://img.shields.io/github/v/release/wowinter13/finance_rb.svg?style=flat-square)](https://github.com/wowinter13/finance_rb/releases) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![Maintainability](https://api.codeclimate.com/v1/badges/bbca82ad7815794c6718/maintainability)](https://codeclimate.com/github/wowinter13/finance_rb/maintainability)\n\n[![Buy Me A Coffee](https://cdn.buymeacoffee.com/buttons/v2/default-blue.png)](https://www.buymeacoffee.com/wowinter13)\n\nCurrently, only some functions are ported,  \nwhich are as follows:  \n\n| numpy-financial function     | ruby native function ported?   | info|\n|:------------------------:    |:------------------:  | :------------------|\n| fv                           |   ✅    |   Computes the  future value|\n| ipmt                         |   ✅   |   Computes interest payment for a loan|\n| pmt                          |  ✅    |   Computes the fixed periodic payment(principal + interest) made against a loan amount|\n| ppmt                         |   ✅   |   Computes principal payment for a loan|\n| nper                         |    ✅   |    Computes the number of periodic payments|\n| pv                           |    ✅  |   Computes the present value of a payment|\n| rate                         |   ✅ |    Computes the rate of interest per period|\n| irr                          |    ✅    |    Computes the internal rate of return|\n| npv                          |  ✅   |   Computes the net present value of a series of cash flow|\n| mirr                         |    ✅    |    Computes the modified internal rate of return|\n\n\n**Things to be done:**\n\n1. Xirr\n2. More specs for edge cases\n3. Fee, currency protection and other cool stuff for advanced usage\n4. Better errors\n5. A detailed documentation for all methods\n\n## Documentation\n\nDetailed documentation is available at [rubydoc](https://rubydoc.info/gems/finance_rb).\n\n### Basic usage\n\nThere is no need to create a loan class to calculate some basic functions, such as `npv`, `irr`, or `mirr`. Simply call a needed method with required arguments using calculations class.\n\n1. **IRR** (Internal Rate of Return)\n\n    ```ruby\n    Finance::Calculations.irr([-4000,1200,1410,1875,1050])\n    =\u003e 0.14299344106053188\n    ```\n\n2. **MIRR** (Modified Internal Rate of Return)\n\n    ```ruby\n    Finance::Calculations.mirr([100, 200, -50, 300, -200], 0.05, 0.06)\n    =\u003e 0.3428233878421769\n    ```\n\n3. **NPV** (Net Present Value)\n\n    ```ruby\n    Finance::Calculations.net_present_value(0.1, [-100, 6, 6, 6])\n    =\u003e -85.07888805409468\n    ```\n\n### Advanced Usage\n\nCreate a loan instance, and pass available parameters for nominal annual rate, duration (in months), and amount of loan.\n\n```ruby\n\nloan = Finance::Loan.new(nominal_rate: 0.1, duration: 12, amount: 1000)\nloan.pmt # =\u003e -87.9158872300099\n```\n\nAvailable methods: `pmt`, `ipmt`, `ppmt`, `nper`, `pv`, `fv`, `rate`.\n\n## Installation\n\nfinance_rb is available as a gem, to install it just install the gem:\n\n    gem install finance_rb\n\nIf you're using Bundler, add the gem to Gemfile.\n\n    gem 'finance_rb'\n\nRun `bundle install`.\n\n## Running tests\n\n    bundle exec rspec spec/\n    \n## Available Functions\n\n** Simple financial functions **\n- fv(rate, nper, pmt, pv[, when])\tCompute the future value.\n- pv(rate, nper, pmt[, fv, when])\tCompute the present value.\n- npv(rate, values)\tReturns the NPV (Net Present Value) of a cash flow series.\n- pmt(rate, nper, pv[, fv, when])\tCompute the payment against loan principal plus interest.\n- ppmt(rate, per, nper, pv[, fv, when])\tCompute the payment against loan principal.\n- ipmt(rate, per, nper, pv[, fv, when])\tCompute the interest portion of a payment.\n- irr(values)\tReturn the Internal Rate of Return (IRR).\n- mirr(values, finance_rate, reinvest_rate)\tModified internal rate of return.\n- nper(rate, pmt, pv[, fv, when])\tCompute the number of periodic payments.\n- nrate(nper, pmt, pv, fv[, when, guess, tol, …])\tCompute the rate of interest per period.\n\n## Contributing\n\n1. Fork it ( https://github.com/wowinter13/finance_rb/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## License\n\nMIT License. See LICENSE for details.\n","funding_links":["https://www.buymeacoffee.com/wowinter13"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwowinter13%2Ffinance_rb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwowinter13%2Ffinance_rb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwowinter13%2Ffinance_rb/lists"}