Git Product home page Git Product logo

casparser-isin's Introduction

CASParser-ISIN

code style: black GitHub GitHub Workflow Status codecov PyPI - Python Version

ISIN Database for casparser.

Installation

pip install -U casparser-isin

Usage

from casparser_isin import MFISINDb
with MFISINDb() as db:
    scheme_data = db.isin_lookup("Axis Long Term Equity Fund - Growth",  # scheme name
                                 "KFINTECH", # RTA
                                 "128TSDGG", # Scheme RTA code
                                 )
print(scheme_data)
SchemeData(name="axis long term equity fund - direct growth",
           isin="INF846K01EW2",
           amfi_code="120503",
           score=100.0)

The database also contains NAV values on 31-Jan-2018 for all funds, which can be used for taxable LTCG computation for units purchased before the same date.

from casparser_isin import MFISINDb
with MFISINDb() as db:
    nav = db.nav_lookup("INF846K01EW2")
print(nav)
Decimal('44.8938')

Notes

  • casparser-isin is shipped with a local database which may get obsolete over time. The local database can be updated via the cli tool
casparser-isin --update
  • casparser-isin will try to use the file provided by CASPARSER_ISIN_DB environment variable; if present, and the file exists

casparser-isin's People

Contributors

codereverser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

casparser-isin's Issues

Error while updating db

Platform: Mac OS Monterey V12.6

Command: casparser-isin --update

Error:
`Traceback (most recent call last):
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1346, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1257, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1303, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1252, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1012, in _send_output
self.send(msg)
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 952, in send
self.connect()
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1426, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1040, in _create
self.do_handshake()
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/casparser-isin", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.9/site-packages/casparser_isin/cli.py", line 123, in main
update_isin_db()
File "/usr/local/lib/python3.9/site-packages/casparser_isin/cli.py", line 92, in update_isin_db
remote_meta, local_meta = get_isin_db_details()
File "/usr/local/lib/python3.9/site-packages/casparser_isin/cli.py", line 54, in get_isin_db_details
with request.urlopen(build_request(META_URL)) as response:
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 517, in open
response = self._open(req, data)
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 534, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1389, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/usr/local/Cellar/[email protected]/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1349, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)>`

Issue when there is space character inside RTA code

Screenshot 2023-04-03 at 8 32 14 AM

The SUMMARY_ROW_RE regex fails when there are RTA codes like the second and third row. It ends up reading folio number along with the first three characters of RTA code resulting in a null repsonse when ISIN check is done.

No matching distribution found for casparser-isin

=> ERROR [stage-0 7/13] RUN pip3 install -U casparser-isin 1.8s

  • Facing this issue while trying to install it in docker container

[stage-0 7/13] RUN pip3 install -U casparser-isin:
#10 1.432 Collecting casparser-isin
#10 1.658 Could not find a version that satisfies the requirement casparser-isin (from versions: )
#10 1.660 No matching distribution found for casparser-isin

Missing funds in the database

The below funds seem to be missing or has wrong ids:

Missing:
FTI915-XXXXXX Franklin India Ultra Short Bond Fund- Super Inst. Plan-Segregated Portfolio 1 (erstwhile 8.25% Vodafone Idea Ltd-10jul20-Daily Dividend Option) - Daily - IDCW# Payout

Wrong amc_code: expected "036" vs actual "36"
FTI036-XXXXX Franklin India Prima Fund - GROWTH

Couldn't figure out what's wrong here but the ISIN is not showing up in the parsed output
H60-HDFC Low Duration Fund - Regular Plan - Monthly IDCW# (formerly HDFC Cash Management Fund - Treasury Advantage Plan) - Reinvest

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.