Borsdata-Sweden / API

Börsdata API documentation
58 stars 6 forks source link

Update API with maxcount and get_instrument_reports for all three reports #6

Open Blade2bn opened 4 years ago

Blade2bn commented 4 years ago

You have added support for 20 years of data as well as downloading all three types of reports. As I understand it, the Python API has not yet been updated. Any plans for updating it?

I made a quick fix by adjusting self._params:

    self._params = {'authKey': self.api_key, 'maxcount': '20', 'maxYearCount': '20', 'maxR12QCount': '40'}

And adding the following function:

def get_instrument_reports_all_types(self, insId) -> List[Report]:

    status, data = self._get(f'instruments/{insId}/reports')

    if status != HTTPStatus.OK:
        raise APIError

    return [Report(**report1) for report1 in data.get('reportsYear', [])], [Report(**report2) for report2 in data.get('reportsQuarter', [])], [Report(**report3) for report3 in data.get('reportsR12', [])]
henrikbergstrom commented 4 years ago

Thanks, Python is 3-party lib so we can't update. I ask Joel that wrote the lib, Great to have your code here for other to use.

Blade2bn commented 4 years ago

Hi Henrik

I had not understood that the Python library was third party code. So that was an important clarification😀

Br Fredrik

11 maj 2020 kl. 13:21 skrev Henrik notifications@github.com:



Thanks, Python is 3-party lib so we can't update. I ask Joel that wrote the lib, Great to have your code here for other to use.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Borsdata-Sweden/API/issues/6#issuecomment-626641609, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKZ3TBYGREKODDASMTD6WZDRQ7NSPANCNFSM4M4MACSQ.