Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 1.2.6 instead.
Reason given by maintainers: Incomplete SchemeType Enum

Cas2JSON

code style: ruff

A library to parse CAS (Consolidated Account Statement) from providers like CAMS, KFINTECH, NSDL (BETA) , CDSL (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")

#For CDSL
from cas2json import parse_cdsl_pdf
data = parse_cdsl_pdf("/path/to/cdsl/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/CDSL currently supports only parsing of holdings since the transactions history is not complete.

License

Cas2JSON is distributed under GNU AGPL 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

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.2.4.tar.gz (33.6 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.2.4-py3-none-any.whl (51.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cas2json-1.2.4.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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.2.4.tar.gz
Algorithm Hash digest
SHA256 edc59dbdbcb72e9d528bbd00857d147a281d567c65579b080c3a6fc743d5922b
MD5 82b26f8e919051bd289a4db2047353a9
BLAKE2b-256 c87415215b97b2aa7822b2a559aced0de86cd9ffa362e161d9fc26943f019032

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cas2json-1.2.4-py3-none-any.whl
  • Upload date:
  • Size: 51.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1f20e2be12cdedc42ca46733e6636987e7801e8d2be4b4ca4197a98cba2b729e
MD5 bf47b5f6bb67ad1962c93aa201786a9a
BLAKE2b-256 101e7de1f04bafdb32c84d57580ca6badbd907da1db1d414929f8ec64af9095e

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