{"id":24961024,"url":"https://github.com/ratulmaharaj/predictable","last_synced_at":"2025-10-11T11:16:08.863Z","repository":{"id":56763325,"uuid":"524518096","full_name":"RatulMaharaj/predictable","owner":"RatulMaharaj","description":"A framework for actuarial modelling.","archived":false,"fork":false,"pushed_at":"2023-09-29T02:42:38.000Z","size":99,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-12T06:56:35.706Z","etag":null,"topics":["actuarial","cashflows","modelling-framework","numpy","pandas","python"],"latest_commit_sha":null,"homepage":"https://predictable.readthedocs.io/","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/RatulMaharaj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/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}},"created_at":"2022-08-13T22:07:46.000Z","updated_at":"2025-04-06T02:38:07.000Z","dependencies_parsed_at":"2022-08-16T02:10:22.072Z","dependency_job_id":"c81f66d3-64d2-41b8-a251-2a36c86e2aa0","html_url":"https://github.com/RatulMaharaj/predictable","commit_stats":null,"previous_names":["ratulmaharaj/divinate"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/RatulMaharaj/predictable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RatulMaharaj%2Fpredictable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RatulMaharaj%2Fpredictable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RatulMaharaj%2Fpredictable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RatulMaharaj%2Fpredictable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RatulMaharaj","download_url":"https://codeload.github.com/RatulMaharaj/predictable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RatulMaharaj%2Fpredictable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279007037,"owners_count":26084227,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["actuarial","cashflows","modelling-framework","numpy","pandas","python"],"created_at":"2025-02-03T08:45:17.361Z","updated_at":"2025-10-11T11:16:08.832Z","avatar_url":"https://github.com/RatulMaharaj.png","language":"Python","readme":"# Predictable\n\n[![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff)\n![PyPI](https://img.shields.io/pypi/v/predictable)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![pytest](https://github.com/RatulMaharaj/predictable/actions/workflows/pytest.yaml/badge.svg?branch=main)](https://github.com/RatulMaharaj/predictable/actions/workflows/pytest.yaml)\n[![build](https://github.com/RatulMaharaj/predictable/actions/workflows/build.yaml/badge.svg?branch=main)](https://github.com/RatulMaharaj/predictable/actions/workflows/build.yaml)\n[![Documentation Status](https://readthedocs.org/projects/predictable/badge/?version=latest)](https://predictable.readthedocs.io/en/latest/?badge=latest)\n\n## What is it?\n\nA framework for actuarial modelling.\n\n## Installation\n\n```sh\npip install predictable\n```\n\n## Quick start example\n\nA `model.py` file will be used to house the modelling logic which will be applied to each modelpoint.\n\n```python\n# import the library\nfrom predictable import CashFlow, DiscountFactors, Model, StaticCashFlow\n\n# Create new model instance\nmodel = Model()\n\n# Add a premium component\nmodel.add_component(\n    CashFlow(\n        input_array=[100], formula=lambda prev: prev * 1.05, label=\"premium\"\n    )\n)\n\n# Add a sum assured component\nmodel.add_component(CashFlow(label=\"cover\", input_array=[1_000_000]))\n\n# Add an expense component\nmodel.add_component(\n    StaticCashFlow(\n        input_array=[10, 10, 10, 10, 10],\n        label=\"expense\",\n    )\n)\n\n# Add discounting component\nmodel.add_component(DiscountFactors(interest_rate=0.05, label=\"V\"))\n\n# Project cashflows over term\n# Results return a pandas df object\ndf = model.project(term=10)\n\n# Perform linear combination style manipulations\n# Discounting the components\ncomponents = [\"premium\", \"cover\", \"expense\"]\nfor component in components:\n    df[f\"V_{component}\"] = df[component] * df[\"V\"]\n\n\n# Define reserving relationship\ndf[\"Reserve\"] = df[\"V_cover\"] + df[\"V_expense\"] - df[\"V_premium\"]\n\n# Results get returned as a pandas dataframe\nprint(df)\n```\n\n## Documentation\n\nThis project is documented using sphinx and the full documentation can be found at [predictable.readthedocs.io](https://predictable.readthedocs.io/en/latest/).\n\n## Development \u0026 Contibutions\n\nThe following steps can be followed to set up a development environment.\n\n1. Clone the project:\n\n    ```sh\n    git clone https://github.com/RatulMaharaj/predictable.git\n    cd predictable\n    ```\n\n2. Install [hatch](https://hatch.pypa.io/latest/)\n\n    ```sh\n    pipx install hatch\n    ```\n\n3. Enter the default environment (this will activate the default virtual environment and install the project in editable mode).\n\n    ```sh\n    hatch shell default\n    ```\n\n### Testing\n\nThis project uses `pytest` for testing purposes. The tests can be found in the `tests` directory. Tests will run after every commit (locally) and on every push (using github actions) but can also be run manually using:\n\n```sh\nhatch run test\n```\n\n### Linting\n\nThis project is linted using `ruff` and formatted with `black`. The linting and formatting can be run manually using:\n\n```sh\nhatch run lint\n```\n\n```sh\nhatch run format\n```\n\n### Editing the docs\n\nThe documentation for this project can be found in the `docs` directory. The documentation is created using mkdocs and can be viewed locally using:\n\n```sh\nhatch run docs:serve\n```\n\nThe docs can also be built for deployment using:\n\n```sh\nhatch run docs:build\n```\n\n## License\n\n[MIT](https://github.com/RatulMaharaj/predictable/blob/main/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratulmaharaj%2Fpredictable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fratulmaharaj%2Fpredictable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fratulmaharaj%2Fpredictable/lists"}