Skip to main content

CLI to consolidate and analyze your portfolio of investments

Project description

pyportfolio

PyPI Version GitHub Actions code style: black

Python package with a CLI to consolidate and analyze your investments (currently only supports mutual funds).

Uses casparser to parse the Consolidated Account Statement (CAS) from CAMS/KARVY to provide portfolio insights.

Installation

$ pip install pyportfolio

To install from source:

$ 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:

$ 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.

$ pip install -e . # Installs development version of the package

Usage

$ pyportfolio -f path/to/cas-pdf

The following features are currently supported

  • LTCG Tax Harvesting
  • Portfolio Summary and Break Up

You can also export the portfolio into a dict for your usage.

from pyportfolio import Portfolio

p = Portfolio("<cas-pdf>", "<cas-password>")
p_dict = p.to_dict()

To access schemes, you can use the schemes member of Portfolio or use "schemes" key in the exported dict.

schemes = p.schemes # this is of type List[Scheme]
schemes_list = p_dict["schemes"]

The schemes are instances of the Scheme model.

Resources

  1. CAS from CAMS
  2. CAS from Karvy/Kfintech

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyportfolio-1.0.1.tar.gz (10.1 kB view hashes)

Uploaded Source

Built Distribution

pyportfolio-1.0.1-py3-none-any.whl (12.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page