semvec/pypi-packages huggingface dataset:
sam-local-watcher 0.1.0
A utility for watching and syncing AWS SAM local development files
Requires Python: >=3.6

# SAM Local Watcher

A utility for watching and syncing AWS SAM local development files.

## Overview

SAM Local Watcher monitors your AWS SAM project files and automatically syncs changes to the `.aws-sam/build` directory. This eliminates the need to rebuild your SAM application after every code change, making local development faster and more efficient.

## Installation

```bash
pip install sam-local-watcher
```

## Usage

### Command Line

```bash
# Watch the current directory using the default template.yaml
sam-watcher

# Watch a specific directory
sam-watcher --path /path/to/sam/project

# Use a different template file
sam-watcher --template sam-template.yaml
```

### Python API

```python
from sam_local_watcher import watch_folder

# Watch the current directory
watch_folder(".", "template.yaml")

# Watch a specific directory with a custom template
watch_folder("/path/to/sam/project", "/path/to/template.yaml")
```

## How It Works

1. SAM Local Watcher parses your SAM template to identify all Lambda functions
2. It creates a mapping between your source code directories and the corresponding functions
3. When a file is modified, it automatically copies the changes to the appropriate location in the `.aws-sam/build` directory

## Supported File Types

Currently, the watcher syncs files with the following extensions:
- `.py` (Python)
- `.js` (JavaScript)
- `.json` (JSON)
- `.txt` (Text)

## License

MIT

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.
heavylight 1.0.10
Heavylight Actuarial Modelling Framework
Requires Python: >=3.8

[![codecov](https://codecov.io/gh/lewisfogden/heavylight/graph/badge.svg?token=P81UIDV4FZ)](https://codecov.io/gh/lewisfogden/heavylight)

# heavylight

A lightweight actuarial modelling framework for Python

- single script
- installation optional: package with your models.
- only depends on `pandas` and `numpy`

## Components

Model:

- projection controller
- class to subclass with your proprietary models
- `BeforeRun` and `AfterRun` methods
- get all values as a list with `values` attribute
- get the sum of all values with `sum()` method


Table:

- simple long format table object
- type information encoded via `|int`, `|int_bound`, `|band`, `|str` header suffixes


## Usage

### Model Class

Create your model as a subclass of `heavylight.Model`.  Each model variable is defined as a method:

```python
import heavylight

class Annuity(heavylight.Model):
    def t(self, t):
        return t

    def expected_claim(self, t):
        return self.number_alive(t) * self.data["annuity_per_period"]

    def number_alive(self, t):
        if t == 0:
            return self.data["initial_policies"]
        else:
            return self.number_alive(t - 1) - self.deaths(t - 1)
    
    def deaths(self, t):
        return self.number_alive(t) * self.mortality_rate(t)

    def mortality_rate(self, t):
        return 0.02

    def v(self, t):
        """discount factor from time t to time 0"""
        if t == 0:
            return 1
        else:
            return self.v(t - 1) / (1 + self.forward_rate(t))
    
    def forward_rate(self, t):
        return 0.04

    def pv_expected_claim(self, t):
        return self.expected_claim(t) * self.v(t)
```

Define input data as a dictionary

```python
policy_data = {
    "initial_policies": 10,
    "annuity_per_period": 55,
}
```

Call the model, passing in the data dictionary, with a projection length of 20.

```python
model = Annuity(data = policy_data,
                do_run = True,
                proj_len = 20,
                )
```

Get the sum of `pv_expected_claim`:

```python
print(model.pv_expected_claim.sum())
```



Display result as a pandas table

```python
model_cashflows = model.ToDataFrame()
```

## Notes

 - This package is designed for projecting actuarial variables, and calculates t=0, 1... in order.

 - Actuarial models are generally highly recursive.

 - If you create a method which refers to future t value (such as an NPV function) you may hit the python stack limit.

 - The recommended solution is to project forward first, and then calculate T0 metrics based on the result, for example using an `npv()`` function