NayakwadiS / mftool

⚡ Python library for getting publically available Mutual Funds data in India
https://mftool.readthedocs.io
MIT License
172 stars 54 forks source link

Results not being populated for couple of MFs #37

Closed manigandandba closed 1 year ago

manigandandba commented 1 year ago

Hi, I have been using your API for the last few months and it is really fantastic as I have never got a single issue until yesterday. Appreciate your awesome work. I recently tried with couple of mutual funds but I am not getting results out of it and instead the result set is empty. Can you please check and resolve at the earliest ?

MF numbers - 119066 ('HDFC Childrens Gift Fund - Direct Plan') and 120724 ('UTI CCF Investment Plan - Direct Plan - Growth Option')

FYI : I'm using the latest version of the package.

manigandandba commented 1 year ago

Hi, I have gone through your code and proposing the below change in "mftool.py" to accommodate other schemes too. Please verify and release the version at the earliest.

def get_scheme_codes(self, as_json=False):
    """
    returns a dictionary with key as scheme code and value as scheme name.
    cache handled internally
    :return: dict / json
    """
    scheme_info = {}
    url = self._get_quote_url
    response = self._session.get(url)
    data = response.text.split("\n")
    **for scheme_data in data:
        scheme = scheme_data.split(";")
        if len(scheme) == 6:
            scheme_info[scheme[0]] = scheme[3]**
    return self.render_response(scheme_info, as_json)
manigandandba commented 1 year ago

@NayakwadiS : Not sure if you get a notification for the above. Hence, added.

NayakwadiS commented 1 year ago

If this solution is working for all mf schemes available then you can raise pull request with valid unit test

NayakwadiS commented 9 months ago

55