{"id":19745648,"url":"https://github.com/dmotte/apycalc","last_synced_at":"2026-01-06T16:05:05.209Z","repository":{"id":262344982,"uuid":"886439898","full_name":"dmotte/apycalc","owner":"dmotte","description":"🐍 APY trend calculator with configurable Moving Average","archived":false,"fork":false,"pushed_at":"2025-02-01T16:15:01.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-10T05:27:33.339Z","etag":null,"topics":["annual","apy","apycalc","average","calculator","command","csv","invest","moving","package","percent","percentage","pip","py","pypi","python","return","value","yearly","yield"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/apycalc/","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/dmotte.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,"zenodo":null}},"created_at":"2024-11-11T01:12:32.000Z","updated_at":"2025-02-01T16:15:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c8c3e38-c596-4ffd-8dda-b5bcf5cc49a1","html_url":"https://github.com/dmotte/apycalc","commit_stats":null,"previous_names":["dmotte/apycalc"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmotte%2Fapycalc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmotte%2Fapycalc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmotte%2Fapycalc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmotte%2Fapycalc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmotte","download_url":"https://codeload.github.com/dmotte/apycalc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253450203,"owners_count":21910511,"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":["annual","apy","apycalc","average","calculator","command","csv","invest","moving","package","percent","percentage","pip","py","pypi","python","return","value","yearly","yield"],"created_at":"2024-11-12T02:10:41.573Z","updated_at":"2026-01-06T16:05:05.203Z","avatar_url":"https://github.com/dmotte.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# apycalc\n\n[![GitHub main workflow](https://img.shields.io/github/actions/workflow/status/dmotte/apycalc/main.yml?branch=main\u0026logo=github\u0026label=main\u0026style=flat-square)](https://github.com/dmotte/apycalc/actions)\n[![PyPI](https://img.shields.io/pypi/v/apycalc?logo=python\u0026style=flat-square)](https://pypi.org/project/apycalc/)\n\n:snake: [**APY**](https://www.investopedia.com/terms/a/apy.asp) (_Annual Percentage Yield_) **trend calculator**, with configurable MA (_Moving Average_).\n\n\u003e **Note**: APY is calculated over a period of **365 days**.\n\n## Installation\n\nThis utility is available as a Python package on **PyPI**:\n\n```bash\npython3 -mpip install apycalc\n```\n\n## Usage\n\nThere are some files in the [`example`](example) directory of this repo that can be useful to demonstrate how this tool works, so let's change directory first:\n\n```bash\ncd example/\n```\n\nWe need a Python **virtual environment** (\"venv\") with some packages to do the demonstration:\n\n```bash\npython3 -mvenv venv\nvenv/bin/python3 -mpip install -r requirements.txt\n```\n\nNow we need to **fetch data** related to some asset. To do that, we can use https://github.com/dmotte/misc/blob/main/python-scripts/ohlcv-fetchers/yahoo-finance.py.\n\n\u003e **Note**: in the following commands, replace the local path of the `invoke.sh` script with the correct one.\n\n```bash\nbash ~/git/misc/python-scripts/ohlcv-fetchers/invoke.sh yahoo-finance '^GSPC' -i1wk -d2000-01-01T00Z -f'{:.6f}' \u003e ohlcv-SPX500.csv\n```\n\nNow that we have the data, we can **compute the APY and MA values**:\n\n```bash\npython3 -mapycalc -w104 --fmt-{rate,yield}='{:.6f}' ohlcv-SPX500.csv apy-SPX500.csv\n```\n\nAnd finally display some nice **plots** using the [`plots.py`](example/plots.py) script (which uses the [_Plotly_](https://github.com/plotly/plotly.py) Python library):\n\n```bash\nvenv/bin/python3 plots.py -ra apy-SPX500.csv\n```\n\nFor more details on how to use this command, you can also refer to its help message (`--help`).\n\n## Development\n\nIf you want to contribute to this project, you can install the package in **editable** mode:\n\n```bash\npython3 -mpip install -e . --user\n```\n\nThis will just link the package to the original location, basically meaning any changes to the original package would reflect directly in your environment ([source](https://stackoverflow.com/a/35064498)).\n\nIf you want to run the tests, you'll have to install the `pytest` package and then run:\n\n```bash\npython3 -mpytest test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmotte%2Fapycalc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmotte%2Fapycalc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmotte%2Fapycalc/lists"}