-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathauto_commit.py
More file actions
29 lines (24 loc) · 752 Bytes
/
auto_commit.py
File metadata and controls
29 lines (24 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""
automatic commit of corona .csv file
"""
import os
import datetime
import config as cfg
def main():
"""
automatic commit of daily parkleitsystem data
and of daily waiting time data in the citizen center of Muenster
to github
"""
# get current date and time
now = datetime.datetime.today()
date = now.strftime('%Y-%m-%d')
add_command = 'git add coronavirus-fallzahlen-regierungsbezirk-muenster.csv'
commit_command = 'git commit -m "Update ' + date + '"'
push_command = 'git push https://' + cfg.github_token + '@github.com/od-ms/resources.git'
od.system("cd ../resources")
os.system(add_command)
os.system(commit_command)
os.system(push_command)
if __name__ == "__main__":
main()