🚀 Added Pipeline File
This commit is contained in:
parent
76f9ef7ccd
commit
a6a6febe5f
30
Analyser.py
30
Analyser.py
|
@ -22,22 +22,44 @@ geoId
|
||||||
countryterritoryCode
|
countryterritoryCode
|
||||||
popData2018
|
popData2018
|
||||||
"""
|
"""
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
|
|
||||||
class Analyser:
|
class Analyser:
|
||||||
# Pandas Settings
|
# Pandas Settings
|
||||||
pd.set_option('display.max_row', 1000)
|
pd.set_option('display.max_row', 50)
|
||||||
pd.set_option('display.max_column', 10)
|
pd.set_option('display.max_column', 10)
|
||||||
|
|
||||||
df = pd.read_csv('2020-03-28_11-00.csv', encoding='windows-1252')
|
df = pd.read_csv('2020-03-28_11-00.csv', encoding='windows-1252')
|
||||||
df['dateRep'] = pd.to_datetime(df['dateRep'])
|
df['dateRep'] = pd.to_datetime(df['dateRep'])
|
||||||
|
print(df['dateRep'].head())
|
||||||
|
|
||||||
def getAvailableCountries(self):
|
def getAvailableCountries(self):
|
||||||
return self.df['countriesAndTerritories'].unique()
|
return self.df['countriesAndTerritories'].unique()
|
||||||
|
|
||||||
def germany_cases_graph(self):
|
def getCasesGraph(self, country) -> str:
|
||||||
|
"""
|
||||||
|
Get a graph with the absolute number of cases by day for the entered country
|
||||||
|
:param country: The country you wish to get the graph for
|
||||||
|
:return: The path for the picture of the graph
|
||||||
|
"""
|
||||||
fig = plt.figure()
|
fig = plt.figure()
|
||||||
ax = fig.add_subplot(111)
|
ax = fig.add_subplot(111)
|
||||||
|
|
||||||
germanyData = self.df[self.df['countriesAndTerritories'].isin(['Germany'])]
|
countryData = self.df[self.df['countriesAndTerritories'].isin([country])]
|
||||||
print(germanyData)
|
print(countryData['cases'].sum())
|
||||||
|
|
||||||
|
return 'abc'
|
||||||
|
|
||||||
|
def getTotalCases(self, country, date=datetime.now().strftime('%Y-%m-%d')) -> int:
|
||||||
|
"""
|
||||||
|
Get the current total cases for the entered country
|
||||||
|
:param country: The country you want the case number for
|
||||||
|
:param date: The date for which the case number is returned. Standard is the current date.
|
||||||
|
:return: The case number
|
||||||
|
"""
|
||||||
|
countryData = self.df[self.df['countriesAndTerritories'].isin([country])]
|
||||||
|
finalData = pd.DataFrame
|
||||||
|
countryData.filter(datetime.strptime(country))
|
||||||
|
print(finalData)
|
||||||
|
return countryData['cases'].sum()
|
||||||
|
|
12
HttpRequestHandler.py
Normal file
12
HttpRequestHandler.py
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
Project: Analyse worldwide COVID-19 Data and provide graphs etc.
|
||||||
|
|
||||||
|
@author Patrick Müller
|
||||||
|
"""
|
||||||
|
import socketserver
|
||||||
|
from http.server import BaseHTTPRequestHandler
|
||||||
|
|
||||||
|
class HttpRequestHandler(BaseHTTPRequestHandler):
|
||||||
|
def do_GET(self):
|
||||||
|
print('hello')
|
4
Main.py
4
Main.py
|
@ -9,5 +9,5 @@ import Analyser as ana
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
analyser = ana.Analyser()
|
analyser = ana.Analyser()
|
||||||
analyser.germany_cases_graph()
|
country = input('What country do you want the graph for: ')
|
||||||
print(analyser.getAvailableCountries())
|
analyser.getTotalCases(country, '2020-03-27')
|
||||||
|
|
31
bitbucket-pipelines.yml
Normal file
31
bitbucket-pipelines.yml
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
# This is a sample build configuration for Other.
|
||||||
|
# Check our guides at https://confluence.atlassian.com/x/5Q4SMw for more examples.
|
||||||
|
# Only use spaces to indent your .yml configuration.
|
||||||
|
# -----asd
|
||||||
|
# You can specify a custom docker image from Docker Hub as your build environment.
|
||||||
|
image: atlassian/default-image:2
|
||||||
|
|
||||||
|
pipelines:
|
||||||
|
branches:
|
||||||
|
master:
|
||||||
|
- step:
|
||||||
|
deployment: production
|
||||||
|
script:
|
||||||
|
- echo "Running deployment to production"
|
||||||
|
- pipe: atlassian/sftp-deploy:0.5.2
|
||||||
|
variables:
|
||||||
|
USER: $SFTP_Username
|
||||||
|
SERVER: $SFTP_Host_Path
|
||||||
|
REMOTE_PATH: $SFTP_Production_Path
|
||||||
|
PASSWORD: $SFTP_Password
|
||||||
|
# feature:
|
||||||
|
# - step:
|
||||||
|
# deployment: test
|
||||||
|
# script:
|
||||||
|
# - echo "Running deployment to test"
|
||||||
|
# - pipe: atlassian/sftp-deploy:0.5.2
|
||||||
|
# variables:
|
||||||
|
# USER: $SFTP_Username
|
||||||
|
# SERVER: $SFTP_Host_Path
|
||||||
|
# REMOTE_PATH: $SFTP_TestPath
|
||||||
|
# PASSWORD: $SFTP_Password
|
Loading…
Reference in New Issue
Block a user