Linear Rates Quantitative Library package for Python
Project description
linerapy
A quantitative libary for linear interest rates - LineRaPy (Pronunciation: /ˈlɪniər paɪ/). A new type YieldCurve represents the yield curve. It can be constructed using the key rates, e.g. tenors and values.
Requirements
- Python 3.12+
- Windows / Linux
Installation
pip install linerapy
Usage
import linerapy
# Example - basic usage
obj_dict = {
'id': 'USD SOFR',
'value date': datetime.datetime(2026, 3, 20).date(),
'currency': 'USD',
'instruments': {
'generator': [ 'USD SOFR SW', 'USD SOFR SW', 'USD SOFR SW', 'USD SOFR SW'],
'tenor': [ '1M', '6M', '1Y', '2Y' ],
'quote': [ 3.65, 3.65, 3.65, 3.65 ],
'in use': [ True, True, True, True ]
}
}
yield_curve = linerapy.YieldCurve(obj_dict)
print('Discount Factor:', yield_curve.df(datetime.datetime(2027, 3, 20).date()))
print('Date', 'Zero Rate', 'Discount Factor')
for d, r in zip(yield_curve.dates(), yield_curve.rates()):
print(d, r, yield_curve.df(d))
API Reference
dates()
Returns the yield curve's dates.
Returns:
list: List of dates.
Example:
>>> yield_curve_.dates()
[datetime.date(2026, 4, 28), datetime.date(2026, 9, 28), datetime.date(2027, 3, 26), datetime.date(2028, 3, 28)]
rates()
Returns the zero rates corresponding to the yield curve's dates.
Returns:
list: List of zero rates.
Example:
>>> yield_curve_.rates()
[0.03694890857811573, 0.0366704955510695, 0.03634333943914385, 0.03634104468177242]
License
MIT License - see LICENSE for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file linerapy-0.1.1-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: linerapy-0.1.1-cp314-cp314-win_amd64.whl
- Upload date:
- Size: 130.9 kB
- Tags: CPython 3.14, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f3b13f008103d8174c50cb1ba06fd947c3a6b5fb52bcb25fe5dc94078e78753
|
|
| MD5 |
91075ea72b2b2fe1497cba478e992a17
|
|
| BLAKE2b-256 |
896350c38b8e09226999cff8c41720324bbb35e0e5baebd629ec2d00e1d374cc
|
File details
Details for the file linerapy-0.1.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: linerapy-0.1.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 237.7 kB
- Tags: CPython 3.14, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8fa8d8377a00dc81e8ec862f0cddcd4b5e149724e4ea2bc99f1c0aec0f11e23
|
|
| MD5 |
77078d00e9fea5df4aa1574f9a3dc086
|
|
| BLAKE2b-256 |
304a659a27952533ebe3d0bb82495d717ef0363b4c84b29976b06316220d4f90
|
File details
Details for the file linerapy-0.1.1-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: linerapy-0.1.1-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 126.8 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d798041153e6fc262301d415f0d1bf68a57d7c2f611ffcc0a76a4827b5621d1
|
|
| MD5 |
0c48551f33b25a0d55d51377a8a56be4
|
|
| BLAKE2b-256 |
8ee9bf2eeff8d79a4b8ecfde0ad191915bd2bfa5f5f0205bed9b7452a47d8074
|
File details
Details for the file linerapy-0.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: linerapy-0.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 237.7 kB
- Tags: CPython 3.13, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4da34c650b77e440c86f1418337d3be77397e13b0bd7b9ddd65c0de5981214bf
|
|
| MD5 |
9b6e1d1d08a45176ba6636abf3a76586
|
|
| BLAKE2b-256 |
5288c94475b3253a50e207af5ba02037525e2a8d168dbb3b228c0b2b08288cd8
|
File details
Details for the file linerapy-0.1.1-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: linerapy-0.1.1-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 126.8 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1abc74f835e9add803fcef4e70df89c3bad3392fb686355dbd26acd4c195a53
|
|
| MD5 |
da3373aad1b745b46a30195fb497374f
|
|
| BLAKE2b-256 |
3cf101da435b9fa0f90557b70f2c727e1a068603e359c87323b77f1469d8a3ef
|
File details
Details for the file linerapy-0.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: linerapy-0.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 237.7 kB
- Tags: CPython 3.12, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80f091dc87819ed4f060d40a6b4cb7f82e9b107678d0c011ea7ca73883108e1f
|
|
| MD5 |
cb6015a3133679e398daad3d84b1e4e2
|
|
| BLAKE2b-256 |
77fa373b172e2d374e2cfd49d5078091a78cd4801a5ce7fae00af84da2a161cb
|