rda-python-icoads 1.0.13__py3-none-any.whl → 1.0.14__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rda-python-icoads might be problematic. Click here for more details.
- rda_python_icoads/cleanicoads.py +4 -3
- rda_python_icoads/fillicoads.py +29 -20
- {rda_python_icoads-1.0.13.dist-info → rda_python_icoads-1.0.14.dist-info}/METADATA +1 -1
- {rda_python_icoads-1.0.13.dist-info → rda_python_icoads-1.0.14.dist-info}/RECORD +8 -8
- {rda_python_icoads-1.0.13.dist-info → rda_python_icoads-1.0.14.dist-info}/WHEEL +0 -0
- {rda_python_icoads-1.0.13.dist-info → rda_python_icoads-1.0.14.dist-info}/entry_points.txt +0 -0
- {rda_python_icoads-1.0.13.dist-info → rda_python_icoads-1.0.14.dist-info}/licenses/LICENSE +0 -0
- {rda_python_icoads-1.0.13.dist-info → rda_python_icoads-1.0.14.dist-info}/top_level.txt +0 -0
rda_python_icoads/cleanicoads.py
CHANGED
|
@@ -107,9 +107,10 @@ def clean_imma_data():
|
|
|
107
107
|
else:
|
|
108
108
|
clean_imma_data_for_tidx(tidx, cnd)
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
if not PVALS['aname']:
|
|
111
|
+
cnt = PgDBI.pgdel(table, PVALS['dcnd'], PgLOG.LGEREX)
|
|
112
|
+
s = 's' if cnt > 1 else ''
|
|
113
|
+
PgLOG.pglog("{}: {} record{} deleted for {}".format(table, cnt, s, PVALS['dcnd']), PgLOG.LOGWRN)
|
|
113
114
|
|
|
114
115
|
#
|
|
115
116
|
# clean up imma data for table index
|
rda_python_icoads/fillicoads.py
CHANGED
|
@@ -19,12 +19,15 @@ import re
|
|
|
19
19
|
from os import path as op
|
|
20
20
|
from rda_python_common import PgLOG
|
|
21
21
|
from rda_python_common import PgDBI
|
|
22
|
+
from rda_python_common import PgUtil
|
|
22
23
|
from . import PgIMMA
|
|
23
24
|
|
|
24
25
|
PVALS = {
|
|
25
26
|
'uatti' : '',
|
|
26
27
|
'names' : None,
|
|
27
|
-
'files' : []
|
|
28
|
+
'files' : [],
|
|
29
|
+
'dates' : [],
|
|
30
|
+
'dtlen' : 0
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
#
|
|
@@ -38,25 +41,29 @@ def main():
|
|
|
38
41
|
|
|
39
42
|
option = None
|
|
40
43
|
for arg in argv:
|
|
41
|
-
if arg
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
if re.match(r'-\w', arg):
|
|
45
|
+
option = None
|
|
46
|
+
if arg[1] == "b":
|
|
47
|
+
PgLOG.PGLOG['BCKGRND'] = 1
|
|
48
|
+
elif arg[1] == "a":
|
|
49
|
+
PVALS['uatti'] = "98"
|
|
50
|
+
elif arg[1] == "u":
|
|
51
|
+
leaduid = 1
|
|
52
|
+
elif arg[1] == "e":
|
|
53
|
+
chkexist = 1
|
|
54
|
+
elif arg[1] == "i":
|
|
55
|
+
addinventory = 1
|
|
56
|
+
elif arg[1] in "fpr":
|
|
57
|
+
option = arg[1]
|
|
58
|
+
else:
|
|
59
|
+
PgLOG.pglog(arg + ": Invalid Option", PgLOG.LGWNEX)
|
|
57
60
|
elif option == 'f':
|
|
58
61
|
get_imma_filelist(arg)
|
|
59
62
|
option = None
|
|
63
|
+
elif option == 'p':
|
|
64
|
+
PVALS['dates'].append(PgUtil.format_date(arg))
|
|
65
|
+
PVALS['dtlen'] += 1
|
|
66
|
+
if PVALS['dtlen'] == 2: option = None
|
|
60
67
|
elif option == 'r':
|
|
61
68
|
rn3 = int(arg)
|
|
62
69
|
option = None
|
|
@@ -64,11 +71,12 @@ def main():
|
|
|
64
71
|
PVALS['files'].append(arg)
|
|
65
72
|
|
|
66
73
|
if not PVALS['files']:
|
|
67
|
-
print("Usage: fillicoads [-a] [-e] [-f InputFile] [-i] [-r RN3] [-u] FileList")
|
|
74
|
+
print("Usage: fillicoads [-a] [-e] [-f InputFile] [-i] [-p BDate [EDate]] [-r RN3] [-u] FileList")
|
|
68
75
|
print(" At least one file name needs to fill icoads data into Postgres Server")
|
|
69
76
|
print(" Option -a: add all attms, including multi-line ones, such as IVAD and REANQC")
|
|
70
77
|
print(" Option -f: provide a filename holding a list of IMMA1 files")
|
|
71
78
|
print(" Option -i: add daily counting records into inventory table")
|
|
79
|
+
print(" Option -p: provide a period for filling data")
|
|
72
80
|
print(" Option -r: the Third digit of IMMA release number")
|
|
73
81
|
print(" Option -u: standalone attachment records with leading 6-character UID")
|
|
74
82
|
print(" Option -e: check existing record before adding attm")
|
|
@@ -121,10 +129,10 @@ def process_imma_file(fname, addinventory):
|
|
|
121
129
|
|
|
122
130
|
# get the first valid date and do initialization
|
|
123
131
|
line = IMMA.readline()
|
|
132
|
+
PgIMMA.identify_attm_name(line) # check and record standalone attm name
|
|
124
133
|
while line:
|
|
125
|
-
PgIMMA.identify_attm_name(line) # check and record standalone attm name
|
|
126
134
|
idate = cdate = PgIMMA.get_imma_date(line)
|
|
127
|
-
if cdate:
|
|
135
|
+
if cdate and (PVALS['dtlen'] == 0 or cdate >= PVALS['dates'][0]):
|
|
128
136
|
PgIMMA.init_indices_for_date(cdate, iname)
|
|
129
137
|
records = PgIMMA.get_imma_records(cdate, line, records)
|
|
130
138
|
break
|
|
@@ -142,6 +150,7 @@ def process_imma_file(fname, addinventory):
|
|
|
142
150
|
for i in range(PgIMMA.TABLECOUNT): acounts[i] += acnts[i]
|
|
143
151
|
records = {}
|
|
144
152
|
cdate = idate
|
|
153
|
+
if PVALS['dtlen'] == 2 and cdate > PVALS['dates'][1]: break
|
|
145
154
|
PgIMMA.init_indices_for_date(cdate, iname)
|
|
146
155
|
records = PgIMMA.get_imma_records(idate, line, records)
|
|
147
156
|
line = IMMA.readline()
|
|
@@ -3,12 +3,12 @@ rda_python_icoads/R3.0-stat_doc.pdf,sha256=7f9wKlaTV7ZWXCqyZ4MZ3QcL5pw-Hz623A3xe
|
|
|
3
3
|
rda_python_icoads/README_R3.0_Subset.html,sha256=tf5Om69KsZZ9ksIjIwtGQUtU8O4U-fqOrIxrl_4tRPo,6878
|
|
4
4
|
rda_python_icoads/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
5
5
|
rda_python_icoads/checkicoads.py,sha256=nbA09uqaVBf9BHPWWeLFke3sRAGgV7CyOG4VIKI33wY,6599
|
|
6
|
-
rda_python_icoads/cleanicoads.py,sha256=
|
|
6
|
+
rda_python_icoads/cleanicoads.py,sha256=RSj7CfwsV8CuppY1euHpBN_UrFsiE-qHblXkMbhMsr8,5109
|
|
7
7
|
rda_python_icoads/countattm.py,sha256=syrEKhO-z1Xb-SjtbqHhzSvywuC_72hyex9K_0uUwzg,3578
|
|
8
8
|
rda_python_icoads/countattmvar.py,sha256=BYUSK2qTi0wKHg97gAOye95BJj8c3w728aoumL0C5ns,7498
|
|
9
9
|
rda_python_icoads/counticoads.py,sha256=GB7mRXXQ80Ty_1UF4hyYxrO0IPOeUCq5JUhoxkuvXZs,4555
|
|
10
10
|
rda_python_icoads/countsst.py,sha256=Sx3RicOdEQOXjXrBEUxnTTt6xgoeM2qPLwIMKBBIdps,6362
|
|
11
|
-
rda_python_icoads/fillicoads.py,sha256=
|
|
11
|
+
rda_python_icoads/fillicoads.py,sha256=Ld6sm1LUiKIlEEkEodToe-DjNZUBDC_zonrzSXY_PYg,5491
|
|
12
12
|
rda_python_icoads/fillinventory.py,sha256=eRNw6laHsF_Ry5SVOJCulDNa4T-9FTT2UObt__Pr3IM,4144
|
|
13
13
|
rda_python_icoads/fillitable.py,sha256=_zCUuYZifMZUoBO8JSY0DcoQOM33smQ1WtWJWnlH3ks,9941
|
|
14
14
|
rda_python_icoads/fillmonth.py,sha256=Abo_5KoX4Zs-vlYcEvovo14xEiO_BNgUxV5fFxT-L3M,2546
|
|
@@ -22,9 +22,9 @@ rda_python_icoads/msg_download.py,sha256=SqJVdVs6kN-ZLh1d4rSMS4IkRdRrYf5c4Y45zV7
|
|
|
22
22
|
rda_python_icoads/msgsubset.f,sha256=KuM2WAk0ZFEH8LBhHKiGWt8zaW_0ARJXYV2kiD5w5xs,21253
|
|
23
23
|
rda_python_icoads/rdimma1_csv.f,sha256=_hOHvA0UiTykCIsj7ZYkmooNmUq29-p7ZnyjeSyvt8U,22443
|
|
24
24
|
rda_python_icoads/writeicoads.py,sha256=nNgcPTFw957qsBkMVXgrPAkj3qmG8g5b6NeePp4NkNk,5270
|
|
25
|
-
rda_python_icoads-1.0.
|
|
26
|
-
rda_python_icoads-1.0.
|
|
27
|
-
rda_python_icoads-1.0.
|
|
28
|
-
rda_python_icoads-1.0.
|
|
29
|
-
rda_python_icoads-1.0.
|
|
30
|
-
rda_python_icoads-1.0.
|
|
25
|
+
rda_python_icoads-1.0.14.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
|
|
26
|
+
rda_python_icoads-1.0.14.dist-info/METADATA,sha256=FwiGBndVSKAJ1oWZP1PVApw2LY9w8FxaajiQb5EfzQA,795
|
|
27
|
+
rda_python_icoads-1.0.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
28
|
+
rda_python_icoads-1.0.14.dist-info/entry_points.txt,sha256=O4wzIJ3tibs6BADt2-9O51suWVggGg3CKVq6PJ2TC1g,774
|
|
29
|
+
rda_python_icoads-1.0.14.dist-info/top_level.txt,sha256=PjJe4PwUIiNxPlNg2d8JNPY1SLSu-_GHAdXe-hUVU1U,18
|
|
30
|
+
rda_python_icoads-1.0.14.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|