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
@@ -117,7 +121,7 @@ Notes:
117121casparser also comes with a command-line interface that prints summary of parsed
118122portfolio in a wide variety of formats.
119123
120- ``` bash
124+ ```
121125Usage: casparser [-o output_file.json|output_file.csv] [-p password] [-s] [-a] CAS_PDF_FILE
122126
123127 -o, --output FILE Output file path. Saves the parsed data as json or csv
@@ -128,21 +132,45 @@ Usage: casparser [-o output_file.json|output_file.csv] [-p password] [-s] [-a] C
128132 -p PASSWORD CAS password
129133 -a, --include-all Include schemes with zero valuation in the
130134 summary output
131- --sort Sort transactions by date
135+ -g, --gains Generate Capital Gains Report (BETA) [Debt fund indexation not
136+ considered]
132137 --force-pdfminer Force PDFMiner parser even if MuPDF is
133138 detected
134139
135140 --version Show the version and exit.
136141 -h, --help Show this message and exit.
137142```
138143
144+ #### CLI examples
145+ ```
146+ # Print portfolio summary
147+ casparser /path/to/cas.pdf -p password
148+
149+ # Print portfolio and capital gains summary
150+ casparser /path/to/cas.pdf -p password -g
151+
152+ # Save parsed data as a json file
153+ casparser /path/to/cas.pdf -p password -o pdf_parsed.json
154+
155+ # Save parsed data as a csv file
156+ casparser /path/to/cas.pdf -p password -o pdf_parsed.csv
157+
158+ # Save capital gains transactions in csv files (pdf_parsed-gains-summary.csv and
159+ # pdf_parsed-gains-detailed.csv)
160+ casparser /path/to/cas.pdf -p password -g -o pdf_parsed.csv
161+
162+ ```
163+
139164** Note:** ` casparser cli ` supports two special output file formats [ -o _ file.json_ / _ file.csv_ ]
1401651 . ` json ` - complete parsed data is exported in json format (including investor info)
1411662 . ` csv ` - Summary info is exported in csv format if the input file is a summary statement or if
142167 a summary flag (` -s/--summary ` ) is passed as argument to the CLI. Otherwise, full
143168 transaction history is included in the export.
169+ If ` -g ` flag is present, two additional files '{basename}-gains-summary.csv',
170+ '{basename}-gains-detailed.csv' are created with the capital-gains data.
1441713 . any other extension - The summary table is saved in the file.
145172
173+
146174#### Demo
147175
148176![ demo] ( https://raw.githubusercontent.com/codereverser/casparser/main/assets/demo.jpg )
0 commit comments