✨ Can now retrieve total case number by date and country
This commit is contained in:
parent
2fb7fd3244
commit
44c61830df
11
Analyser.py
11
Analyser.py
|
@ -54,12 +54,11 @@ class Analyser:
|
||||||
def getTotalCases(self, country, date=datetime.now().strftime('%Y-%m-%d')) -> int:
|
def getTotalCases(self, country, date=datetime.now().strftime('%Y-%m-%d')) -> int:
|
||||||
"""
|
"""
|
||||||
Get the current total cases for the entered country
|
Get the current total cases for the entered country
|
||||||
:param country: The country you want the case number for
|
:param country: The country you want the case number for. Access available countries via getAvailableCountries()
|
||||||
:param date: The date for which the case number is returned. Standard is the current date.
|
:param date: The date for which the case number is returned. Standard is the current date. Format YYYY-MM-DD
|
||||||
:return: The case number
|
:return: The case number
|
||||||
"""
|
"""
|
||||||
countryData = self.df[self.df['countriesAndTerritories'].isin([country])]
|
countryData = self.df[self.df['countriesAndTerritories'].isin([country])]
|
||||||
finalData = pd.DataFrame
|
mask = (countryData['dateRep'] <= date)
|
||||||
countryData.filter(datetime.strptime(country))
|
countryTimeData = countryData.loc[mask]
|
||||||
print(finalData)
|
return countryTimeData['cases'].sum()
|
||||||
return countryData['cases'].sum()
|
|
||||||
|
|
2
Main.py
2
Main.py
|
@ -10,4 +10,4 @@ import Analyser as ana
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
analyser = ana.Analyser()
|
analyser = ana.Analyser()
|
||||||
country = input('What country do you want the graph for: ')
|
country = input('What country do you want the graph for: ')
|
||||||
analyser.getTotalCases(country, '2020-03-27')
|
print(analyser.getTotalCases(country, '2020-03-28'))
|
||||||
|
|
|
@ -11,13 +11,15 @@ pipelines:
|
||||||
- step:
|
- step:
|
||||||
deployment: production
|
deployment: production
|
||||||
script:
|
script:
|
||||||
- echo "Running deployment to production"
|
- echo "Skipping Deployment as the website implementation is currently to complex"
|
||||||
- pipe: atlassian/sftp-deploy:0.5.2
|
# - echo "Running deployment to production"
|
||||||
variables:
|
# - pipe: atlassian/sftp-deploy:0.5.2
|
||||||
USER: $SFTP_Username
|
# variables:
|
||||||
SERVER: $SFTP_Host_Path
|
# USER: $SFTP_Username
|
||||||
REMOTE_PATH: $SFTP_Production_Path
|
# SERVER: $SFTP_Host_Path
|
||||||
PASSWORD: $SFTP_Password
|
# REMOTE_PATH: $SFTP_Production_Path
|
||||||
|
# PASSWORD: $SFTP_Password
|
||||||
|
|
||||||
# feature:
|
# feature:
|
||||||
# - step:
|
# - step:
|
||||||
# deployment: test
|
# deployment: test
|
||||||
|
|
Loading…
Reference in New Issue
Block a user