-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Boljše preverjanje datumov pri uvozu MIZŠ podatkov #103
Open
ikolar
wants to merge
539
commits into
sledilnik:master
Choose a base branch
from
ikolar:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 40 commits
Commits
Show all changes
539 commits
Select commit
Hold shift + click to select a range
40c26a0
OstaniZdrav Data update 🤖
7c372ac
MIZŠ Data update 🤖
23410cb
OstaniZdrav Data update 🤖
6b608ad
OstaniZdrav Data update 🤖
f81225d
OstaniZdrav Data update 🤖
65e89d9
OstaniZdrav Data update 🤖
8a31ff3
MIZŠ Data update 🤖
e9412ce
MIZŠ Data update 🤖
28edf4b
OstaniZdrav Data update 🤖
60e92f8
OstaniZdrav Data update 🤖
7715c97
OstaniZdrav Data update 🤖
deb723e
OstaniZdrav Data update 🤖
e937fc9
OstaniZdrav Data update 🤖
578c9db
OstaniZdrav Data update 🤖
e62addf
OstaniZdrav Data update 🤖
a03df1c
OstaniZdrav Data update 🤖
c3de2b3
OstaniZdrav Data update 🤖
68b62e2
OstaniZdrav Data update 🤖
3390199
MIZŠ Data update 🤖
2ba3c14
OstaniZdrav Data update 🤖
1cddaf9
OstaniZdrav Data update 🤖
945f10b
MIZŠ Data update 🤖
ce2d4c3
OstaniZdrav Data update 🤖
d14706f
MIZŠ Data update 🤖
89cd27b
OstaniZdrav Data update 🤖
311c174
OstaniZdrav Data update 🤖
101671b
OstaniZdrav Data update 🤖
88770b6
OstaniZdrav Data update 🤖
e9f9781
OstaniZdrav Data update 🤖
1641670
MIZŠ Data update 🤖
1c54ea1
OstaniZdrav Data update 🤖
f56bcc2
OstaniZdrav Data update 🤖
1fd3ecf
OstaniZdrav Data update 🤖
75b57a6
MIZŠ Data update 🤖
3ebb9c4
OstaniZdrav Data update 🤖
3cb4336
OstaniZdrav Data update 🤖
155cec4
MIZŠ Data update 🤖
d067afc
OstaniZdrav Data update 🤖
19c49b5
OstaniZdrav Data update 🤖
aff462d
OstaniZdrav Data update 🤖
e4078d5
OstaniZdrav Data update 🤖
2878895
OstaniZdrav Data update 🤖
a1f7b35
MIZŠ Data update 🤖
1e1de89
OstaniZdrav Data update 🤖
e0b117b
OstaniZdrav Data update 🤖
eaf4d5a
MIZŠ Data update 🤖
f64b107
OstaniZdrav Data update 🤖
5a1aeb1
OstaniZdrav Data update 🤖
744d12d
MIZŠ Data update 🤖
d4cb6b6
OstaniZdrav Data update 🤖
6ce2a1b
OstaniZdrav Data update 🤖
d731856
OstaniZdrav Data update 🤖
d9f5228
OstaniZdrav Data update 🤖
e23f554
OstaniZdrav Data update 🤖
3b79986
OstaniZdrav Data update 🤖
0a1f40a
MIZŠ Data update 🤖
6290720
OstaniZdrav Data update 🤖
ba7ca0b
OstaniZdrav Data update 🤖
876d005
MIZŠ Data update 🤖
a4907b4
OstaniZdrav Data update 🤖
9ffd3f8
OstaniZdrav Data update 🤖
ad1b143
MIZŠ Data update 🤖
f135427
OstaniZdrav Data update 🤖
6b284ff
OstaniZdrav Data update 🤖
6933dba
OstaniZdrav Data update 🤖
a9062b2
OstaniZdrav Data update 🤖
4587cc9
OstaniZdrav Data update 🤖
a8f7376
OstaniZdrav Data update 🤖
2076729
OstaniZdrav Data update 🤖
20c8bb9
OstaniZdrav Data update 🤖
6b6c2c1
OstaniZdrav Data update 🤖
7eb4fc5
OstaniZdrav Data update 🤖
834c199
OstaniZdrav Data update 🤖
14c174e
MIZŠ Data update 🤖
f550a80
OstaniZdrav Data update 🤖
d573f40
OstaniZdrav Data update 🤖
cfa316a
OstaniZdrav Data update 🤖
1e7a477
OstaniZdrav Data update 🤖
65df474
MIZŠ Data update 🤖
6b16ae9
OstaniZdrav Data update 🤖
dc19225
OstaniZdrav Data update 🤖
80c5f17
OstaniZdrav Data update 🤖
b2d4041
OstaniZdrav Data update 🤖
c3bbd34
OstaniZdrav Data update 🤖
41a0071
OstaniZdrav Data update 🤖
c619dad
OstaniZdrav Data update 🤖
5603a9f
OstaniZdrav Data update 🤖
867d2e8
OstaniZdrav Data update 🤖
f06235b
OstaniZdrav Data update 🤖
89787ff
OstaniZdrav Data update 🤖
8b88744
OstaniZdrav Data update 🤖
144da92
OstaniZdrav Data update 🤖
4cf59ae
MIZŠ Data update 🤖
edda764
OstaniZdrav Data update 🤖
c1e955e
OstaniZdrav Data update 🤖
cf63cae
OstaniZdrav Data update 🤖
e19ae8a
OstaniZdrav Data update 🤖
9e95c66
OstaniZdrav Data update 🤖
cab6634
OstaniZdrav Data update 🤖
fa8d00f
OstaniZdrav Data update 🤖
8c2b667
OstaniZdrav Data update 🤖
6f57921
OstaniZdrav Data update 🤖
ba25258
OstaniZdrav Data update 🤖
a93ff50
OstaniZdrav Data update 🤖
4e03674
OstaniZdrav Data update 🤖
b8ea9fb
OstaniZdrav Data update 🤖
92aa83b
OstaniZdrav Data update 🤖
592d3bb
OstaniZdrav Data update 🤖
be032bd
OstaniZdrav Data update 🤖
2db8620
OstaniZdrav Data update 🤖
89e5138
OstaniZdrav Data update 🤖
2e314df
OstaniZdrav Data update 🤖
53becc5
OstaniZdrav Data update 🤖
9c7ceee
OstaniZdrav Data update 🤖
e92351d
OstaniZdrav Data update 🤖
e68897d
OstaniZdrav Data update 🤖
93d51f5
OstaniZdrav Data update 🤖
ec37f7e
OstaniZdrav Data update 🤖
c407608
OstaniZdrav Data update 🤖
1705584
OstaniZdrav Data update 🤖
7b55e57
OstaniZdrav Data update 🤖
be1f270
OstaniZdrav Data update 🤖
2fbf8da
OstaniZdrav Data update 🤖
de3416b
OstaniZdrav Data update 🤖
cad15dc
OstaniZdrav Data update 🤖
2eb7187
OstaniZdrav Data update 🤖
1ee8ab3
OstaniZdrav Data update 🤖
296e53f
OstaniZdrav Data update 🤖
15e94e7
OstaniZdrav Data update 🤖
dfe8e9e
OstaniZdrav Data update 🤖
bb43c82
OstaniZdrav Data update 🤖
69822d5
OstaniZdrav Data update 🤖
9e3d785
OstaniZdrav Data update 🤖
401d98a
OstaniZdrav Data update 🤖
7c6018c
OstaniZdrav Data update 🤖
b89d4af
OstaniZdrav Data update 🤖
a004c6c
OstaniZdrav Data update 🤖
b3fb159
OstaniZdrav Data update 🤖
13ed858
OstaniZdrav Data update 🤖
8caa74d
OstaniZdrav Data update 🤖
19f00c6
OstaniZdrav Data update 🤖
ed4ae13
OstaniZdrav Data update 🤖
823ccbb
OstaniZdrav Data update 🤖
7b37e00
OstaniZdrav Data update 🤖
cfca5f6
OstaniZdrav Data update 🤖
e008ba2
OstaniZdrav Data update 🤖
a0d17ed
OstaniZdrav Data update 🤖
f0a69af
OstaniZdrav Data update 🤖
b6a8256
OstaniZdrav Data update 🤖
2330f9f
OstaniZdrav Data update 🤖
2edb7b6
OstaniZdrav Data update 🤖
33aee64
OstaniZdrav Data update 🤖
1e6be96
OstaniZdrav Data update 🤖
0b9ac15
OstaniZdrav Data update 🤖
3a8708f
OstaniZdrav Data update 🤖
090f4e7
OstaniZdrav Data update 🤖
2db337a
OstaniZdrav Data update 🤖
8a4f410
OstaniZdrav Data update 🤖
f863b9f
OstaniZdrav Data update 🤖
2f9c340
OstaniZdrav Data update 🤖
efd649b
OstaniZdrav Data update 🤖
4c71b29
OstaniZdrav Data update 🤖
e1c1f4f
OstaniZdrav Data update 🤖
79c235a
OstaniZdrav Data update 🤖
3818ded
OstaniZdrav Data update 🤖
3cbe115
OstaniZdrav Data update 🤖
818a348
OstaniZdrav Data update 🤖
ef1d378
OstaniZdrav Data update 🤖
5462abb
OstaniZdrav Data update 🤖
ee8479a
OstaniZdrav Data update 🤖
b8c9dca
OstaniZdrav Data update 🤖
5ff0986
OstaniZdrav Data update 🤖
b363cf1
OstaniZdrav Data update 🤖
841db74
OstaniZdrav Data update 🤖
03f3509
OstaniZdrav Data update 🤖
3f30600
OstaniZdrav Data update 🤖
c283e8f
OstaniZdrav Data update 🤖
60e60e3
OstaniZdrav Data update 🤖
2b916f7
OstaniZdrav Data update 🤖
b836e30
OstaniZdrav Data update 🤖
a280b40
OstaniZdrav Data update 🤖
b79eb24
OstaniZdrav Data update 🤖
1e4c9c8
OstaniZdrav Data update 🤖
51e1c58
MIZŠ Data update 🤖
f29c4d3
OstaniZdrav Data update 🤖
2c3612d
OstaniZdrav Data update 🤖
9610186
OstaniZdrav Data update 🤖
d31a770
OstaniZdrav Data update 🤖
76ebdd9
OstaniZdrav Data update 🤖
cd5bebb
OstaniZdrav Data update 🤖
6e18cf7
OstaniZdrav Data update 🤖
e8c6b4d
OstaniZdrav Data update 🤖
8f28d36
OstaniZdrav Data update 🤖
342d3f6
OstaniZdrav Data update 🤖
a55608e
OstaniZdrav Data update 🤖
042aed6
OstaniZdrav Data update 🤖
3cc8fae
OstaniZdrav Data update 🤖
c6d6422
OstaniZdrav Data update 🤖
7dc10bf
OstaniZdrav Data update 🤖
60766c6
OstaniZdrav Data update 🤖
f62e1c1
OstaniZdrav Data update 🤖
ec4d8db
OstaniZdrav Data update 🤖
8a923f0
OstaniZdrav Data update 🤖
7408322
OstaniZdrav Data update 🤖
98cb10f
OstaniZdrav Data update 🤖
59b3ab3
OstaniZdrav Data update 🤖
2b02417
OstaniZdrav Data update 🤖
c53ba9d
OstaniZdrav Data update 🤖
8a47284
OstaniZdrav Data update 🤖
faac6ee
OstaniZdrav Data update 🤖
46289e7
OstaniZdrav Data update 🤖
04a906c
OstaniZdrav Data update 🤖
12b0171
OstaniZdrav Data update 🤖
8f9d4c3
OstaniZdrav Data update 🤖
57bd9af
OstaniZdrav Data update 🤖
ca11583
OstaniZdrav Data update 🤖
cd3283c
MIZŠ Data update 🤖
0197ea1
MIZŠ Data update 🤖
3a81bae
OstaniZdrav Data update 🤖
3ebd42d
OstaniZdrav Data update 🤖
1b6295e
OstaniZdrav Data update 🤖
d42e698
OstaniZdrav Data update 🤖
5319922
OstaniZdrav Data update 🤖
55bb88d
OstaniZdrav Data update 🤖
8965b1b
OstaniZdrav Data update 🤖
f42f99d
OstaniZdrav Data update 🤖
25424e7
OstaniZdrav Data update 🤖
da281ad
MIZŠ Data update 🤖
e480ae4
MIZŠ Data update 🤖
5539598
Merged upstream
ikolar 4f94eb7
OstaniZdrav Data update 🤖
8a5abbb
OstaniZdrav Data update 🤖
de9dc14
Merge branch 'master' of github.com:ikolar/data
ikolar 201aa3a
MIZŠ Data update 🤖
64fd252
OstaniZdrav Data update 🤖
ffdf20f
OstaniZdrav Data update 🤖
2736d2d
OstaniZdrav Data update 🤖
6eb59a7
MIZŠ Data update 🤖
59f0329
OstaniZdrav Data update 🤖
44c9990
OstaniZdrav Data update 🤖
168506d
MIZŠ Data update 🤖
e5e070d
OstaniZdrav Data update 🤖
0f0fb69
OstaniZdrav Data update 🤖
e4a5c1f
OstaniZdrav Data update 🤖
1c9bbfa
OstaniZdrav Data update 🤖
34205e8
Merge branch 'master' of github.com:ikolar/data
ikolar 5559601
Dopolnil vaccination.csv s podatki o tem, koliko cepljenj je starih v…
ikolar 0183614
Dodal izračun št. cepljenih, ki so bili cepljeni pred v zadnjih 1/2/3…
ikolar a4f0283
Posodobitev šifranta šol (dve novi šoli, nekaj popravkov naslovov, te…
ikolar 6ad8d49
Merged with upstream.
ikolar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
<<<<<<< HEAD | ||
1613568164 | ||
======= | ||
1613568229 | ||
>>>>>>> d5e22fd290f15082b09a8f100618b4fe493b8a1f | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
<<<<<<< HEAD | ||
1613696247 | ||
======= | ||
1613696318 | ||
>>>>>>> d5e22fd290f15082b09a8f100618b4fe493b8a1f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#! /bin/python | ||
|
||
from datetime import datetime, timedelta | ||
from datetime import datetime | ||
from operator import itemgetter | ||
import codecs | ||
import csv | ||
|
@@ -61,19 +61,45 @@ def get_sledilnik_key(d, mizs_key): | |
|
||
def reformat_dates(date_columns, row): | ||
""" | ||
Reformat the dates from a human-readable d.m.Y form into | ||
the standard YMD form. | ||
Reformat dates (DAT_OD, DAT_DO, DAT_POROCANJA) from a | ||
human-readable d.m.Y form into the standard YMD form. | ||
""" | ||
|
||
# parse dates | ||
for i in date_columns: | ||
date = dateutil.parser.parse(row[i], dayfirst=True).date() | ||
# fix errornous "0020" year entries | ||
|
||
# the reporting app doen't seem to validate the year field | ||
# sometimes, typos can happen | ||
# fix some common ones | ||
if date.year == 20: | ||
date = datetime(2020, date.month, date.day) | ||
date = datetime(2020, date.month, date.day).date() | ||
elif date.year == 2121: | ||
date = datetime(2021, date.month, date.day).date() | ||
elif date.year == 2201: | ||
date = datetime(2021, date.month, date.day).date() | ||
|
||
if date.year < 2020 or date.year > 2021: | ||
logger.warning("Suspicious date found in line: \n{}\n".format(row)) | ||
row[i] = date | ||
|
||
# do some extra checks on the start and stop dates | ||
start_date = row[date_columns[0]] | ||
stop_date = row[date_columns[1]] | ||
# start date should of course not come after the stop date | ||
if start_date > stop_date: | ||
logger.warning( | ||
"Start date {} is after the stop date {} in line:\n{}".format( | ||
start_date, stop_date, row | ||
) | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could be either logger.warning(f'Start date {start_date} is after the stop date {stop_date} in line:\n{row}') (shorter)... or ... logger.warning('Start date %s is after the stop date %s in line:\n%s', start_date, stop_date, row) to leverage filtering using logging services where you can do aggregations for this message regardless of parameter values. |
||
# both should not be too far into the past nor the future | ||
now = datetime.now().date() | ||
if start_date.year < 2020 or (start_date - now).days > 10: | ||
logger.warning( | ||
"Weird start date {} found in line: \n{}".format(start_date, row) | ||
) | ||
elif stop_date.year < 2020 or (stop_date - now).days > 90: | ||
logger.warning("Weird stop date {} found in line: \n{}".format(stop_date, row)) | ||
|
||
|
||
def parse_csv(url): | ||
""" | ||
|
@@ -215,6 +241,7 @@ def school_regimes_csv(outfile): | |
csvwriter.writeheader() | ||
csvwriter.writerows(regimes) | ||
|
||
|
||
if __name__ == "__main__": | ||
dicts = load_dicts() | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tole je ostanek conflict resolvinga... treba fixat