Skip to main content

Curo Python

Build Status codecov GitHub License

Curo Python is a powerful, open-source library for performing instalment credit financial calculations, from simple loans to complex leasing and hire purchase agreements. Built from the ground up in Python, it leverages pandas DataFrames for cash flow management and SciPy for efficient solving of unknown values or rates using Brent's method.

Explore the documentation, or try it in action with the Curo Calculator, a Flutter app showcasing similar functionality.

Why Curo Python?

Curo Python is designed for developers and financial professionals who need robust tools for fixed-term credit calculations. It goes beyond basic financial algebra, offering features typically found in commercial software, such as:

  • Solving for unknown cash flow values (e.g., instalment amounts).
  • Calculating implicit interest rates (e.g., IRR or APR).
  • Support for multiple day count conventions, including EU and US regulatory standards.
  • Flexible handling of cash flow series for loans, leases, and investment scenarios.

Check out the examples folder for practical use cases and accompanying cash flow diagrams that visualise inflows and outflows.

Getting Started

Installation

Install Curo Python using your preferred package manager:

With pip:

$ pip install --user curo

With uv:

$ uv add curo

Basic Usage

Curo Python makes financial calculations intuitive. Below are two examples demonstrating how to solve for an unknown cash flow value and an implicit interest rate.

Example 1: Solving for an Unknown Cash Flow Value

Calculate the monthly instalment for a $10,000 loan over 6 months at an 8.25% annual interest rate.

from curo import Calculator, Mode, SeriesAdvance, SeriesPayment, US30360

# Step 1: Create a calculator instance
calculator = Calculator()

# Step 2: Define cash flow series
calculator.add(
    SeriesAdvance(label="Loan", amount=10000.0)
)
calculator.add(
    SeriesPayment(
        number_of=6,
        label="Instalment",
        amount=None,  # Set to None for unknown value
        mode=Mode.ARREAR
    )
)

# Step 3: Solve for the instalment amount
result = calculator.solve_value(
    convention=US30360(),
    interest_rate=0.0825
)
print(f"Monthly instalment: ${result:.2f}")  # Output: $1707.00

Example 2: Solving for the Implicit Interest Rate

Find the internal rate of return (IRR) for a €10,000 loan repaid in 6 monthly instalments of €1,707.

from curo import Calculator, EU200848EC, Mode, SeriesAdvance, SeriesPayment, US30360

# Step 1: Create a calculator instance
calculator = Calculator()

# Step 2: Define cash flow series
calculator.add(
    SeriesAdvance(label="Loan", amount=10000.0)
)
calculator.add(
    SeriesPayment(
        number_of=6,
        label="Instalment",
        amount=1707.00,
        mode=Mode.ARREAR
    )
)

# Step 3: Calculate the IRR and APR
irr = calculator.solve_rate(convention=US30360())
apr = calculator.solve_rate(convention=EU200848EC())

print(f"IRR: {irr * 100:.6f}")  # Output: 8.250040%
print(f"APR: {apr * 100:.6f}")  # Output: 8.569257%

Key Features

Day Count Conventions

Day count conventions determine how time intervals between cash flows are measured. Curo Python supports a wide range of conventions to meet global financial standards:

Convention Description
Actual ISDA Uses actual days, accounting for leap and non-leap year portions.
Actual/360 Counts actual days, assuming a 360-day year.
Actual/365 Counts actual days, assuming a 365-day year.
EU 30/360 Assumes 30-day months and a 360-day year, per EU standards.
EU 2023/2225 Compliant with EU Directive 2023/2225 for APR calculations in consumer credit.
UK CONC App Supports UK APRC calculations for consumer credit, secured or unsecured.
US 30/360 Default for many US calculations, using 30-day months and a 360-day year.
US 30U/360 Like US 30/360, but treats February days uniformly as 30 days.
US Appendix J Implements US Regulation Z, Appendix J for APR in closed-end credit.

For XIRR-style calculations (referencing the first drawdown date), pass use_xirr_method=True to the convention constructor. When used with Actual/365, this matches Microsoft Excel’s XIRR function.

Cash Flow Diagrams

Cash flow diagrams visually represent the timing and direction of financial transactions. For example, a €10,000 loan repaid in 6 monthly instalments would look like this:

Cash Flow Diagram

  • Down arrows: Money received (e.g., loan advance).
  • Up arrows: Money paid (e.g., instalments).
  • Time line: Represents the contract term, divided into compounding periods.

License

Copyright © 2026, Andrew Murphy. Released under the MIT License.

Learn More

  • Examples: Dive into practical use cases in the examples folder.
  • Documentation: Refer to the code documentation for detailed class and method descriptions.
  • Issues & Contributions: Report bugs or contribute on GitHub.

Metadata

Release files for curo 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for curo 1.0.0
File Size Uploaded
curo-1.0.0.tar.gz 372.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for curo 1.0.0
File Interpreter ABI Platform
curo-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 414.5 kB

Release files / curo-1.0.0.tar.gz

Download URL curo-1.0.0.tar.gz
Size 372.6 kB
Tags Source
SHA-256 checksum
How to use checksums
02eca8a8b6fa053693f761181d5d5d5249483f2b8c8d1d9e00cb834f65eca8b7
BLAKE2b-256 checksum
How to use checksums
0c0a3859160aa54acc1995ee364dff9db142851e97557b327f784d3e4d99beb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release files / curo-1.0.0-py3-none-any.whl

Download URL curo-1.0.0-py3-none-any.whl
Size 41.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ba9357cccb3c7385a1a6b2be85063d655806c31b4d4d13d69dfc2df172fe6aa
BLAKE2b-256 checksum
How to use checksums
163b4040d954e2caac0e3374e6e97a87837c5c1b3c7e203aee143c778c6261f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page