canatax


Namecanatax JSON
Version 2.0.1 PyPI version JSON
download
home_pagehttps://github.com/firstflush/canatax
SummaryAn easy-to-use, dependency-free Canadian sales and income tax calculator.
upload_time2025-09-03 22:26:12
maintainerNone
docs_urlNone
authorMichael Pearce
requires_python>=3.10
licenseMIT
keywords canada tax cpp ei qpp gst hst pst qst income sales payroll
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 🇨🇦 Canatax – Canadian Tax Calculator

[![PyPI - Version](https://img.shields.io/pypi/v/typed-api-response.svg)](https://pypi.org/project/canatax/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/canatax.svg)](https://pypi.org/project/canatax/)
[![Python Version](https://img.shields.io/pypi/pyversions/canatax.svg)](https://pypi.org/project/canatax/)
[![License](https://img.shields.io/pypi/l/canatax.svg)](https://github.com/yourusername/canatax/blob/main/LICENSE)

**Canatax** is a dependency-free Python package for estimating Canadian income and sales taxes. Built for developers who need quick tax calculations for applications, prototyping, or general estimation purposes.

## ⚠️ Important Disclaimer

**This software provides tax estimates only and is not professional accounting software.** I am not a licensed accountant or tax professional. While the calculations are based on current CRA guidelines and provincial tax rates, this tool should not be used as your sole source for tax planning, filing, or financial decisions.

For official tax advice, consult a qualified accountant or use CRA-approved software.

## Features

**Income Tax Estimation:**
- Federal and provincial/territorial income tax
- CPP/QPP contributions (province-specific)
- Employment Insurance (EI) premiums
- Quebec Parental Insurance Plan (QPIP) for Quebec residents
- Basic Personal Amount (BPA) calculations with high-income phase-outs
- Uses **2025 tax rates and brackets**

**Sales Tax Calculation:**
- GST, PST, HST, and QST calculations
- Automatic tax selection based on province/territory
- Structured breakdown of all applicable taxes

**Zero Dependencies:** Pure Python with no external requirements.

## Installation

```bash
pip install canatax
```

## Quick Start

### Income Tax Estimation

```python
from canatax import IncomeTaxCalculator

# Calculate tax estimate for $80,000 income in British Columbia
estimate = IncomeTaxCalculator.calculate(income=80000, province="BC")

print(f"Province: {estimate.province}")
print(f"Federal Tax: ${estimate.federal_tax:,.2f}")
print(f"Provincial Tax: ${estimate.provincial_tax:,.2f}")
print(f"CPP: ${estimate.cpp:,.2f}")
print(f"EI: ${estimate.ei:,.2f}")
print(f"Total Tax: ${estimate.total_tax:,.2f}")
print(f"Net Income: ${estimate.net_income:,.2f}")
```

### Sales Tax Calculation

```python
from canatax import SalesTaxCalculator

# Calculate sales tax for $100 purchase in Quebec
estimate = SalesTaxCalculator.calculate(amount=100.00, province="QC")

print(f"Province: {estimate.province}")
print(f"GST: ${estimate.gst:,.2f}")
print(f"QST: ${estimate.qst:,.2f}")
print(f"Total Tax: ${estimate.tax_total:,.2f}")
print(f"After Tax: ${estimate.after_tax:,.2f}")
```

## API Reference

### IncomeTaxCalculator

**`IncomeTaxCalculator.calculate(income: float, province: str) -> IncomeTaxEstimate`**

Calculates income tax estimate for the given income and province.

**Parameters:**
- `income`: Annual gross income (float)
- `province`: Two-letter province code (e.g., "ON", "BC", "QC")

**Returns:** `IncomeTaxEstimate` object with calculated taxes and deductions.

### SalesTaxCalculator

**`SalesTaxCalculator.calculate(amount: float, province: str) -> SalesTaxEstimate`**

Calculates applicable sales taxes for a purchase amount.

**Parameters:**
- `amount`: Purchase amount before tax (float)
- `province`: Two-letter province code

**Returns:** `SalesTaxEstimate` object with tax breakdown.

### Supported Provinces and Territories

All Canadian provinces and territories are supported:
- **AB, BC, MB, NB, NL, NT, NS, NU, ON, PE, QC, SK, YT**

## Use Cases

- **E-commerce applications:** Calculate tax estimates for shopping carts
- **Payroll prototyping:** Rough estimation of payroll deductions
- **Financial planning tools:** Provide ballpark tax calculations
- **Educational purposes:** Demonstrate Canadian tax system mechanics
- **Budget calculators:** Help users estimate take-home pay

## Accuracy Notes

Tax calculations are based on:
- Current CRA federal tax brackets and rates
- Provincial/territorial tax rates and basic personal amounts (BPAs)
- 2025 CPP, EI, and other contribution limits
- Published GST/PST/HST rates by province

**Limitations:**
- Does not account for tax credits beyond basic personal amounts
- Does not include deductions for RRSP, childcare, etc.
- Simplified calculation model suitable for estimation purposes
- May not reflect mid-year rate changes or special circumstances


## Contributing

Bug reports, feature requests, and contributions are welcome! This project helps developers build better financial tools for Canadians.


## License

MIT License – Free for personal and commercial use.


## Support

If this tool has been helpful for your projects, consider [buying me a coffee](https://www.buymeacoffee.com/FirstFlush). No promises that I'll spend the money responsibly.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/firstflush/canatax",
    "name": "canatax",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "canada tax cpp ei qpp gst hst pst qst income sales payroll",
    "author": "Michael Pearce",
    "author_email": "firstflush@protonmail.com",
    "download_url": "https://files.pythonhosted.org/packages/39/3a/2eac47a5976f81946feac9f15ca43110f9bc24b7013a2e063ac28dfacfe3/canatax-2.0.1.tar.gz",
    "platform": null,
    "description": "# \ud83c\udde8\ud83c\udde6 Canatax \u2013 Canadian Tax Calculator\n\n[![PyPI - Version](https://img.shields.io/pypi/v/typed-api-response.svg)](https://pypi.org/project/canatax/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/canatax.svg)](https://pypi.org/project/canatax/)\n[![Python Version](https://img.shields.io/pypi/pyversions/canatax.svg)](https://pypi.org/project/canatax/)\n[![License](https://img.shields.io/pypi/l/canatax.svg)](https://github.com/yourusername/canatax/blob/main/LICENSE)\n\n**Canatax** is a dependency-free Python package for estimating Canadian income and sales taxes. Built for developers who need quick tax calculations for applications, prototyping, or general estimation purposes.\n\n## \u26a0\ufe0f Important Disclaimer\n\n**This software provides tax estimates only and is not professional accounting software.** I am not a licensed accountant or tax professional. While the calculations are based on current CRA guidelines and provincial tax rates, this tool should not be used as your sole source for tax planning, filing, or financial decisions.\n\nFor official tax advice, consult a qualified accountant or use CRA-approved software.\n\n## Features\n\n**Income Tax Estimation:**\n- Federal and provincial/territorial income tax\n- CPP/QPP contributions (province-specific)\n- Employment Insurance (EI) premiums\n- Quebec Parental Insurance Plan (QPIP) for Quebec residents\n- Basic Personal Amount (BPA) calculations with high-income phase-outs\n- Uses **2025 tax rates and brackets**\n\n**Sales Tax Calculation:**\n- GST, PST, HST, and QST calculations\n- Automatic tax selection based on province/territory\n- Structured breakdown of all applicable taxes\n\n**Zero Dependencies:** Pure Python with no external requirements.\n\n## Installation\n\n```bash\npip install canatax\n```\n\n## Quick Start\n\n### Income Tax Estimation\n\n```python\nfrom canatax import IncomeTaxCalculator\n\n# Calculate tax estimate for $80,000 income in British Columbia\nestimate = IncomeTaxCalculator.calculate(income=80000, province=\"BC\")\n\nprint(f\"Province: {estimate.province}\")\nprint(f\"Federal Tax: ${estimate.federal_tax:,.2f}\")\nprint(f\"Provincial Tax: ${estimate.provincial_tax:,.2f}\")\nprint(f\"CPP: ${estimate.cpp:,.2f}\")\nprint(f\"EI: ${estimate.ei:,.2f}\")\nprint(f\"Total Tax: ${estimate.total_tax:,.2f}\")\nprint(f\"Net Income: ${estimate.net_income:,.2f}\")\n```\n\n### Sales Tax Calculation\n\n```python\nfrom canatax import SalesTaxCalculator\n\n# Calculate sales tax for $100 purchase in Quebec\nestimate = SalesTaxCalculator.calculate(amount=100.00, province=\"QC\")\n\nprint(f\"Province: {estimate.province}\")\nprint(f\"GST: ${estimate.gst:,.2f}\")\nprint(f\"QST: ${estimate.qst:,.2f}\")\nprint(f\"Total Tax: ${estimate.tax_total:,.2f}\")\nprint(f\"After Tax: ${estimate.after_tax:,.2f}\")\n```\n\n## API Reference\n\n### IncomeTaxCalculator\n\n**`IncomeTaxCalculator.calculate(income: float, province: str) -> IncomeTaxEstimate`**\n\nCalculates income tax estimate for the given income and province.\n\n**Parameters:**\n- `income`: Annual gross income (float)\n- `province`: Two-letter province code (e.g., \"ON\", \"BC\", \"QC\")\n\n**Returns:** `IncomeTaxEstimate` object with calculated taxes and deductions.\n\n### SalesTaxCalculator\n\n**`SalesTaxCalculator.calculate(amount: float, province: str) -> SalesTaxEstimate`**\n\nCalculates applicable sales taxes for a purchase amount.\n\n**Parameters:**\n- `amount`: Purchase amount before tax (float)\n- `province`: Two-letter province code\n\n**Returns:** `SalesTaxEstimate` object with tax breakdown.\n\n### Supported Provinces and Territories\n\nAll Canadian provinces and territories are supported:\n- **AB, BC, MB, NB, NL, NT, NS, NU, ON, PE, QC, SK, YT**\n\n## Use Cases\n\n- **E-commerce applications:** Calculate tax estimates for shopping carts\n- **Payroll prototyping:** Rough estimation of payroll deductions\n- **Financial planning tools:** Provide ballpark tax calculations\n- **Educational purposes:** Demonstrate Canadian tax system mechanics\n- **Budget calculators:** Help users estimate take-home pay\n\n## Accuracy Notes\n\nTax calculations are based on:\n- Current CRA federal tax brackets and rates\n- Provincial/territorial tax rates and basic personal amounts (BPAs)\n- 2025 CPP, EI, and other contribution limits\n- Published GST/PST/HST rates by province\n\n**Limitations:**\n- Does not account for tax credits beyond basic personal amounts\n- Does not include deductions for RRSP, childcare, etc.\n- Simplified calculation model suitable for estimation purposes\n- May not reflect mid-year rate changes or special circumstances\n\n\n## Contributing\n\nBug reports, feature requests, and contributions are welcome! This project helps developers build better financial tools for Canadians.\n\n\n## License\n\nMIT License \u2013 Free for personal and commercial use.\n\n\n## Support\n\nIf this tool has been helpful for your projects, consider [buying me a coffee](https://www.buymeacoffee.com/FirstFlush). No promises that I'll spend the money responsibly.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "An easy-to-use, dependency-free Canadian sales and income tax calculator.",
    "version": "2.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/firstflush/canatax/issues",
        "Buy Me a Coffee": "https://www.buymeacoffee.com/FirstFlush",
        "Homepage": "https://github.com/firstflush/canatax"
    },
    "split_keywords": [
        "canada",
        "tax",
        "cpp",
        "ei",
        "qpp",
        "gst",
        "hst",
        "pst",
        "qst",
        "income",
        "sales",
        "payroll"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4b37b7da9faaad9f611f8e39f5392c58fde2fec7e768d76229b06ec5b55242d2",
                "md5": "0b64a1f87c260b82cccf3cd055b58b68",
                "sha256": "27ffd706cb47fd5b8950864cb77dc204d74e21edb861413b12bcc59ed33e9ba9"
            },
            "downloads": -1,
            "filename": "canatax-2.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0b64a1f87c260b82cccf3cd055b58b68",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 19874,
            "upload_time": "2025-09-03T22:26:11",
            "upload_time_iso_8601": "2025-09-03T22:26:11.064118Z",
            "url": "https://files.pythonhosted.org/packages/4b/37/b7da9faaad9f611f8e39f5392c58fde2fec7e768d76229b06ec5b55242d2/canatax-2.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "393a2eac47a5976f81946feac9f15ca43110f9bc24b7013a2e063ac28dfacfe3",
                "md5": "9cfe740698a4b9d76baa6053de4fcbc7",
                "sha256": "e350541b963030247ccbe879454446d0fe63a2a0bc7308ae1860ef0902c085bc"
            },
            "downloads": -1,
            "filename": "canatax-2.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "9cfe740698a4b9d76baa6053de4fcbc7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 17180,
            "upload_time": "2025-09-03T22:26:12",
            "upload_time_iso_8601": "2025-09-03T22:26:12.658164Z",
            "url": "https://files.pythonhosted.org/packages/39/3a/2eac47a5976f81946feac9f15ca43110f9bc24b7013a2e063ac28dfacfe3/canatax-2.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-03 22:26:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "firstflush",
    "github_project": "canatax",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "canatax"
}
        
Elapsed time: 0.68442s