Skip to main content

A real-world Python calculation utility library — finance, geometry, unit conversion

Project description

smartcalc

A real-world Python calculation utility library — zero dependencies, pure Python, Bangladesh-friendly.

Python 3.8+ License: MIT PyPI version

ইনস্টলেশন

pip install smartcalc

কী কী আছে?

Module বিবরণ
basic যোগ, বিয়োগ, গুণ, ভাগ, গড়, clamp
advanced EMI, tax, discount, সুদ, লাভ-ক্ষতি, bill split
converter তাপমাত্রা, দূরত্ব, ওজন, BDT/USD, storage
geometry ক্ষেত্রফল, পরিমিতি, আয়তন

Quick Start

from smartcalc import tax, emi, discount, area_circle

# ভ্যাট হিসাব
print(tax(1000, 15))
# {'base': 1000, 'tax_rate': 15, 'tax_amount': 150.0, 'total': 1150.0}

# EMI হিসাব (৫ লক্ষ টাকা, ১২% সুদ, ২৪ মাস)
result = emi(500000, 12, 24)
print(f"মাসিক EMI: ৳{result['monthly_emi']:,.2f}")

# ছাড় হিসাব
print(discount(2000, 20))
# {'original': 2000, 'discount_percent': 20, 'discount_amount': 400.0,
#  'final_price': 1600.0, 'savings': 400.0}

# বৃত্তের ক্ষেত্রফল
print(area_circle(7))  # 153.938

Financial Examples

from smartcalc import compound_interest, profit_loss, split_bill, simple_interest

# চক্রবৃদ্ধি সুদ (১ লক্ষ টাকা, ১০%, ৫ বছর, মাসিক)
ci = compound_interest(100000, 10, 5)
print(f"মোট: ৳{ci['total_amount']:,}")       # ৳164,530.88
print(f"সুদ: ৳{ci['interest_earned']:,}")    # ৳64,530.88

# লাভ-ক্ষতি
pl = profit_loss(cost_price=45000, selling_price=54000)
print(f"{pl['type']}: {pl['percent']}%")    # profit: 20.0%

# রেস্টুরেন্ট বিল ৪ জনে ভাগ (১০% tip সহ)
bill = split_bill(1200, 4, tip_pct=10)
print(f"জনপ্রতি: ৳{bill['per_person']}")    # ৳330.0

Unit Converter Examples

from smartcalc import (
    celsius_to_fahrenheit, km_to_miles,
    bdt_to_usd, usd_to_bdt, kg_to_lbs, mb_to_gb
)

print(celsius_to_fahrenheit(37))     # 98.6 (জ্বর)
print(km_to_miles(100))              # 62.1371
print(bdt_to_usd(11000, rate=110))   # 100.0
print(usd_to_bdt(100, rate=110))     # 11000.0
print(kg_to_lbs(70))                 # 154.3234
print(mb_to_gb(2048))                # 2.0

Geometry Examples

from smartcalc import (
    area_rectangle, area_triangle, volume_sphere,
    volume_cylinder, hypotenuse
)

room = area_rectangle(12, 8)         # 96 বর্গমিটার
triangle = area_triangle(10, 6)      # 30.0
ball = volume_sphere(5)              # 523.5988
tank = volume_cylinder(1.5, 3)       # 21.2058
c = hypotenuse(3, 4)                 # 5.0

সম্পূর্ণ Function List

basic

add, subtract, multiply, divide, power, modulo, average, clamp

advanced

percentage, percentage_of, add_percentage, tax, discount, emi, simple_interest, compound_interest, profit_loss, split_bill

converter

celsius_to_fahrenheit, fahrenheit_to_celsius, km_to_miles, miles_to_km, cm_to_inches, inches_to_cm, kg_to_lbs, lbs_to_kg, grams_to_oz, oz_to_grams, bdt_to_usd, usd_to_bdt, currency_convert, liters_to_gallons, gallons_to_liters, mb_to_gb, gb_to_tb, kb_to_mb, bytes_to_kb

geometry

area_circle, area_rectangle, area_square, area_triangle, area_trapezoid, area_ellipse, perimeter_circle, perimeter_rectangle, perimeter_square, perimeter_triangle, volume_cube, volume_box, volume_sphere, volume_cylinder, volume_cone, hypotenuse


Contributing

PR এবং Issues স্বাগত। দেখুন CONTRIBUTING.md

License

MIT © smartcalc Team

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

calcly-1.0.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

calcly-1.0.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file calcly-1.0.0.tar.gz.

File metadata

  • Download URL: calcly-1.0.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for calcly-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1cc1e2610d7768450cf170743fd57da2f3532f0172396aa515e16999a9005420
MD5 c1d4baee0f8a2d3b4bc8280e9ed41dbf
BLAKE2b-256 861f984b569a0fabddc31e12fa8222ca3e1458371541dcc03fa3a7a2f1c866d3

See more details on using hashes here.

File details

Details for the file calcly-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: calcly-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for calcly-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16556a0f5a5ac5bb772c68a5f3b3f6a8eaa0905368da5e1b0a9c5a0419a5252a
MD5 43ce8a61d49202e3d0441a5514e21895
BLAKE2b-256 e92ad845853c3b73799fee3444239515dd7e09b1ffdcdcb674d34bac5f35c4bf

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