Skip to main content

A small CLI to calculate annualized rates from principal, interest, and days.

Project description

rate-calculator

rate-calculator is a small Python CLI for calculating an annualized rate from:

  • principal
  • interest earned
  • holding days

Formula:

annualized_rate(%) = (interest / principal) / (days / 365) * 100

Installation

pip install .

Usage

Run with arguments:

rate-calculator --principal 10000 --interest 150 --days 30

Example output:

Annualized rate: 18.25%

Print only the numeric result:

rate-calculator --principal 10000 --interest 150 --days 30 --raw

You can also run it interactively:

rate-calculator

Development

python -m rate_calculator --principal 10000 --interest 150 --days 30

Run tests:

pytest

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

rate_calculator-0.1.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

rate_calculator-0.1.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file rate_calculator-0.1.1.tar.gz.

File metadata

  • Download URL: rate_calculator-0.1.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for rate_calculator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c1c4c0fa3946ec5f8f3486750e4d6944624535270b9c8198548680a7b2f2eb6f
MD5 1438489407fa84506f7c8410f1f9b6b8
BLAKE2b-256 56b1f0d313bb3d376ba7f89d5b2a6166794f5f14144045ea47663839f277f37d

See more details on using hashes here.

File details

Details for the file rate_calculator-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rate_calculator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 69d428762b8450d4a35bb79580d270e00bed0fd072da79a032e9fb27d56b5adf
MD5 dd217132296f3b3fbade311d613561b3
BLAKE2b-256 fd4e10ca2673f4e7fc5fc6ffa7d7a4526a71aeb2aab7f605c37700914957178c

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