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.816.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.816-cp314-cp314-macosx_11_0_arm64.whl (379.5 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

ftp_calculator-0.1.816-cp314-cp314-macosx_10_12_x86_64.whl (387.2 kB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

ftp_calculator-0.1.816-cp312-cp312-win_amd64.whl (309.2 kB view details)

Uploaded CPython 3.12Windows x86-64

ftp_calculator-0.1.816-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (414.0 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

  • Download URL: ftp_calculator-0.1.816.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.816.tar.gz
Algorithm Hash digest
SHA256 e5ff726d16a5fe63a97ee7c7fa20ea58d79cfb40298bc3185568cadec4e6bd40
MD5 39b1965d71e1c7ea97cf6b9ef277f7a3
BLAKE2b-256 bcef4be274361af6e159bc66361bfa62ed2e49878f52f1a4880a37a31dea0edb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ftp_calculator-0.1.816-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8b74340ec4b187d2e2b7e3856ed71108823fd78ee4cfb546deecd488d23ecade
MD5 9b0a4b3a58179cdbf03bd4e2b4309d65
BLAKE2b-256 91b548204ad0fdea62cabe6e03dbe318097b7df443d5e5db061a13861f3a5ca8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ftp_calculator-0.1.816-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d40078da064410188e424e778821428698324ffd618169f7fbf2b870fe4ba9a9
MD5 625b7386390d8a92fccf166e6d54b282
BLAKE2b-256 ebd66c7ad9f06bad42c47a820e5dd67a8ae46919f2221396083d664230e5222c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ftp_calculator-0.1.816-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6dfab1043b452dd903972a66fa9558b64416872a07aeab7f58c6a6d46f6d6274
MD5 e181efde89fc4f07e268198bd08d2423
BLAKE2b-256 c7433e07559901db72ea34246d1ce925a2ce1575f2f010048b57b8c60ffc8d2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ftp_calculator-0.1.816-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3acebefc2059078d588ccd64878cee6fbb8984ea9cb6a042b7baafb037f92118
MD5 368ca3af482dea1f307ecbcda144a24c
BLAKE2b-256 5e3a47cad3478244f69c989865e62fc4a6f715b7fbe962aac77dd252daf130b4

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