Skip to content

Commit

Permalink
fixed updating db bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopm33 committed May 1, 2021
1 parent 8772f9b commit 037df39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions fundspy/fundspy.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@

#packages used to download data
import requests
from requests import HTTPError
from urllib.request import HTTPError
from yahoofinancials import YahooFinancials

#packages used to manipulate data
import pandas as pd
from pandas.io.sql import DatabaseError
import numpy as np

#other packages
Expand Down Expand Up @@ -266,7 +267,7 @@ def update_db(db_dir: str = r'investments_database.db'):

try:#tries to read targets funds if they were specified when starting the database
target_funds = pd.read_sql('select targets from target_funds', con).targets.to_list()
except AttributeError:
except DatabaseError:
target_funds = []

print('downloading new daily reports from the CVM website...\n')
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
setup(
name = 'fundspy', # How you named your package folder (MyLib)
packages = ['fundspy'], # Chose the same as "name"
version = '1.0', # Start with a small number and increase it with every change you make
version = '1.1', # Start with a small number and increase it with every change you make
license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository
description = 'Download brazillian investment funds and their benchmarks data from CVM and analyze their performance with pre-built functions.', # Give a short description about your library
long_description=long_description,
long_description_content_type='text/markdown',
author = 'Joao Penido Monteiro', # Type in your name
author_email = 'joaopm33@gmail.com', # Type in your E-Mail
url = 'https://github.com/joaopm33/fundspy', # Provide either the link to your github or to your website
download_url = 'https://github.com/joaopm33/fundspy/archive/refs/tags/v1.0.tar.gz', # I explain this later on
download_url = 'https://github.com/joaopm33/fundspy/archive/refs/tags/v1.1.tar.gz', # I explain this later on
keywords = ['INVESTMENTS', 'FUNDS', 'FINANCE', 'INVESTMENT FUNDS', 'BRAZILIAN ASSETS', 'HEDGE FUNDS', 'MUTUAL FUNDS'], # Keywords that define your package best
install_requires=[
'requests==2.22.0',
'yahoofinancials==1.6',
'python-dateutil==2.8.1',
'pandas==1.0.5',
'numpy==1.19.3',
'tqdm==4.11.2',
'tqdm==4.60.0',
'workalendar==10.3.0'
],
classifiers=[
Expand Down

0 comments on commit 037df39

Please sign in to comment.