Can now retrieve total case number by date and country

This commit is contained in:
Patrick Müller 2020-03-28 20:17:51 +01:00
parent 2fb7fd3244
commit 44c61830df
3 changed files with 15 additions and 14 deletions

View File

@ -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()

View File

@ -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'))

View File

@ -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