Funds Transfer Pricing (FTP) calculator — Python bindings for a Rust engine
Project description
ftp-calculator
Python bindings for the FTP (Funds Transfer Pricing) calculator core engine written in Rust.
Installation
pip install ftp-calculator
Usage
import numpy as np
from ftp_core import FtpCalculator, compute_stock, compute_flux
outstanding = np.array([[1000.0], [1200.0], [1350.0]])
profiles = np.array([
[1.00, 0.50, 0.20, 0.05],
[1.00, 0.50, 0.20, 0.05],
[1.00, 0.50, 0.20, 0.05],
])
rates = np.array([
[0.01300, 0.01400, 0.01600],
[0.01360, 0.01460, 0.01660],
[0.01430, 0.01530, 0.01730],
])
# Class-based API
calc = FtpCalculator(outstanding, profiles, rates)
calc.compute("stock") # or "flux"
print(calc.ftp_rate) # numpy 2D array
print(calc.ftp_int)
# One-shot functional API
result = compute_stock(outstanding, profiles, rates)
print(result["ftp_rate"])
print(result["ftp_int"])
API
FtpCalculator(outstanding, profiles, rates)
Create a calculator instance with input matrices.
Parameters:
outstanding: numpy array of shape (n, 1) - loan/position amountsprofiles: numpy array of shape (n, m) - repricing profilesrates: numpy array of shape (n, m-1) - market rates
Methods:
compute(method): Run computation using "stock" or "flux" method
Properties (available after compute):
stock_amort: Amortized stockstock_instal: Stock installmentsvarstock_amort: Variable stock (amortized)varstock_instal: Variable stock (installments)ftp_rate: Calculated FTP rateftp_int: FTP interest (monthly)market_rate: Market rate
compute_stock(outstanding, profiles, rates)
One-shot computation using the stock method.
Returns: Dictionary with all output matrices as numpy arrays.
compute_flux(outstanding, profiles, rates)
One-shot computation using the flux method.
Returns: Dictionary with all output matrices as numpy arrays.
Development
This package is part of the FTP Calculator project.
See the main repository for build instructions and documentation.
License
MIT OR Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 ftp_calculator-0.1.807.tar.gz.
File metadata
- Download URL: ftp_calculator-0.1.807.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50a1e471d9a5c07af1c9e145ec3981c54944dd3c7ca16183a956745dd132beb5
|
|
| MD5 |
07b88d3271fbbe914c59429add527584
|
|
| BLAKE2b-256 |
8ca392c4ecb5b3babc7135a00c84ba6fc8c270937d679420b7acdc607feee43f
|
File details
Details for the file ftp_calculator-0.1.807-cp314-cp314-macosx_11_0_arm64.whl.
File metadata
- Download URL: ftp_calculator-0.1.807-cp314-cp314-macosx_11_0_arm64.whl
- Upload date:
- Size: 528.2 kB
- Tags: CPython 3.14, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c2e9c59477492dd3b69dcd66cb95d93eaaa59d8887729008168cf26b2c13637
|
|
| MD5 |
cffab2c2d88f28025186b912ceac76d4
|
|
| BLAKE2b-256 |
61c7863ddd3baf69d10854100fe38ca80fdb2b973f1a0f1c68a02f8078ba7212
|
File details
Details for the file ftp_calculator-0.1.807-cp314-cp314-macosx_10_12_x86_64.whl.
File metadata
- Download URL: ftp_calculator-0.1.807-cp314-cp314-macosx_10_12_x86_64.whl
- Upload date:
- Size: 535.9 kB
- Tags: CPython 3.14, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e42fd7b98be40dbf4a00f6c7f3ceea886037240a5dd6301dba53a8ae3e46604e
|
|
| MD5 |
c37369685b2191696aaf7e18616feecd
|
|
| BLAKE2b-256 |
2b69a870fa604665bc7e62d0e31b76a66561e7012c46d701ab46baee8a51a002
|
File details
Details for the file ftp_calculator-0.1.807-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: ftp_calculator-0.1.807-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 458.1 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ef153ea9a1e06bd42432f72ce9d6b7409e8481f5be4ad25afef64054a45de20
|
|
| MD5 |
e2245e54a005cdc82f327b865628a090
|
|
| BLAKE2b-256 |
8d11328097d4ca6e06f8916b24911c47b960e4af563678d832d5e3bd1877cdde
|
File details
Details for the file ftp_calculator-0.1.807-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: ftp_calculator-0.1.807-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 562.9 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66d995a17ec2edb20ad1c46d893b6af604a9b7d40620c9c41ceb81e4e7e935c0
|
|
| MD5 |
6b197386cbfda53edfc5270131e67cc1
|
|
| BLAKE2b-256 |
d97478d14581e6314c2972cb0f8f6cfef2e2383f8cc2c1906c924c627e7d9fd6
|