{"id":22612226,"url":"https://github.com/ivanbgd/dask_demo_reins","last_synced_at":"2025-07-12T22:34:23.702Z","repository":{"id":228897632,"uuid":"775209267","full_name":"ivanbgd/dask_demo_reins","owner":"ivanbgd","description":"A Dask library for Big Data processing in Python demo","archived":false,"fork":false,"pushed_at":"2024-03-21T01:02:47.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T18:58:35.507Z","etag":null,"topics":["dask","dask-distributed","distributed","distributed-computing","insurance","larger-than-memory","python","python3","reinsurance"],"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/ivanbgd.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}},"created_at":"2024-03-21T00:38:53.000Z","updated_at":"2024-03-21T01:51:15.000Z","dependencies_parsed_at":"2024-03-21T01:45:52.684Z","dependency_job_id":"f6a4eae6-c099-47ba-a590-60a3bdb4b37b","html_url":"https://github.com/ivanbgd/dask_demo_reins","commit_stats":null,"previous_names":["ivanbgd/dask_demo_reins"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ivanbgd/dask_demo_reins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanbgd%2Fdask_demo_reins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanbgd%2Fdask_demo_reins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanbgd%2Fdask_demo_reins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanbgd%2Fdask_demo_reins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivanbgd","download_url":"https://codeload.github.com/ivanbgd/dask_demo_reins/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanbgd%2Fdask_demo_reins/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265066119,"owners_count":23706062,"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":["dask","dask-distributed","distributed","distributed-computing","insurance","larger-than-memory","python","python3","reinsurance"],"created_at":"2024-12-08T17:11:28.893Z","updated_at":"2025-07-12T22:34:23.675Z","avatar_url":"https://github.com/ivanbgd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\n\nA major commercial insurance company (Company A) insures a number of companies against property damage from adverse events.\nThe companies and the type and location of the covered events are listed in \"deals.csv\".\nTo limit their exposure to potential losses, they decide to buy a reinsurance contract, covering them in case of certain large events.\nThe contract, described in \"contract.json\", covers all events in the USA and Canada, excluding tornados, up to a maximum amount of $3,000 on any one event.\n\nFind the deals covered by the reinsurance contract, filtering \"deals.csv\" using the coverage details in \"contract.json\".\n\nThe output should be something like:\n\n| DealId | Company |   Peril    | Location |\n|:------:|:-------:|:----------:|:--------:|\n|   1    | ClientA | Earthquake |   USA    |\n|   2    | ClientA | Hailstone  |  Canada  |\n|   5    | ClientC | Hurricane  |   USA    |\n\nWhen modeling the risk on this reinsurance contract at Company B we run a\nsimulation to model expected losses to the underlying insurance deals. In the\nscenario described in \"losses.csv\", where a number of events occur, how much could\nCompany A claim on the reinsurance contract?\nGroup the answer by the perils being insured.\n\nThe output should be something like:\n\n|   Peril    | Loss |\n|:----------:|:----:|\n| Earthquake | 3500 |\n| Hurricane  | 3000 |\n\n\n# Implementation\n\nThis implementation is based on the Python [Dask](https://www.dask.org/) library for Big Data processing.\n\nIt can scale up to clusters of computers, but can be used on a single computer just as easily.\nThis means that it can employ multiple cores, as well as multiple processors\non a single computer, or in a cluster (distributed computing).\n\nDask also helps us overcome memory limitations.\nWith Dask, we can use data sets that don't fit in available RAM.\nThis means that if we have a huge input file, we won't have a problem. It will be read in blocks (chunks).\nIn conclusion, this solution will scale well, both CPU-wise and memory-wise.\n\nFile \"requirements.txt\" lists third-party libraries we have used for this project.\nThose are the latest stable versions.\n\nAdditionally, a database could possibly help if it were used to store data from CSV files.\nIt makes sense if we are going to use the data at least several times.\nThis is because we first have to fill the DB with data from a CSV file.\nIn case we are processing data only once, we are probably better off without a DB.\nWe could also write results to a DB.\n\nThere is some input data validation.\n\n\n# Unit Tests\n\nTo run the provided unit test suite, execute:\n\n`python -m unittest`\n\nFor verbose output:\n\n`python -m unittest -v`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanbgd%2Fdask_demo_reins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivanbgd%2Fdask_demo_reins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanbgd%2Fdask_demo_reins/lists"}