1 file was added to this release more than 14 days after its initial publication. Inspect the release files before installing.
PyInsurance
A Python library for insurance portfolio management, featuring advanced portfolio protection strategies.
Features
- TIPP Strategy: Time Invariant Portfolio Protection implementation
- High Performance: Cython-optimized core calculations
- Type Safety: Full type hints and static type checking
- Documentation: Comprehensive docstrings and examples
Installation
pip install pyinsurance
For development:
git clone https://github.com/yourusername/pyinsurance.git
cd pyinsurance
pip install -e ".[dev]"
Quick Start
import numpy as np
from pyinsurance.portfolio import TIPP
# Initialize parameters
capital = 100.0
multiplier = 10.0
rr = np.array([0.01, 0.02, -0.01]) # Return rates
rf = np.array([0.001, 0.002, 0.001]) # Risk-free rates
lock_in = 0.05 # 5% lock-in rate
min_risk_req = 0.40 # 40% minimum risk requirement
min_capital_req = 0.80 # 80% minimum capital requirement
# Create TIPP model
tipp = TIPP(
capital=capital,
multiplier=multiplier,
rr=rr,
rf=rf,
lock_in=lock_in,
min_risk_req=min_risk_req,
min_capital_req=min_capital_req
)
# Run the strategy
tipp.run()
# View results
print(tipp)
Documentation
TIPP Strategy
The Time Invariant Portfolio Protection (TIPP) strategy is designed to protect investment capital while maintaining upside potential. Key features:
- Dynamic floor adjustment
- Capital protection mechanism
- Risk allocation optimization
- Liquidity injection management
API Reference
TIPP Class
class TIPP:
def __init__(
self,
capital: float,
multiplier: float,
rr: NDArray[np.float64],
rf: NDArray[np.float64],
lock_in: float,
min_risk_req: float,
min_capital_req: float,
freq: float = 252
) -> None:
"""Initialize TIPP model with parameters."""
Properties
portfolio: Current portfolio valuesref_capital: Reference capital valuesmargin_trigger: Margin trigger valuesfloor: Floor valuesmin_risk_req: Minimum risk requirementmin_capital_req: Minimum capital requirementlock_in: Lock-in ratemultiplier: Risk multiplierrr: Return rate arrayrf: Risk-free rate array
Development
Setup
- Clone the repository
- Create a virtual environment
- Install development dependencies:
pip install -e ".[dev]"
Testing
pytest
Type Checking
mypy .
Code Style
black .
isort .
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and type checking
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Inspired by academic research in portfolio insurance
- Built with Python and Cython
- Uses NumPy for numerical computations
Metadata
Release files for pyinsurance 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
File added late
1 file was uploaded more than 14 days after the first file in this release.
While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.
We recommend inspecting the release files before installing.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyinsurance-2.0.0.tar.gz | 203.9 kB | Without provenance | Details for pyinsurance-2.0.0.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyinsurance-2.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 | Details for pyinsurance-2.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl |
| pyinsurance-2.0.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 | Details for pyinsurance-2.0.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
Total release size: 1.8 MB
Release files / pyinsurance-2.0.0.tar.gz
| Download URL | pyinsurance-2.0.0.tar.gz |
|---|---|
| Size | 203.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78c7ac589d79a373660afc389ccd5c434a5b194e14f5fecca9bb67eb1dd56445
|
|
BLAKE2b-256 checksum How to use checksums |
2d489a9f9f37f972c8950442f492ac39e2377de77d2a70535db983101773bfde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.2
|
Release files / pyinsurance-2.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pyinsurance-2.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 785.2 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
d05259d922b0b31ee9463438b6f21e03d4ec3c4b056dc2a7a26d97a493923320
|
|
BLAKE2b-256 checksum How to use checksums |
6a6f46507b74062e99dbbf3cac3276185c7c1ac654bf070c48738c41f1d43f8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.2
|
Release files / pyinsurance-2.0.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
File added late
This file was uploaded more than 14 days after the first file in this release.
While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.
We recommend inspecting the release file before installing.
| Download URL | pyinsurance-2.0.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 773.9 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c3e66c3cd293097d6ffd26a89df578e7c1258af3dbdd0511067bce7d3cade0ce
|
|
BLAKE2b-256 checksum How to use checksums |
d88271aa1a55ce708a5196690afb3d31a49e82a3d974bceded70425ce728af1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.2
|
Security for pyinsurance 2.0.0
Upload timing
Release file added late
1 file was uploaded more than 14 days after the first file in this release.
While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.