https://github.com/kaushiksk/pyportfolio
CLI to consolidate and analyze your investments (currently only supports mutual funds)
https://github.com/kaushiksk/pyportfolio
cas mutual-funds portfolio
Last synced: 8 days ago
JSON representation
CLI to consolidate and analyze your investments (currently only supports mutual funds)
- Host: GitHub
- URL: https://github.com/kaushiksk/pyportfolio
- Owner: kaushiksk
- License: mit
- Created: 2021-03-24T12:39:17.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-31T17:58:09.000Z (22 days ago)
- Last Synced: 2025-03-31T18:44:31.182Z (22 days ago)
- Topics: cas, mutual-funds, portfolio
- Language: Python
- Homepage:
- Size: 46.9 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyportfolio
[](https://pypi.org/project/pyportfolio/)
[](https://github.com/kaushiksk/pyportfolio/blob/main/LICENSE)
[](https://github.com/kaushiksk/pyportfolio/)
[](https://github.com/psf/black)
Python package with a CLI to consolidate and analyze your investments (currently only supports mutual funds).
Uses [casparser](https://github.com/codereverser/casparser) to parse the Consolidated Account Statement (CAS) from CAMS/KARVY to provide portfolio insights.
## Installation
```bash
$ pip install pyportfolio
```To install from source:
```bash
$ git clone https://github.com/kaushiksk/pyportfolio.git && cd pyportfolio
$ pip install .
```## Contributing
PRs are welcome. Once you've cloned your forked repo, run the following from the root directory:
```bash
$ pip install -r requirements-dev.txt
$ pre-commit install
```
This will install all the pre-commit hooks that will ensure formatting and linting sanity before each commit.
```bash
$ pip install -e . # Installs development version of the package
```## Usage
```bash
$ pyportfolio -f path/to/cas-pdf
```
The following features are currently supported
- LTCG Tax Harvesting
- Portfolio Summary and Break UpYou can also export the portfolio into a dict for your usage.
```python
from pyportfolio import Portfoliop = Portfolio("", "")
p_dict = p.to_dict()
```
To access schemes, you can use the `schemes` member of `Portfolio` or use `"schemes"` key in the exported dict.
```python
schemes = p.schemes # this is of type List[Scheme]
schemes_list = p_dict["schemes"]
```
The schemes are instances of the [`Scheme`](/pyportfolio/models.py#L17) model.## Resources
1. [CAS from CAMS](https://new.camsonline.com/Investors/Statements/Consolidated-Account-Statement)
2. [CAS from Karvy/Kfintech](https://mfs.kfintech.com/investor/General/ConsolidatedAccountStatement)