Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev 381 bulk download python add start d #18

Merged
merged 4 commits into from
Apr 13, 2023

Conversation

Shivam-Nirhali
Copy link
Contributor

Pull Requests

If you want to make contributions to this project, then please open an
issue on GitHub and discuss them prior to opening a pull request. It is
possible that the work is already in progress, or that there are certain
problems you need to take into account.

Before opening a pull request, please post a link to a GitHub gist with a
Python Notebook that includes your proposed code along with a working
example, and an explanation why that feature is useful.

Please ensure that your code is of very high quality, well-documented,
well-tested, and in the same polished style as the rest of this project.
Otherwise we may reject the pull request.

simfin/utils.py Outdated
datareader = csv.reader(csvfile, delimiter=';', quotechar='"')
for k, row in enumerate(datareader):
if k > 0:
date = datetime.strptime(str(row[5]), '%Y-%m-%d')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its not always the 5th index, for share prices its not. So you have to look at the columns (in the first row), search for column name (only once at the beginning) either: "Report Date" or "Date" and take that index

simfin/utils.py Outdated
##########################################################################

def into_date(date):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add underscore: _into_date

simfin/utils.py Outdated
raise Exception("filters date not in format")


def condition_function(start_date=None, end_date=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

simfin/utils.py Outdated
return None


def filtered_file(dataset_path, start_date=None, end_date=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

with open(dataset_path) as csvfile:
datareader = csv.reader(csvfile, delimiter=';', quotechar='"')
for k, row in enumerate(datareader):
if k > 0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have to write the first row also (without filtering) otherwise the rest doesnt work anymore

simfin/utils.py Outdated
if rd_col in row:
index = row.index(rd_col)
elif d_col in row:
index = row.index(rd_col)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wrong, should be d_col

@thf24 thf24 merged commit 347be28 into master Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants