Skip to main content

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

Project description

Canatax: The Canadian Tax Calculator

Development Status

Note: This package is currently in development. Expect frequent updates and potential breaking changes.

Canatax is a simple and straightforward package for calculating Canadian sales or income taxes based on the current year's rates. Whether you need to calculate federal and provincial income taxes, CPP, EI, or estimate GST/PST/HST across different provinces and territories, Canatax provides an easy-to-use interface with no additional dependencies.

Features

  • Income Tax Calculation:

    • Current Year Rates: Calculates taxes based on the most up-to-date rates for the current year.
    • Federal and Provincial Taxes: Automatically determines federal and provincial taxes based on your income and province.
    • CPP and EI Deductions: Includes Canada Pension Plan (CPP) and Employment Insurance (EI) deductions in the calculation.
    • After-Tax Income: Provides your net income after all deductions.
  • Sales Tax Estimation:

    • Provincial and Territorial Rates: Estimates GST, PST, and HST for all Canadian provinces and territories.
    • Customizable Inputs: Allows for quick calculations with adjustable amounts and locations.

Installation

You can install Canatax via pip:

pip install canatax

Usage

Income Tax Calculation with the IncomeTaxCalculator Class

Use the IncomeTaxCalculator class to calculate your income taxes:

from canatax import IncomeTaxCalculator

# Example income and province
income = 80000
province = "AB"

# Calculate tax estimate
estimate = IncomeTaxCalculator.calculate(income=income, province=province)

# Or create an instance of TaxCalculator, if you prefer
calculator = IncomeTaxCalculator(income=income, province=province)
income_estimate = calculator.calculate_all()

# Output the results
print(estimate.federal_tax)
print(estimate.provincial_tax)
print(estimate.cpp)
print(estimate.ei)
print(estimate.total_tax)
print(estimate.after_tax_income)

Sales Tax Calculation with the SalesTaxCalculator Class

Use the SalesTaxCalculator class to calculate sales taxes:

from canatax import SalesTaxCalculator

# Example amount and province
amount = 100.00
province = "BC"

# Calculate sales tax estimate
sales_estimate = SalesTaxCalculator.quick_calc(amount=amount, province=province)

# Or create an instance of SalesTaxCalculator
sales_tax_calculator = SalesTaxCalculator(province=province)
sales_estimate = sales_tax_caluclator.calculate() 

# Output the results
print(sales_estimate.gst_total)
print(sales_estimate.pst_total)
print(sales_estimate.hst_total)
print(sales_estimate.tax_total)
print(sales_estimate.after_tax_total)

Roadmap

  • Additional Features:
    • Expand support for retroactive tax calculations for previous years.
    • Increase testing
    • Add more detailed documentation and usage examples.

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss your ideas.

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-1.3.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

canatax-1.3.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for canatax-1.3.0.tar.gz
Algorithm Hash digest
SHA256 497645c3db56dbbe74d98e465cf78abc5797fc5e8efa4813a80f1c1db67f4b17
MD5 e719bb3f2c0da2411d0b2b629a4c26ee
BLAKE2b-256 a876b3be32cdef66b50d57e02ce2351141e8a972cb0335d5d95e15e84bc1748b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for canatax-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 abd90ce4dfd54c65ca81e12942b96aef4bc03e7f565fb45eba4bc6778e799ba9
MD5 74e4138c34deac4357ba5350afcac7d0
BLAKE2b-256 b7f95ff633d9063ac8cb68767a82483129b961b1c2e62f35b286a4178a9725ac

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