cashflower-0.3.3
توضیحات
Framework for actuarial cash flow models
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | cashflower-0.3.3 |
| نام | cashflower |
| نسخه کتابخانه | 0.3.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Zuzanna Chmielewska |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/acturtle/cashflower |
| آدرس اینترنتی | https://pypi.org/project/cashflower/ |
| مجوز | - |
[](https://pypi.org/project/cashflower/)
[](https://codecov.io/gh/acturtle/cashflower)
[](https://cashflower.acturtle.com)
# Info
Cashflower is an open-source Python framework for actuarial cash flow models.
# Prerequisities
Python version >=3.9
# Usage
## Installation
terminal
```
pip install cashflower
```
## Create model
python console
```python
from cashflower import create_model
create_model("my_model")
```
## Input
my_model/input.py
```python
main = ModelPointSet(data=pd.read_csv("C:/my_data/main.csv"))
assumption = dict()
assumption["interest_rates"] = pd.read_csv("C:/my_data/interest_rates.csv")
assumption["mortality"] = pd.read_csv("C:/my_data/mortality.csv", index_col="age")
```
## Model
my_model/model.py
```python
age = ModelVariable()
death_prob = ModelVariable()
@assign(age)
def _age(t):
if t == 0:
return int(main.get("AGE"))
elif t % 12 == 0:
return age(t-1) + 1
else:
return age(t-1)
@assign(death_prob)
def _death_prob(t):
if age(t) == age(t-1):
return death_prob(t-1)
elif age(t) <= 100:
sex = main.get("SEX")
yearly_rate = assumption["mortality"].loc[age(t)][sex]
monthly_rate = (1 - (1 - yearly_rate)**(1/12))
return monthly_rate
else:
return 1
```
## Calculate
Run `run.py`
# Quick start
Watch how to create a cash flow model on a YouTube video:
[](https://www.youtube.com/watch?v=xuZaymWsUzw)
# Contribution
The cashflower package is open-source. Everyone can use it and contribute to its development.
GitHub repository:
[https://github.com/acturtle/cashflower](https://github.com/acturtle/cashflower)
Documentation:
[https://cashflower.acturtle.com](https://cashflower.acturtle.com)
نیازمندی
| مقدار | نام |
|---|---|
| - | pandas |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.9 | Python |
نحوه نصب
نصب پکیج whl cashflower-0.3.3:
pip install cashflower-0.3.3.whl
نصب پکیج tar.gz cashflower-0.3.3:
pip install cashflower-0.3.3.tar.gz