Skip to main content

An easy-to-use, dependency-free Canadian sales and income tax calculator.

Project description

🇨🇦 Canatax – The Canadian Tax Calculator

Canatax is a dependency-free Python package for calculating Canadian income and sales taxes, including all federal and provincial deductions. It supports CPP, EI, QPIP, QPP, and automatically applies GST, PST, HST, or QST based on the province or territory.

📦 Zero dependencies.
🧮 Always current.
🧊 Frozen-rate models built for accuracy.

🚀 Features

Income Tax Calculation

  • Calculates:
    • Federal tax
    • Provincial/territorial tax
    • CPP or QPP (based on province)
    • EI or EI (Quebec)
    • QPIP (Quebec parental leave)
  • Returns a structured IncomeTaxEstimate with:
    • Individual line items
    • Total deductions
    • Net after-tax income

Sales Tax Estimation

  • Calculates:
    • GST, PST, HST, and QST
  • Returns a SalesTaxEstimate with:
    • Breakdown by tax type
    • Total tax
    • After-tax amount

📦 Installation

pip install canatax

💼 Usage

Income Tax

from canatax import IncomeTaxCalculator

estimate = IncomeTaxCalculator.calculate(income=80000, province="BC")

print(estimate.province)
print(estimate.federal_tax)
print(estimate.provincial_tax)
print(estimate.cpp)
print(estimate.qpp)
print(estimate.qpip)
print(estimate.ei)
print(estimate.total_tax)
print(estimate.net_income)

Sales Tax

from canatax import SalesTaxCalculator

estimate = SalesTaxCalculator.calculate(amount=100.00, province="QC")

print(estimate.province)
print(estimate.gst)
print(estimate.qst)
print(estimate.pst)
print(estimate.hst)
print(estimate.tax_total)
print(estimate.after_tax)
print(estimate.before_tax)

📘 API Overview

  • IncomeTaxCalculator.calculate(income, province)
    → returns IncomeTaxEstimate
  • SalesTaxCalculator.calculate(amount, province)
    → returns SalesTaxEstimate

Both calculators also support manual instantiation with ._calculate() as an instance method if preferred.

🤝 Contributing

Bug fixes and suggestions are welcome! Open an issue or submit a pull request.

🔒 License

MIT – Free for personal or commercial use. Go nuts.

☕ Support

If you found this useful and want to support future development,
you can buy me a coffee. It helps keep the lights on and the tax brackets fresh.

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

canatax-2.0.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

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

canatax-2.0.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file canatax-2.0.0.tar.gz.

File metadata

  • Download URL: canatax-2.0.0.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for canatax-2.0.0.tar.gz
Algorithm Hash digest
SHA256 81ec4826d526d554bf09bf81a68521e7d22ddcd906e058ba40fe075ee6a0459d
MD5 9dfbf4280e9272b319e49497ea410126
BLAKE2b-256 935921edd550c7a08db85a8ab21d6f70750b1be3b99314398168ac94f41437fb

See more details on using hashes here.

File details

Details for the file canatax-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: canatax-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for canatax-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 225b79efe7a773d1dd7a115a438ab20cb34b760317d8513402a2af4978d018c3
MD5 f53eeb4d725d9ace2f6649f5ddfc23dd
BLAKE2b-256 fb1cd727928d68bc1e4edc29cb77d57b6c336476dd5517faf33231f3a2aaed88

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