Skip to main content

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 amounts
  • profiles: numpy array of shape (n, m) - repricing profiles
  • rates: 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 stock
  • stock_instal: Stock installments
  • varstock_amort: Variable stock (amortized)
  • varstock_instal: Variable stock (installments)
  • ftp_rate: Calculated FTP rate
  • ftp_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ftp_calculator-0.1.809.tar.gz (15.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ftp_calculator-0.1.809-cp314-cp314-macosx_11_0_arm64.whl (528.4 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

ftp_calculator-0.1.809-cp314-cp314-macosx_10_12_x86_64.whl (536.1 kB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

ftp_calculator-0.1.809-cp312-cp312-win_amd64.whl (458.1 kB view details)

Uploaded CPython 3.12Windows x86-64

ftp_calculator-0.1.809-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (562.9 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file ftp_calculator-0.1.809.tar.gz.

File metadata

  • Download URL: ftp_calculator-0.1.809.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for ftp_calculator-0.1.809.tar.gz
Algorithm Hash digest
SHA256 3d2df5193592e85402e67f2015ba92b1bcdc1d3c450e746c1811d736bf556ede
MD5 978ff9f14a30ab1f5e00220dd8487fcb
BLAKE2b-256 555cc284c8cf34fd28a61fd6b23f110ecc01398ebc3acb61881cf01d1f2958b3

See more details on using hashes here.

File details

Details for the file ftp_calculator-0.1.809-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ftp_calculator-0.1.809-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1e5a36a43ddd602e4758198d8b9427761e5dd80c7e86f7b5a3b10d510eee6584
MD5 dd3eba224892c3df92005f531356457b
BLAKE2b-256 3197857b1e7c7cd06f917994633be063c8852bb802586ed4e6ad1c45c8f3b29a

See more details on using hashes here.

File details

Details for the file ftp_calculator-0.1.809-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ftp_calculator-0.1.809-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 205536c608cd937903576233fd71c7d04313da2d619f15768ba536abc40bbc7f
MD5 d3dfac5beab27bbd4a3f139d3bd38900
BLAKE2b-256 ea1acd4e57ea817af7e8df7e35eb18d8d145e920fa7ffaaf58d3a2076038fc4e

See more details on using hashes here.

File details

Details for the file ftp_calculator-0.1.809-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for ftp_calculator-0.1.809-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 789dee156c633f6f3130802ae9c42b4023cebd0c3220b3a4b747e64e090d6ecc
MD5 c66514230e32752f36a71cdd0b22d574
BLAKE2b-256 f0d277f17dd78b7e121166b0438738824c178836fd69167bfc3326699dc01be4

See more details on using hashes here.

File details

Details for the file ftp_calculator-0.1.809-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ftp_calculator-0.1.809-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9b5eff3735bf9cd912163fe25087c9b41dddd1df34f700802ef6ce2511214c2f
MD5 bff638e027f4ca4ab4182ecfed3f4414
BLAKE2b-256 b50883d2da3fddfd98c73dce8f35e64bf6a076a12c418496c4490c770dc6250d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page