88
99Parse Consolidated Account Statement (CAS) PDF files generated from CAMS/KFINTECH
1010
11+ ` casparser ` also includes a command line tool with the following analysis tools
12+ - ` summary ` - print portfolio summary
13+ - ` gains ` - Print capital gains report (summary and detailed)
14+
1115
1216## Installation
1317``` bash
@@ -118,7 +122,7 @@ Notes:
118122casparser also comes with a command-line interface that prints summary of parsed
119123portfolio in a wide variety of formats.
120124
121- ``` bash
125+ ```
122126Usage: casparser [-o output_file.json|output_file.csv] [-p password] [-s] [-a] CAS_PDF_FILE
123127
124128 -o, --output FILE Output file path. Saves the parsed data as json or csv
@@ -129,21 +133,45 @@ Usage: casparser [-o output_file.json|output_file.csv] [-p password] [-s] [-a] C
129133 -p PASSWORD CAS password
130134 -a, --include-all Include schemes with zero valuation in the
131135 summary output
132- --sort Sort transactions by date
136+ -g, --gains Generate Capital Gains Report (BETA) [Debt fund indexation not
137+ considered]
133138 --force-pdfminer Force PDFMiner parser even if MuPDF is
134139 detected
135140
136141 --version Show the version and exit.
137142 -h, --help Show this message and exit.
138143```
139144
145+ #### CLI examples
146+ ```
147+ # Print portfolio summary
148+ casparser /path/to/cas.pdf -p password
149+
150+ # Print portfolio and capital gains summary
151+ casparser /path/to/cas.pdf -p password -g
152+
153+ # Save parsed data as a json file
154+ casparser /path/to/cas.pdf -p password -o pdf_parsed.json
155+
156+ # Save parsed data as a csv file
157+ casparser /path/to/cas.pdf -p password -o pdf_parsed.csv
158+
159+ # Save capital gains transactions in csv files (pdf_parsed-gains-summary.csv and
160+ # pdf_parsed-gains-detailed.csv)
161+ casparser /path/to/cas.pdf -p password -g -o pdf_parsed.csv
162+
163+ ```
164+
140165** Note:** ` casparser cli ` supports two special output file formats [ -o _ file.json_ / _ file.csv_ ]
1411661 . ` json ` - complete parsed data is exported in json format (including investor info)
1421672 . ` csv ` - Summary info is exported in csv format if the input file is a summary statement or if
143168 a summary flag (` -s/--summary ` ) is passed as argument to the CLI. Otherwise, full
144169 transaction history is included in the export.
170+ If ` -g ` flag is present, two additional files '{basename}-gains-summary.csv',
171+ '{basename}-gains-detailed.csv' are created with the capital-gains data.
1451723 . any other extension - The summary table is saved in the file.
146173
174+
147175#### Demo
148176
149177![ demo] ( https://raw.githubusercontent.com/codereverser/casparser/main/assets/demo.jpg )
0 commit comments