{"id":17882134,"url":"https://github.com/nao1215/cic","last_synced_at":"2026-01-19T01:32:22.506Z","repository":{"id":249274541,"uuid":"830958553","full_name":"nao1215/cic","owner":"nao1215","description":"cic - compound interest calculator","archived":false,"fork":false,"pushed_at":"2025-08-12T19:14:02.000Z","size":49,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-14T06:35:35.637Z","etag":null,"topics":["command-line-tool","compound-interest","server"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/nao1215.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"nao1215"}},"created_at":"2024-07-19T10:48:11.000Z","updated_at":"2024-07-31T07:02:44.000Z","dependencies_parsed_at":"2024-10-28T13:18:11.454Z","dependency_job_id":"c36e3cf0-69b5-4236-9cef-3556d53ce74f","html_url":"https://github.com/nao1215/cic","commit_stats":null,"previous_names":["nao1215/cic"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nao1215/cic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nao1215%2Fcic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nao1215%2Fcic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nao1215%2Fcic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nao1215%2Fcic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nao1215","download_url":"https://codeload.github.com/nao1215/cic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nao1215%2Fcic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28557155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T00:46:33.223Z","status":"ssl_error","status_checked_at":"2026-01-19T00:46:32.754Z","response_time":98,"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":["command-line-tool","compound-interest","server"],"created_at":"2024-10-28T12:48:17.406Z","updated_at":"2026-01-19T01:32:22.489Z","avatar_url":"https://github.com/nao1215.png","language":"Rust","funding_links":["https://github.com/sponsors/nao1215"],"categories":[],"sub_categories":[],"readme":"[![Build](https://github.com/nao1215/cic/actions/workflows/build.yml/badge.svg)](https://github.com/nao1215/cic/actions/workflows/build.yml)\n[![Unit tests](https://github.com/nao1215/cic/actions/workflows/test.yml/badge.svg)](https://github.com/nao1215/cic/actions/workflows/test.yml)\n\n# cic - compound interest calculator\nThe cic command calculates compound interest. The results of the calculation are output as either a bar graph (`plot.png`) or in JSON format. The cic command has a mode for starting as a server.\n\nThe cis calculates the total final amount of the investment based on the input values for the principal, monthly contribution, annual interest rate, and the number of years of contribution.\n\n## Build\n```bash\n$ cargo build --release\n```\n\n## Install\n```bash\n$ cargo install --path .\n```\n\n## Usage\n```bash\n$ cic --help\ncis - Calculates Compound Interest.\nOutput the results of compound interest calculations as either a line graph image or JSON.\n\nUsage: cic [OPTIONS] [COMMAND]\n\nCommands:\n  server  Starts the server mode\n  help    Print this message or the help of the given subcommand(s)\n\nOptions:\n  -p, --principal \u003cPRINCIPAL\u003e        The principal at the time you started investing. Defaults to 0\n  -c, --contribution \u003cCONTRIBUTION\u003e  The monthly contribution amount. Defaults to 1\n  -r, --rate \u003cRATE\u003e                  The annual interest rate (in %). Defaults to 5\n  -y, --years \u003cYEARS\u003e                The number of years for contributions. Defaults to 5\n  -j, --json                         Output as JSON. Defaults to false\n  -h, --help                         Print help\n```\n\n## Example\n### Output plot.png\n\n```bash\n$ cic --principal 1000000 --contribution 100000 --rate 10 --years 10\n```\n\n![plot](./doc/image/plot.png)\n\n### Output json\n\n```shell\n$ ./target/debug/cic --principal 1000000 --contribution 100000 --rate 10 --years 5 --json\n[\n  {\n    \"year\": 1,\n    \"principal\": 1000000.0,\n    \"annual_contribution\": 1200000.0,\n    \"total_contribution\": 1200000.0,\n    \"annual_interest\": 100000.0,\n    \"total_interest\": 100000.0,\n    \"total_amount\": 2300000.0\n  },\n  {\n    \"year\": 2,\n    \"principal\": 1000000.0,\n    \"annual_contribution\": 1200000.0,\n    \"total_contribution\": 2400000.0,\n    \"annual_interest\": 230000.0,\n    \"total_interest\": 330000.0,\n    \"total_amount\": 3730000.0\n  },\n  {\n    \"year\": 3,\n    \"principal\": 1000000.0,\n    \"annual_contribution\": 1200000.0,\n    \"total_contribution\": 3600000.0,\n    \"annual_interest\": 373000.0,\n    \"total_interest\": 703000.0,\n    \"total_amount\": 5303000.0\n  },\n  {\n    \"year\": 4,\n    \"principal\": 1000000.0,\n    \"annual_contribution\": 1200000.0,\n    \"total_contribution\": 4800000.0,\n    \"annual_interest\": 530300.0,\n    \"total_interest\": 1233300.0,\n    \"total_amount\": 7033300.0\n  },\n  {\n    \"year\": 5,\n    \"principal\": 1000000.0,\n    \"annual_contribution\": 1200000.0,\n    \"total_contribution\": 6000000.0,\n    \"annual_interest\": 703330.0,\n    \"total_interest\": 1936630.0,\n    \"total_amount\": 8936630.0\n  }\n]\n```\n\n### Sever mode\n\n```shell\n$ cic server\nStarting server, port: 8080\nPOST /compound-interests\n```\n\n```shell\n$ curl -X POST \"http://localhost:8080/compound-interests\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"principal\": 1000000, \"contribution\": 100000, \"rate\": 10, \"years\": 2}' | jq .\n[\n  {\n    \"annual_contribution\": 1200000.0,\n    \"annual_interest\": 100000.0,\n    \"principal\": 1000000.0,\n    \"total_amount\": 2300000.0,\n    \"total_contribution\": 1200000.0,\n    \"total_interest\": 100000.0,\n    \"year\": 1\n  },\n  {\n    \"annual_contribution\": 1200000.0,\n    \"annual_interest\": 230000.0,\n    \"principal\": 1000000.0,\n    \"total_amount\": 3730000.0,\n    \"total_contribution\": 2400000.0,\n    \"total_interest\": 330000.0,\n    \"year\": 2\n  }\n]\n```\n\n\n\n\n## License\nMIT\n\n## Contributing\nFirst off, thanks for taking the time to contribute! ❤️  See [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.\nContributions are not only related to development. For example, GitHub Star motivates me to develop!\n\n[![Star History Chart](https://api.star-history.com/svg?repos=nao1215/cic\u0026type=Date)](https://star-history.com/#nao1215/cic\u0026Date)\n\n## Side note\n\nThe cic command is my first project in Rust. I am using it to learn how to write and structure projects in Rust.\n\n### Why did I choose the theme of compound interest?\n\nIn Japan, the small amount investment tax exemption system (NISA) started gaining traction in 2024. I was fortunate enough to get involved in a NISA app at work.\n\nThis led me to develop an interest in investments. So, it's not surprising that I chose compound interest as my theme.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnao1215%2Fcic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnao1215%2Fcic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnao1215%2Fcic/lists"}