File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 11# CASParser
22
3- [ ![ code style: black ] ( https://img.shields.io/badge/code%20style-black-000000.svg )] ( https://github.com/psf/black )
3+ [ ![ code style: ruff ] ( https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json )] ( https://github.com/astral-sh/ruff )
44[ ![ GitHub] ( https://img.shields.io/github/license/codereverser/casparser )] ( https://github.com/codereverser/casparser/blob/main/LICENSE )
55![ GitHub Workflow Status] ( https://img.shields.io/github/actions/workflow/status/codereverser/casparser/run-pytest.yml?branch=main )
66[ ![ codecov] ( https://codecov.io/gh/codereverser/casparser/branch/main/graph/badge.svg?token=DYZ7TXWRGI )] ( https://codecov.io/gh/codereverser/casparser )
@@ -10,7 +10,7 @@ Parse Consolidated Account Statement (CAS) PDF files generated from CAMS/KFINTEC
1010
1111` casparser ` also includes a command line tool with the following analysis tools
1212- ` summary ` - print portfolio summary
13- - ` gains ` - Print capital gains report (summary and detailed)
13+ - ( ** BETA ** ) ` gains ` - Print capital gains report (summary and detailed)
1414 - with option to generate csv files for ITR in schedule 112A format
1515
1616
Original file line number Diff line number Diff line change 3939
4040# Normal Transaction entries
4141TRANSACTION_RE1 = rf"{ date_re } \t\t([^0-9].*)\t\t{ amt_re } \t\t{ amt_re } \t\t{ amt_re } \t\t{ amt_re } "
42- # Zero unit transactions
42+ # Zero unit transactions (ref: #88)
4343TRANSACTION_RE2 = rf"{ date_re } \t\t([^0-9].*)\t\t{ amt_re } \t\t(?:{ amt_re } )*\t\t{ amt_re } \t\t{ amt_re } "
4444# Segregated portfolio entries
4545TRANSACTION_RE3 = rf"{ date_re } \t\t([^0-9].*)\t\t{ amt_re } \t\t{ amt_re } (?:\t\t{ amt_re } \t\t{ amt_re } )*"
Original file line number Diff line number Diff line change @@ -77,6 +77,17 @@ def test_transaction_type(self):
7777 amount = None ,
7878 )
7979
80+ assert parse_transaction (
81+ "01-Jan-2021\t \t IDCW Reinvestment @ Rs.0.003 per unit\t \t 0.32\t \t \t \t 1001.40\t \t 12.34"
82+ ) == ParsedTransaction (
83+ date = "01-Jan-2021" ,
84+ description = "IDCW Reinvestment @ Rs.0.003 per unit" ,
85+ units = "0.000" ,
86+ balance = "12.34" ,
87+ nav = "1001.40" ,
88+ amount = "0.32" ,
89+ )
90+
8091 def test_dividend_transactions (self ):
8192 assert get_transaction_type ("IDCW Reinvestment @ Rs.2.00 per unit" , Decimal (1.0 )) == (
8293 TransactionType .DIVIDEND_REINVEST ,
You can’t perform that action at this time.
0 commit comments