rda-python-metrics 1.0.7__tar.gz → 1.0.8__tar.gz
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-metrics might be problematic. Click here for more details.
- {rda_python_metrics-1.0.7/src/rda_python_metrics.egg-info → rda_python_metrics-1.0.8}/PKG-INFO +4 -1
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/pyproject.toml +9 -1
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillcountry.py +4 -5
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/filloneorder.py +3 -4
- rda_python_metrics-1.0.8/src/rda_python_metrics/pgsyspath.py +36 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewordusage.py +17 -17
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewwebfile.py +14 -14
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8/src/rda_python_metrics.egg-info}/PKG-INFO +4 -1
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics.egg-info/SOURCES.txt +1 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics.egg-info/requires.txt +3 -0
- rda_python_metrics-1.0.8/tests/test_metrics.py +31 -0
- rda_python_metrics-1.0.7/tests/test_metrics.py +0 -6
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/LICENSE +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/MANIFEST.in +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/README.md +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/setup.cfg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/PgIPInfo.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/PgView.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/__init__.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillawsusage.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillawsusage.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillcodusage.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillcodusage.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillendtime.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillglobususage.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillglobususage.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillipinfo.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillipinfo.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/filloneorder.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillosdfusage.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillosdfusage.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillrdadb.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillrdadb.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/filltdsusage.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/filltdsusage.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/filluser.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/filluser.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/logarch.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/logarch.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/pgperson.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/pgusername.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewallusage.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewallusage.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewcheckusage.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewcheckusage.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewcodusage.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewcodusage.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewordusage.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewrqstusage.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewrqstusage.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewtdsusage.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewtdsusage.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewwebfile.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewwebusage.py +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewwebusage.usg +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics.egg-info/dependency_links.txt +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics.egg-info/entry_points.txt +0 -0
- {rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics.egg-info/top_level.txt +0 -0
{rda_python_metrics-1.0.7/src/rda_python_metrics.egg-info → rda_python_metrics-1.0.8}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rda_python_metrics
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.8
|
|
4
4
|
Summary: RDA Python Package to gather and view data usage metrics
|
|
5
5
|
Author-email: Zaihua Ji <zji@ucar.edu>
|
|
6
6
|
Project-URL: Homepage, https://github.com/NCAR/rda-python-metrics
|
|
@@ -13,6 +13,9 @@ Description-Content-Type: text/markdown
|
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: rda_python_common
|
|
15
15
|
Requires-Dist: rda_python_setuid
|
|
16
|
+
Requires-Dist: geoip2
|
|
17
|
+
Requires-Dist: ipinfo
|
|
18
|
+
Requires-Dist: httplib2
|
|
16
19
|
Dynamic: license-file
|
|
17
20
|
|
|
18
21
|
RDA Python Package to gather and view data usage metrics.
|
|
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "rda_python_metrics"
|
|
9
|
-
version = "1.0.
|
|
9
|
+
version = "1.0.8"
|
|
10
10
|
authors = [
|
|
11
11
|
{ name="Zaihua Ji", email="zji@ucar.edu" },
|
|
12
12
|
]
|
|
@@ -22,6 +22,9 @@ classifiers = [
|
|
|
22
22
|
dependencies = [
|
|
23
23
|
"rda_python_common",
|
|
24
24
|
"rda_python_setuid",
|
|
25
|
+
"geoip2",
|
|
26
|
+
"ipinfo",
|
|
27
|
+
"httplib2"
|
|
25
28
|
]
|
|
26
29
|
|
|
27
30
|
[tool.setuptools]
|
|
@@ -39,6 +42,11 @@ where = ["src"]
|
|
|
39
42
|
"viewwebusage.usg"
|
|
40
43
|
]
|
|
41
44
|
|
|
45
|
+
[tool.pytest.ini_options]
|
|
46
|
+
pythonpath = [
|
|
47
|
+
"src"
|
|
48
|
+
]
|
|
49
|
+
|
|
42
50
|
[project.urls]
|
|
43
51
|
"Homepage" = "https://github.com/NCAR/rda-python-metrics"
|
|
44
52
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
1
|
+
#!/usr/bin/env python3/
|
|
2
2
|
#
|
|
3
3
|
###############################################################################
|
|
4
4
|
#
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
import sys
|
|
18
18
|
import re
|
|
19
19
|
from rda_python_common import PgLOG
|
|
20
|
-
from rda_python_common import PgIMMA
|
|
21
20
|
from rda_python_common import PgUtil
|
|
22
21
|
from rda_python_common import PgDBI
|
|
23
22
|
|
|
@@ -29,7 +28,7 @@ def main():
|
|
|
29
28
|
argv = sys.argv[1:]
|
|
30
29
|
tables = ['allusage', 'user', 'wuser']
|
|
31
30
|
table = None
|
|
32
|
-
|
|
31
|
+
|
|
33
32
|
# check command line
|
|
34
33
|
for arg in argv:
|
|
35
34
|
if arg == "-b":
|
|
@@ -40,7 +39,7 @@ def main():
|
|
|
40
39
|
table = arg
|
|
41
40
|
else:
|
|
42
41
|
PgLOG.pglog(arg + ": one table name at a time", PgLOG.LGEREX)
|
|
43
|
-
|
|
42
|
+
|
|
44
43
|
if not table:
|
|
45
44
|
print("Usage: fillcountry TableName\n")
|
|
46
45
|
sys.exit(0)
|
|
@@ -51,7 +50,7 @@ def main():
|
|
|
51
50
|
PgLOG.cmdlog("fillcountry {}".format(' '.join(argv)))
|
|
52
51
|
|
|
53
52
|
process_countries(table)
|
|
54
|
-
|
|
53
|
+
|
|
55
54
|
sys.exit(0)
|
|
56
55
|
|
|
57
56
|
def process_countries(table):
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/filloneorder.py
RENAMED
|
@@ -17,12 +17,11 @@ import sys
|
|
|
17
17
|
import re
|
|
18
18
|
from rda_python_common import PgLOG
|
|
19
19
|
from rda_python_common import PgDBI
|
|
20
|
-
from rda_python_common import PgIMMA
|
|
21
20
|
from rda_python_common import PgUtil
|
|
22
21
|
|
|
23
22
|
# -t dsid, -e email, -v request data volume, -i data input volume,
|
|
24
23
|
# -m delivery method, -a amount charged, -p pay method, -d request date, -x close date,
|
|
25
|
-
# -y close time, -c file count, -s specialist login name, -o order id,
|
|
24
|
+
# -y close time, -c file count, -s specialist login name, -o order id,
|
|
26
25
|
# mandatory options: -t, -e, -v, and -m
|
|
27
26
|
|
|
28
27
|
#
|
|
@@ -63,7 +62,7 @@ def add_one_order(params):
|
|
|
63
62
|
|
|
64
63
|
year = None
|
|
65
64
|
record = {}
|
|
66
|
-
|
|
65
|
+
|
|
67
66
|
record['dsid'] = params['t']
|
|
68
67
|
record['wuid_request'] = params['u']
|
|
69
68
|
record['dss_uname'] = params['s']
|
|
@@ -100,7 +99,7 @@ def add_to_allusage(record, year, ctime):
|
|
|
100
99
|
pgrec['method'] = record['method']
|
|
101
100
|
pgrec['source'] = 'O'
|
|
102
101
|
return PgDBI.add_yearly_allusage(year, pgrec)
|
|
103
|
-
|
|
102
|
+
|
|
104
103
|
return 0
|
|
105
104
|
|
|
106
105
|
#
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#
|
|
2
|
+
##################################################################################
|
|
3
|
+
#
|
|
4
|
+
# Title: pgsyspath
|
|
5
|
+
# Author: Zaihua Ji, zji@ucar.edu
|
|
6
|
+
# Date: 10/21/2020
|
|
7
|
+
# Purpose: python script to set sys.path properly to include paths for local
|
|
8
|
+
# modules
|
|
9
|
+
#
|
|
10
|
+
# Work File: $DSSHOME/bin/python/pgsyspath.py*
|
|
11
|
+
# Github: https://github.com/NCAR/rda-utility-programs.git
|
|
12
|
+
#
|
|
13
|
+
##################################################################################
|
|
14
|
+
|
|
15
|
+
import sys
|
|
16
|
+
import os
|
|
17
|
+
import re
|
|
18
|
+
|
|
19
|
+
#
|
|
20
|
+
# intinialize the sys.path to include paths for local modules
|
|
21
|
+
#
|
|
22
|
+
def include_local_paths():
|
|
23
|
+
|
|
24
|
+
rpath = '/glade/u/home/rdadata'
|
|
25
|
+
if re.match('PG', rpath): rpath = os.getenv('DSSHOME', '/glade/u/home/rdadata')
|
|
26
|
+
|
|
27
|
+
# add more path to pgpaths list as needed
|
|
28
|
+
pgpaths = [rpath + '/lib/python',
|
|
29
|
+
rpath + '/lib/python/site-packages']
|
|
30
|
+
for pgpath in pgpaths:
|
|
31
|
+
if pgpath not in sys.path: sys.path.insert(0, pgpath)
|
|
32
|
+
|
|
33
|
+
#
|
|
34
|
+
# call to include local paths when this module is imported or run independently
|
|
35
|
+
#
|
|
36
|
+
include_local_paths()
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewordusage.py
RENAMED
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
import os
|
|
15
15
|
import re
|
|
16
16
|
import sys
|
|
17
|
-
import pgsyspath
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import PgDBI
|
|
17
|
+
from . import pgsyspath
|
|
18
|
+
from . import PgView
|
|
19
|
+
from rda_python_common import PgLOG
|
|
20
|
+
from rda_python_common import PgUtil
|
|
21
|
+
from rda_python_common import PgDBI
|
|
22
22
|
|
|
23
23
|
VUSG = {
|
|
24
24
|
'SNMS' : "ABCDEFGHIJKLMNOPQRSTVWYZ", # all available short field names in FLDS
|
|
@@ -38,7 +38,7 @@ VUSG = {
|
|
|
38
38
|
# column 0 - column title showing in usage view
|
|
39
39
|
# column 1 - field name in format as shown in select clauses
|
|
40
40
|
# column 2 - field name shown in where condition query string
|
|
41
|
-
# column 3 - table name that the field belongs to
|
|
41
|
+
# column 3 - table name that the field belongs to
|
|
42
42
|
# column 4 - output field length, the longer one of data size and comlun title, determine
|
|
43
43
|
# dynamically if it is 0. Negative values indicate right justification
|
|
44
44
|
# column 5 - precision for floating point value if positive and show total value if not zero
|
|
@@ -76,7 +76,7 @@ FLDS = {
|
|
|
76
76
|
# column 0 - expand ID for group of fields
|
|
77
77
|
# column 1 - field name shown in where condition query string
|
|
78
78
|
# column 2 - field name in format as shown in select clauses
|
|
79
|
-
# column 3 - table name that the field belongs to
|
|
79
|
+
# column 3 - table name that the field belongs to
|
|
80
80
|
EXPAND = {
|
|
81
81
|
# SHRTNM EXPID CNDSTR FIELDNAME TBLNAM
|
|
82
82
|
'D' : ["TIME", "dDmy"],
|
|
@@ -105,7 +105,7 @@ EXPAND = {
|
|
|
105
105
|
# A -- number or records to return
|
|
106
106
|
# c -- array of specified country codes
|
|
107
107
|
# C -- a string of short field names for viewing usages
|
|
108
|
-
# d -- array of specified dates
|
|
108
|
+
# d -- array of specified dates
|
|
109
109
|
# D -- dates range, array of 1 or 2 dates in format of YYYY-MM-DD
|
|
110
110
|
# e -- array of specified email addresses
|
|
111
111
|
# E -- use given date or date range for email notice of data update
|
|
@@ -116,13 +116,13 @@ EXPAND = {
|
|
|
116
116
|
# j -- array of specified projects
|
|
117
117
|
# l -- array of specified last names
|
|
118
118
|
# L -- column delimiter for output
|
|
119
|
-
# m -- array of specified months
|
|
120
|
-
# M -- array of specified download methods
|
|
121
|
-
# n -- array of specified order numbers
|
|
119
|
+
# m -- array of specified months
|
|
120
|
+
# M -- array of specified download methods
|
|
121
|
+
# n -- array of specified order numbers
|
|
122
122
|
# N -- number request range, arrage of 1 or 2 integers
|
|
123
123
|
# o -- array of specified orginization types
|
|
124
124
|
# O -- a string of short field names for sorting on
|
|
125
|
-
# p -- array of specified payment methods
|
|
125
|
+
# p -- array of specified payment methods
|
|
126
126
|
# s -- output data size range, arrage of 1 or 2 sizes in unit of MByte
|
|
127
127
|
# S -- array of login names of specialists who processed the orders
|
|
128
128
|
# t -- array of specified dataset names
|
|
@@ -130,12 +130,12 @@ EXPAND = {
|
|
|
130
130
|
# U -- use given unit for file or data sizes
|
|
131
131
|
# v -- aray of specified roder numbers
|
|
132
132
|
# w -- generate view without totals
|
|
133
|
-
# y -- array of specified years
|
|
133
|
+
# y -- array of specified years
|
|
134
134
|
# z -- generate view including entries without usage
|
|
135
135
|
params = {}
|
|
136
136
|
|
|
137
137
|
# relationship between parameter options and short field names, A option is not
|
|
138
|
-
# related to a field name if it is not in keys %SNS
|
|
138
|
+
# related to a field name if it is not in keys %SNS
|
|
139
139
|
SNS = {
|
|
140
140
|
'c' : 'N', 'd' : 'D', 'D' : 'D', 'e' : 'E', 'g' : 'G', 'i' : 'I', 'j' : 'J',
|
|
141
141
|
'l' : 'L', 'm' : 'M', 'M' : 'W', 'n' : 'V', 'N' : 'H', 'o' : 'O', 'p' : 'K',
|
|
@@ -194,18 +194,18 @@ def main():
|
|
|
194
194
|
params[option] = 1
|
|
195
195
|
elif inputs:
|
|
196
196
|
params[option] = inputs # record input array
|
|
197
|
-
|
|
197
|
+
|
|
198
198
|
if not params:
|
|
199
199
|
PgLOG.show_usage(pgname)
|
|
200
200
|
else:
|
|
201
201
|
check_enough_options()
|
|
202
|
-
|
|
202
|
+
|
|
203
203
|
if 'o' not in params:
|
|
204
204
|
if 'e' not in params:
|
|
205
205
|
params['o'] = ['!', "'DSS'"] # default to exclude 'DSS' for organization
|
|
206
206
|
elif params['o'][0] == "'ALL'":
|
|
207
207
|
del params['o']
|
|
208
|
-
|
|
208
|
+
|
|
209
209
|
usgtable = "ousage"
|
|
210
210
|
build_query_strings(usgtable) # build tablenames, fieldnames, and conditions
|
|
211
211
|
records = PgDBI.pgmget(tablenames, fieldnames, condition, PgLOG.UCLWEX)
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
import os
|
|
17
17
|
import re
|
|
18
18
|
import sys
|
|
19
|
-
import PgLOG
|
|
20
|
-
import PgUtil
|
|
21
|
-
import PgDBI
|
|
19
|
+
from rda_python_common import PgLOG
|
|
20
|
+
from rda_python_common import PgUtil
|
|
21
|
+
from rda_python_common import PgDBI
|
|
22
22
|
from . import PgView
|
|
23
23
|
|
|
24
24
|
FILE = {
|
|
@@ -38,9 +38,9 @@ FILE = {
|
|
|
38
38
|
# column 0 - column title showing in mss file view
|
|
39
39
|
# column 1 - field name in format as shown in select clauses
|
|
40
40
|
# column 2 - field name shown in where condition query string
|
|
41
|
-
# column 3 - table name that the field belongs to
|
|
41
|
+
# column 3 - table name that the field belongs to
|
|
42
42
|
# column 4 - output field length, the longer one of data size and comlun title, determine
|
|
43
|
-
# dynamically if it is 0. Negative values indicate right justification
|
|
43
|
+
# dynamically if it is 0. Negative values indicate right justification
|
|
44
44
|
# column 5 - precision for floating point value if positive and show total value if not zero
|
|
45
45
|
# column 6 - field flag to indicate it is a group, distinct or sum field
|
|
46
46
|
FLDS = {
|
|
@@ -77,7 +77,7 @@ FLDS = {
|
|
|
77
77
|
# a -- 1 to view all usage info available
|
|
78
78
|
# A -- number or records to return
|
|
79
79
|
# C -- a string of short field names for viewing usages
|
|
80
|
-
# d -- array of specified dates of file last written
|
|
80
|
+
# d -- array of specified dates of file last written
|
|
81
81
|
# D -- last written dates range, array of 1 or 2 dates in format of YYYY-MM-DD
|
|
82
82
|
# e -- array of specified email addresses
|
|
83
83
|
# f -- array of specified online file names
|
|
@@ -90,16 +90,16 @@ FLDS = {
|
|
|
90
90
|
# J -- 1 to include group title for GROUP
|
|
91
91
|
# l -- array of specified last names
|
|
92
92
|
# L -- column delimiter for output
|
|
93
|
-
# m -- array of specified months of file last written
|
|
94
|
-
# M -- array of specified months of file created
|
|
95
|
-
# n -- array of specified user numbers
|
|
93
|
+
# m -- array of specified months of file last written
|
|
94
|
+
# M -- array of specified months of file created
|
|
95
|
+
# n -- array of specified user numbers
|
|
96
96
|
# D -- dates range, datasets created between, array of 1 or 2 dates in format of YYYY-MM-DD
|
|
97
97
|
# o -- array of specified file status
|
|
98
98
|
# O -- a string of short field names for sorting on
|
|
99
99
|
# p -- array of web file types, Data, Document, and etc.
|
|
100
100
|
# r -- group index range, array of 1 or 2 group indices
|
|
101
101
|
# s -- file size range, arrage of 1 or 2 sizes in unit of MByte
|
|
102
|
-
# S -- specialist lognames who handle the datasets
|
|
102
|
+
# S -- specialist lognames who handle the datasets
|
|
103
103
|
# t -- array of specified dataset names
|
|
104
104
|
# T -- dataset range, array of 1 or 2 dataset names
|
|
105
105
|
# u -- array of specified specialist user names
|
|
@@ -113,7 +113,7 @@ FLDS = {
|
|
|
113
113
|
params = {}
|
|
114
114
|
|
|
115
115
|
# relationship between parameter options and short field names, A option is not
|
|
116
|
-
# related to a field name if it is not in keys %SNS
|
|
116
|
+
# related to a field name if it is not in keys %SNS
|
|
117
117
|
SNS = {
|
|
118
118
|
'd' : 'D', 'D' : 'D', 'e' : 'E', 'f' : 'F', 'F' : 'F', 'g' : 'G', 'i' : 'I',
|
|
119
119
|
'l' : 'L', 'm' : 'M', 'M' : 'H', 'N' : 'N', 'o' : 'O', 'p' : 'P', 'r' : 'G',
|
|
@@ -174,7 +174,7 @@ def main():
|
|
|
174
174
|
params[option] = 1
|
|
175
175
|
elif inputs:
|
|
176
176
|
params[option] = inputs # record input array
|
|
177
|
-
|
|
177
|
+
|
|
178
178
|
if not params:
|
|
179
179
|
PgLOG.show_usage(pgname)
|
|
180
180
|
else:
|
|
@@ -196,7 +196,7 @@ def main():
|
|
|
196
196
|
PgView.simple_output(params, FLDS, records, totals)
|
|
197
197
|
|
|
198
198
|
PgLOG.pgexit(0)
|
|
199
|
-
|
|
199
|
+
|
|
200
200
|
#
|
|
201
201
|
# cehck if enough information entered on command line for generate view/report, exit if not
|
|
202
202
|
#
|
|
@@ -209,7 +209,7 @@ def check_enough_options():
|
|
|
209
209
|
if sn == 'X': continue # do not process INDEX field
|
|
210
210
|
if FILE['SNMS'].find(sn) < 0:
|
|
211
211
|
PgLOG.pglog("{}: Field {} must be in field names '{}X'".format(pgname, sn, FILE['SNMS']), PgLOG.LGWNEX)
|
|
212
|
-
|
|
212
|
+
|
|
213
213
|
if 'g' in params or 'G' in params:
|
|
214
214
|
if 't' not in params:
|
|
215
215
|
PgLOG.pglog("Miss dataset condition via Option -t for processing Group", PgLOG.LGWNEX)
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8/src/rda_python_metrics.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rda_python_metrics
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.8
|
|
4
4
|
Summary: RDA Python Package to gather and view data usage metrics
|
|
5
5
|
Author-email: Zaihua Ji <zji@ucar.edu>
|
|
6
6
|
Project-URL: Homepage, https://github.com/NCAR/rda-python-metrics
|
|
@@ -13,6 +13,9 @@ Description-Content-Type: text/markdown
|
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: rda_python_common
|
|
15
15
|
Requires-Dist: rda_python_setuid
|
|
16
|
+
Requires-Dist: geoip2
|
|
17
|
+
Requires-Dist: ipinfo
|
|
18
|
+
Requires-Dist: httplib2
|
|
16
19
|
Dynamic: license-file
|
|
17
20
|
|
|
18
21
|
RDA Python Package to gather and view data usage metrics.
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics.egg-info/SOURCES.txt
RENAMED
|
@@ -28,6 +28,7 @@ src/rda_python_metrics/filluser.usg
|
|
|
28
28
|
src/rda_python_metrics/logarch.py
|
|
29
29
|
src/rda_python_metrics/logarch.usg
|
|
30
30
|
src/rda_python_metrics/pgperson.py
|
|
31
|
+
src/rda_python_metrics/pgsyspath.py
|
|
31
32
|
src/rda_python_metrics/pgusername.py
|
|
32
33
|
src/rda_python_metrics/viewallusage.py
|
|
33
34
|
src/rda_python_metrics/viewallusage.usg
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# test_hello_world.py
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def test_metrics():
|
|
8
|
+
import rda_python_metrics.fillawsusage
|
|
9
|
+
import rda_python_metrics.fillcodusage
|
|
10
|
+
import rda_python_metrics.fillcountry
|
|
11
|
+
import rda_python_metrics.fillendtime
|
|
12
|
+
import rda_python_metrics.fillglobususage
|
|
13
|
+
import rda_python_metrics.fillipinfo
|
|
14
|
+
import rda_python_metrics.filloneorder
|
|
15
|
+
import rda_python_metrics.fillosdfusage
|
|
16
|
+
import rda_python_metrics.fillrdadb
|
|
17
|
+
import rda_python_metrics.filltdsusage
|
|
18
|
+
import rda_python_metrics.filluser
|
|
19
|
+
import rda_python_metrics.logarch
|
|
20
|
+
import rda_python_metrics.PgIPInfo
|
|
21
|
+
import rda_python_metrics.pgperson
|
|
22
|
+
import rda_python_metrics.pgusername
|
|
23
|
+
import rda_python_metrics.PgView
|
|
24
|
+
import rda_python_metrics.viewallusage
|
|
25
|
+
import rda_python_metrics.viewcheckusage
|
|
26
|
+
import rda_python_metrics.viewcodusage
|
|
27
|
+
import rda_python_metrics.viewordusage
|
|
28
|
+
import rda_python_metrics.viewrqstusage
|
|
29
|
+
import rda_python_metrics.viewtdsusage
|
|
30
|
+
import rda_python_metrics.viewwebfile
|
|
31
|
+
import rda_python_metrics.viewwebusage
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillawsusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillawsusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillcodusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillcodusage.usg
RENAMED
|
File without changes
|
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillglobususage.py
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillglobususage.usg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/filloneorder.usg
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillosdfusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/fillosdfusage.usg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/filltdsusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/filltdsusage.usg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewallusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewallusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewcheckusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewcheckusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewcodusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewcodusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewordusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewrqstusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewrqstusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewtdsusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewtdsusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewwebfile.usg
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewwebusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics/viewwebusage.usg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_metrics-1.0.7 → rda_python_metrics-1.0.8}/src/rda_python_metrics.egg-info/top_level.txt
RENAMED
|
File without changes
|