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.0.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.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rate_calculator-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 8a8d049ccfa0064ac02e6aad9768858805c8c030bbe706424274c25a2d72dce0
MD5 57cdf4afa1c0633a03d2ad2fd07a6a8a
BLAKE2b-256 8b3533501ee2e4a72896e64e874675e0b0b3b048d31f90eb18da39d81d08a641

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rate_calculator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0055ec8d3d8d5cb57aa096749ef75255c0575007401d6120e59c7ec02fd12f7
MD5 9deac2fd7870fcb1eb3b7c9f73e0213d
BLAKE2b-256 5b142438f085d4aba31dbe287913f53db6b25a1045f4ac302c886726a7e11477

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