Skip to main content

Serialize financial statements to python objects

Project description

Cas2JSON

code style: ruff

A library to parse CAS (Consolidated Account Statement) from providers like CAMS, KFINTECH, NSDL (BETA) and get related data in JSON format.

Installation

pip install -U cas2json

Usage

# For CAMS/KFINTECH
from cas2json import parse_cams_pdf
data = parse_cams_pdf("/path/to/cams/file.pdf", "password")

# For NSDL
from cas2json import parse_nsdl_pdf
data = parse_nsdl_pdf("/path/to/nsdl/file.pdf", "password")

# To get data in form of Python dict
from dataclasses import asdict
python_dict = asdict(data)

# To convert the data from python dict to JSON
from msgspec import json
json_data = json.encode(python_dict)

Notes:

  • All used types like transaction types can be found under cas2json/enums.py.
  • NSDL currently supports only parsing of holdings since the transactions history is not complete.

License

Cas2JSON is distributed under GNU GPL v3 license. - IANAL

Credits

This library is inspired by CASParser, but it is an independent reimplementation with significant changes in both design and processing logic. In particular, it introduces a revised method for parsing textual data and for accurately identifying transaction values, even in cases where one or more trailing values may be missing from the record.

This project is not affiliated with or endorsed by the original CASParser author

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

cas2json-1.1.0.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cas2json-1.1.0-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file cas2json-1.1.0.tar.gz.

File metadata

  • Download URL: cas2json-1.1.0.tar.gz
  • Upload date:
  • Size: 31.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cas2json-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1f02e58b7b868afd74baff77743f4ae468b9f78cd200b6a13db349e010e9f2e8
MD5 d6e93fbf23fbc236427a036b61c106ce
BLAKE2b-256 e01552f86343755e15270255872fef1e2631a286f5a8861d8afc0c0e6d0e1bbc

See more details on using hashes here.

File details

Details for the file cas2json-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: cas2json-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 44.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cas2json-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c9c4b1482a7d06ef90545a625d09e29f431e63b6cc0e072405b248acc68c97a9
MD5 cc5d4a7b522b14d7fd7cbfc77d1cc553
BLAKE2b-256 527781b0b4674da535fbbcba361f1b6f7db57cced42f08b9a807ec22cee60550

See more details on using hashes here.

Supported by

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