Skip to main content

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

Metadata

Release files for pyportfolio 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyportfolio 1.0.1
File Size Uploaded Provenance Actions
pyportfolio-1.0.1.tar.gz 10.1 kB Without provenance Details for pyportfolio-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyportfolio 1.0.1
File Interpreter ABI Platform Actions
pyportfolio-1.0.1-py3-none-any.whl Python 3 none any Details for pyportfolio-1.0.1-py3-none-any.whl

Total release size: 22.6 kB

Release files / pyportfolio-1.0.1.tar.gz

Download URL pyportfolio-1.0.1.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3b9908fb2012484e3cd81d9f0bd4b8e2a3a366b2f8c9c65f9dd5b88a1b18fced
BLAKE2b-256 checksum
How to use checksums
03f674da51e8bef4f119db342ef9aad2bf13cb64bee3bdca4da48e62d021f026
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

Release files / pyportfolio-1.0.1-py3-none-any.whl

Download URL pyportfolio-1.0.1-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b40c3725fb6eaab4ac24595e5fd095d311faca4de2ee8de75676d052f3bb2695
BLAKE2b-256 checksum
How to use checksums
78c347a83221c945760e37e1774116c16b6c7a598455713331c6d683216652eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

Security for pyportfolio 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page