22
33[ ![ code style: black] ( https://img.shields.io/badge/code%20style-black-000000.svg )] ( https://github.com/psf/black )
44[ ![ GitHub] ( https://img.shields.io/github/license/codereverser/casparser )] ( https://github.com/codereverser/casparser/blob/main/LICENSE )
5- ![ GitHub Workflow Status] ( https://img.shields.io/github/workflow/status/codereverser/casparser/run-tests )
5+ ![ 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 )
77![ PyPI - Python Version] ( https://img.shields.io/pypi/pyversions/casparser )
88
@@ -17,16 +17,16 @@ Parse Consolidated Account Statement (CAS) PDF files generated from CAMS/KFINTEC
1717## Installation
1818``` bash
1919pip install -U casparser
20- ```
20+ ```
2121
2222### with faster PyMuPDF parser
2323``` bash
2424pip install -U ' casparser[mupdf]'
2525```
2626
27- ** Note:** Enabling this dependency could result in licensing changes. Check the
28- [ License] ( #license ) section for more details
29-
27+ ** Note:** Enabling this dependency could result in licensing changes. Check the
28+ [ License] ( #license ) section for more details
29+
3030
3131## Usage
3232
@@ -99,7 +99,7 @@ csv_str = casparser.read_cas_pdf("/path/to/cas/file.pdf", "password", output="cs
9999 ]
100100}
101101```
102- Notes:
102+ Notes:
103103- Transaction ` type ` can be any value from the following
104104 - ` PURCHASE `
105105 - ` PURCHASE_SIP `
@@ -115,13 +115,13 @@ Notes:
115115 - ` TDS_TAX `
116116 - ` STT_TAX `
117117 - ` MISC `
118- - ` dividend_rate ` is applicable only for ` DIVIDEND_PAYOUT ` and
118+ - ` dividend_rate ` is applicable only for ` DIVIDEND_PAYOUT ` and
119119 ` DIVIDEND_REINVESTMENT ` transactions.
120-
120+
121121### CLI
122122
123- casparser also comes with a command-line interface that prints summary of parsed
124- portfolio in a wide variety of formats.
123+ casparser also comes with a command-line interface that prints summary of parsed
124+ portfolio in a wide variety of formats.
125125
126126```
127127Usage: casparser [-o output_file.json|output_file.csv] [-p password] [-s] [-a] CAS_PDF_FILE
@@ -136,19 +136,19 @@ Usage: casparser [-o output_file.json|output_file.csv] [-p password] [-s] [-a] C
136136 summary output
137137 -g, --gains Generate Capital Gains Report (BETA)
138138 --gains-112a ask|FY2020-21 Generate Capital Gains Report - 112A format for
139- a given financial year - Use 'ask' for a prompt
139+ a given financial year - Use 'ask' for a prompt
140140 from available options (BETA)
141141 --force-pdfminer Force PDFMiner parser even if MuPDF is
142142 detected
143143
144144 --version Show the version and exit.
145145 -h, --help Show this message and exit.
146- ```
146+ ```
147147
148148#### CLI examples
149149```
150150# Print portfolio summary
151- casparser /path/to/cas.pdf -p password
151+ casparser /path/to/cas.pdf -p password
152152
153153# Print portfolio and capital gains summary
154154casparser /path/to/cas.pdf -p password -g
@@ -159,20 +159,20 @@ casparser /path/to/cas.pdf -p password -o pdf_parsed.json
159159# Save parsed data as a csv file
160160casparser /path/to/cas.pdf -p password -o pdf_parsed.csv
161161
162- # Save capital gains transactions in csv files (pdf_parsed-gains-summary.csv and
162+ # Save capital gains transactions in csv files (pdf_parsed-gains-summary.csv and
163163# pdf_parsed-gains-detailed.csv)
164164casparser /path/to/cas.pdf -p password -g -o pdf_parsed.csv
165165
166166```
167167
168168** Note:** ` casparser cli ` supports two special output file formats [ -o _ file.json_ / _ file.csv_ ]
1691691 . ` json ` - complete parsed data is exported in json format (including investor info)
170- 2 . ` csv ` - Summary info is exported in csv format if the input file is a summary statement or if
171- a summary flag (` -s/--summary ` ) is passed as argument to the CLI. Otherwise, full
172- transaction history is included in the export.
173- If ` -g ` flag is present, two additional files '{basename}-gains-summary.csv',
170+ 2 . ` csv ` - Summary info is exported in csv format if the input file is a summary statement or if
171+ a summary flag (` -s/--summary ` ) is passed as argument to the CLI. Otherwise, full
172+ transaction history is included in the export.
173+ If ` -g ` flag is present, two additional files '{basename}-gains-summary.csv',
174174 '{basename}-gains-detailed.csv' are created with the capital-gains data.
175- 3 . any other extension - The summary table is saved in the file.
175+ 3 . any other extension - The summary table is saved in the file.
176176
177177
178178#### Demo
@@ -183,23 +183,22 @@ casparser /path/to/cas.pdf -p password -g -o pdf_parsed.csv
183183
184184Since v0.4.3, ` casparser ` includes support for identifying ISIN and AMFI code for the parsed schemes
185185via the helper module [ casparser-isin] ( https://github.com/codereverser/casparser-isin/ ) . If the parser
186- fails to assign ISIN or AMFI codes to a scheme, try updating the local ISIN database by
186+ fails to assign ISIN or AMFI codes to a scheme, try updating the local ISIN database by
187187
188188``` shell
189189casparser-isin --update
190190```
191191
192- If it still fails, please raise an issue at [ casparser-isin] ( https://github.com/codereverser/casparser-isin/issues/new ) with the
193- failing scheme name(s).
192+ If it still fails, please raise an issue at [ casparser-isin] ( https://github.com/codereverser/casparser-isin/issues/new ) with the
193+ failing scheme name(s).
194194
195195## License
196196
197197CASParser is distributed under MIT license by default. However enabling the optional dependency
198198` mupdf ` would imply the use of [ PyMuPDF] ( https://github.com/pymupdf/PyMuPDF ) /
199- [ MuPDF] ( https://mupdf.com/license.html ) and hence the licenses GNU GPL v3 and GNU Affero GPL v3
199+ [ MuPDF] ( https://mupdf.com/license.html ) and hence the licenses GNU GPL v3 and GNU Affero GPL v3
200200would apply. Copies of all licenses have been included in this repository. - _ IANAL_
201-
201+
202202## Resources
2032031 . [ CAS from CAMS] ( https://www.camsonline.com/Investors/Statements/Consolidated-Account-Statement )
2042042 . [ CAS from Karvy/Kfintech] ( https://mfs.kfintech.com/investor/General/ConsolidatedAccountStatement )
205-
0 commit comments