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

Creational pattern #105

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/covidify/covidify_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from convidify.sources import github, wiki

"""
global values
"""
class DataStore():
def jhu_sources(self):
return github.get()

def wiki_sources(self):
return github.get()
230 changes: 0 additions & 230 deletions src/covidify/data_prep.py

This file was deleted.

12 changes: 12 additions & 0 deletions src/covidify/sources/Director.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class Director:
{
#fetches the builder
def __init__(self) -> None;
self._builder = None

def builder(self) -> githubSourceBuilder
return self._builder

def builder(self, builder:githubSourceBuilder) -> None:
self._builder = builder
}
1 change: 0 additions & 1 deletion src/covidify/sources/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ def get():
sys.exit(1)

sheets = os.listdir(DATA)

# Clean the result to the sheet tabs we want
print('Getting sheets...')
cleaned_sheets = clean_sheet_names(sheets)
Expand Down
24 changes: 24 additions & 0 deletions src/covidify/sources/githubSourceBuilder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
class dataSourceBuilder(metaclass = ABCMeta)
def clean_sheet_names(new_ranges):
# Remove all sheets that dont have a numeric header

def clone_repo(TMP_FOLDER, REPO):
#clone data repositary

def get_date(last_update):
#date of the last update

def get_csv_date(f):
#gets data of the csv file

def fix_country_names(tmp_df)
#country names in appropriate order to have function properly

def clean_data(df):
#have all the data we need to clean, clean the data

def get_data(cleaned_sheets)
#function get data from a clean sheet

def get():
# use this function to fetch the date
Loading