python-taxes 0.6.0a3__py3-none-any.whl → 0.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
python_taxes/__init__.py CHANGED
@@ -2,6 +2,6 @@ from decimal import Decimal
2
2
 
3
3
  from pydantic import Field
4
4
 
5
- CURRENT_TAX_YEAR = 2024
5
+ CURRENT_TAX_YEAR = 2025
6
6
 
7
7
  currency_field = Field(ge=Decimal("0.00"), decimal_places=2)
python_taxes/cli.py CHANGED
@@ -1,9 +1,9 @@
1
1
  import sys
2
- from decimal import Decimal
2
+ from decimal import Decimal, InvalidOperation
3
3
  from enum import Enum
4
4
  from typing import Annotated
5
5
 
6
- from pydantic import StrictBool, validate_call
6
+ from pydantic import StrictBool, ValidationError, validate_call
7
7
 
8
8
  from python_taxes import CURRENT_TAX_YEAR, currency_field
9
9
  from python_taxes.federal.income import employer_withholding as income_withholding
@@ -37,10 +37,21 @@ class FilingStatus(str, Enum):
37
37
 
38
38
 
39
39
  @validate_call
40
- def currency(value: Annotated[Decimal, currency_field]) -> Decimal:
40
+ def _currency(value: Annotated[Decimal, currency_field]) -> Decimal:
41
41
  return value
42
42
 
43
43
 
44
+ def currency(value) -> Decimal:
45
+ try:
46
+ ret_val = _currency(value)
47
+ return ret_val
48
+ except (InvalidOperation, ValidationError):
49
+ raise typer.BadParameter(
50
+ f"Invalid currency value: {value}. "
51
+ "Please enter a number with max 2 decimal places."
52
+ )
53
+
54
+
44
55
  @app.callback()
45
56
  def callback():
46
57
  """
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: python-taxes
3
- Version: 0.6.0a3
3
+ Version: 0.7.0
4
4
  Summary: A Python library for calculating US Social Security, Medicare, and Federal Income taxes.
5
5
  License: MIT License
6
6
 
@@ -23,8 +23,9 @@ License: MIT License
23
23
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
24
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
25
  SOFTWARE.
26
+ License-File: LICENSE
26
27
  Author: Stacy Noland
27
- Author-email: stacy.noland@outlook.com
28
+ Author-email: 46572585+stacynoland@users.noreply.github.com
28
29
  Requires-Python: >=3.10
29
30
  Classifier: Development Status :: 4 - Beta
30
31
  Classifier: Intended Audience :: Developers
@@ -1,6 +1,6 @@
1
- python_taxes/__init__.py,sha256=YEbYYcHvqUm1UPVeSGoqEL_DdZhGFNTRZ9q19Zmzfvk,143
1
+ python_taxes/__init__.py,sha256=QYPEOcYhR0xWsC4lyJQft88mKMmpt80jiT6QTEAxhpw,143
2
2
  python_taxes/__main__.py,sha256=NmlJYInBV15AiGDR-6Q4OFdhfBp83ucon3biPW18S9I,75
3
- python_taxes/cli.py,sha256=taRx5AsxQBU99Dp79-Pp_OIdSohiXUT95pfDZ6OPIiw,4080
3
+ python_taxes/cli.py,sha256=eWDK6EJmW3N-Ub5ykyiJy0Fa-q8HD0WZZyHXsY4n0Vs,4421
4
4
  python_taxes/federal/__init__.py,sha256=VB0kbb3pwt1g114XYsB0Zwba2yqXZu6j8ESqdRW8M-I,424
5
5
  python_taxes/federal/income/__init__.py,sha256=8qaQAiepigo7b2VUQ3qesOIo-q5korFebg_qMbv9EOk,96
6
6
  python_taxes/federal/income/payroll/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -12,8 +12,8 @@ python_taxes/federal/income/tables/percentage/automated/married.py,sha256=JL4FvH
12
12
  python_taxes/federal/income/tables/percentage/automated/single.py,sha256=s3G_O-TvK0EPYyOR27JtKdu4QPjO7SjU8chkd0TYH7w,8456
13
13
  python_taxes/federal/medicare.py,sha256=BD9qgMSMGsFh2npOb_dk6bsdJexpbPVBVul_cWxyJDg,2823
14
14
  python_taxes/federal/social_security.py,sha256=hAeoxbUWdBS4K9IscHuTymS2SpQXWy-kRyzOR04jFJg,1731
15
- python_taxes-0.6.0a3.dist-info/LICENSE,sha256=rnEHoV1_wsGI820IknmbflTydk9cRmdnFDW-fdahioc,1069
16
- python_taxes-0.6.0a3.dist-info/METADATA,sha256=BhbJDILgMlldzdQktoSpuXjk6iLJ2HyjJox7ArCOFWQ,6813
17
- python_taxes-0.6.0a3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
18
- python_taxes-0.6.0a3.dist-info/entry_points.txt,sha256=wJ2aRYcZ3MSygPF8ccumyZ6ClFmBTRJj9JTIEimAGhc,46
19
- python_taxes-0.6.0a3.dist-info/RECORD,,
15
+ python_taxes-0.7.0.dist-info/METADATA,sha256=SBT8sZVC9LScaqKHNMrFuz6r4nCNRBNm3asoTHW7KOg,6854
16
+ python_taxes-0.7.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
17
+ python_taxes-0.7.0.dist-info/entry_points.txt,sha256=wJ2aRYcZ3MSygPF8ccumyZ6ClFmBTRJj9JTIEimAGhc,46
18
+ python_taxes-0.7.0.dist-info/licenses/LICENSE,sha256=rdcuISRnexqWAEFKBjTXhsXNPnmFloxde3ZwgZTlf5I,1068
19
+ python_taxes-0.7.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.3
2
+ Generator: poetry-core 2.2.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.