kardioutils 1.0.10__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.
Files changed (40) hide show
  1. kardioutils-1.0.10/LICENSE.txt +17 -0
  2. kardioutils-1.0.10/PKG-INFO +21 -0
  3. kardioutils-1.0.10/README.md +82 -0
  4. kardioutils-1.0.10/dl2050utils/__config__.py +30 -0
  5. kardioutils-1.0.10/dl2050utils/__init__.py +0 -0
  6. kardioutils-1.0.10/dl2050utils/__version__.py +1 -0
  7. kardioutils-1.0.10/dl2050utils/api.py +576 -0
  8. kardioutils-1.0.10/dl2050utils/auth.py +736 -0
  9. kardioutils-1.0.10/dl2050utils/com.py +242 -0
  10. kardioutils-1.0.10/dl2050utils/common.py +18 -0
  11. kardioutils-1.0.10/dl2050utils/core.py +476 -0
  12. kardioutils-1.0.10/dl2050utils/db copy.py +877 -0
  13. kardioutils-1.0.10/dl2050utils/db.py +785 -0
  14. kardioutils-1.0.10/dl2050utils/dbdf.py +123 -0
  15. kardioutils-1.0.10/dl2050utils/dbutils.py +97 -0
  16. kardioutils-1.0.10/dl2050utils/df.py +378 -0
  17. kardioutils-1.0.10/dl2050utils/env.py +36 -0
  18. kardioutils-1.0.10/dl2050utils/etl.py +114 -0
  19. kardioutils-1.0.10/dl2050utils/fdb.py +125 -0
  20. kardioutils-1.0.10/dl2050utils/fs.py +624 -0
  21. kardioutils-1.0.10/dl2050utils/graphql.py +226 -0
  22. kardioutils-1.0.10/dl2050utils/gs.py +424 -0
  23. kardioutils-1.0.10/dl2050utils/ju.py +141 -0
  24. kardioutils-1.0.10/dl2050utils/log.py +91 -0
  25. kardioutils-1.0.10/dl2050utils/mq.py +185 -0
  26. kardioutils-1.0.10/dl2050utils/rest.py +267 -0
  27. kardioutils-1.0.10/dl2050utils/restapp.py +389 -0
  28. kardioutils-1.0.10/dl2050utils/restutils.py +415 -0
  29. kardioutils-1.0.10/dl2050utils/sqlite.py +69 -0
  30. kardioutils-1.0.10/dl2050utils/ulists.py +137 -0
  31. kardioutils-1.0.10/dl2050utils/wsgi.py +103 -0
  32. kardioutils-1.0.10/kardioutils.egg-info/PKG-INFO +21 -0
  33. kardioutils-1.0.10/kardioutils.egg-info/SOURCES.txt +39 -0
  34. kardioutils-1.0.10/kardioutils.egg-info/dependency_links.txt +1 -0
  35. kardioutils-1.0.10/kardioutils.egg-info/top_level.txt +1 -0
  36. kardioutils-1.0.10/setup.cfg +7 -0
  37. kardioutils-1.0.10/setup.py +34 -0
  38. kardioutils-1.0.10/test/test_core.py +268 -0
  39. kardioutils-1.0.10/test/test_db.py +15 -0
  40. kardioutils-1.0.10/test/test_env.py +39 -0
@@ -0,0 +1,17 @@
1
+ MIT License
2
+ Copyright (c) 2018 YOUR NAME
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+ The above copyright notice and this permission notice shall be included in all
10
+ copies or substantial portions of the Software.
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17
+ SOFTWARE.
@@ -0,0 +1,21 @@
1
+ Metadata-Version: 2.4
2
+ Name: kardioutils
3
+ Version: 1.0.10
4
+ Summary: Utils lib
5
+ Author: João Neto
6
+ Author-email: joao.filipe.neto@gmail.com
7
+ License: MIT
8
+ Keywords: utils
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Topic :: Software Development :: Build Tools
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ License-File: LICENSE.txt
15
+ Dynamic: author
16
+ Dynamic: author-email
17
+ Dynamic: classifier
18
+ Dynamic: keywords
19
+ Dynamic: license
20
+ Dynamic: license-file
21
+ Dynamic: summary
@@ -0,0 +1,82 @@
1
+ DL Utils
2
+
3
+ # core
4
+ is_numeric_str, check_float, check_int, check_str, check, check_list_str, check_dict
5
+
6
+ # env
7
+ config_load
8
+
9
+ # log
10
+ AppLog, BaseLog
11
+
12
+ # com
13
+
14
+ # fs
15
+
16
+ # df
17
+
18
+ # db
19
+
20
+ # mq
21
+
22
+ # auth
23
+
24
+ # rest (restapp, restutils)
25
+
26
+ # wsgi
27
+
28
+ # etl
29
+
30
+ # ju
31
+ em principio para funcionar basta colocar a tabela user_orgs
32
+ Alterar a bd update :
33
+ ———
34
+ ALTER TABLE wlists
35
+ ADD COLUMN org INT NOT NULL DEFAULT 1;
36
+ ———
37
+ CREATE SEQUENCE orgs_id_seq;
38
+ ALTER TABLE orgs
39
+ ALTER COLUMN id SET DEFAULT nextval('orgs_id_seq');
40
+ SELECT setval('orgs_id_seq', (SELECT MAX(id) FROM orgs));
41
+ ———
42
+ UPDATE users
43
+ SET org = 1
44
+ WHERE org IS NULL;
45
+ ALTER TABLE users
46
+ ALTER COLUMN org SET NOT NULL;
47
+ ————————————————————
48
+ ALTER TABLE ecgs
49
+ ADD COLUMN org INT;
50
+ UPDATE ecgs
51
+ SET org = 1;
52
+ ALTER TABLE ecgs
53
+ ALTER COLUMN org SET NOT NULL;
54
+ ——————————————————
55
+
56
+
57
+ ALTER TABLE users
58
+ ADD CONSTRAINT fk_users_org
59
+ FOREIGN KEY (org) REFERENCES orgs(id);
60
+
61
+ ALTER TABLE wlists
62
+ ADD CONSTRAINT fk_wlists_org
63
+ FOREIGN KEY (org) REFERENCES orgs(id);
64
+
65
+ ALTER TABLE ecgs
66
+ ADD CONSTRAINT fk_ecgs_org
67
+ FOREIGN KEY (org) REFERENCES orgs(id);
68
+
69
+
70
+ CREATE TABLE user_orgs (
71
+ user_id INT NOT NULL,
72
+ org_id INT NOT NULL,
73
+ PRIMARY KEY (user_id, org_id),
74
+ FOREIGN KEY (user_id) REFERENCES users(id),
75
+ FOREIGN KEY (org_id) REFERENCES orgs(id)
76
+ );
77
+ —————————————
78
+ ALTER TABLE uploads
79
+ ADD COLUMN IF NOT EXISTS org INTEGER NOT NULL DEFAULT 1;
80
+ ——————————————
81
+ ALTER TABLE orgs
82
+ ADD COLUMN logo_url VARCHAR(255);
@@ -0,0 +1,30 @@
1
+ import re
2
+
3
+ name = 'kardioutils'
4
+ package = 'dl2050utils'
5
+ description = 'Utils lib'
6
+ author = 'João Neto'
7
+ author_email = 'joao.filipe.neto@gmail.com'
8
+ keywords = ['utils']
9
+
10
+ def get_version_parts(ver):
11
+ res = re.split(r'\.', ver, maxsplit=2)
12
+ if len(res)<3: raise RuntimeError('Unable to parse version number')
13
+ return res
14
+
15
+ def get_minor(ver):
16
+ res = get_version_parts(ver)
17
+ return res[2]
18
+
19
+ def get_camel(ver):
20
+ res = get_version_parts(ver)
21
+ return f'{res[0]}_{res[1]}_{res[2]}'
22
+
23
+ def save_version(ver):
24
+ with open(f'./{package}/__version__.py', 'w') as f: f.write(f'version = "{ver}"')
25
+
26
+ def pump_version(ver):
27
+ res = get_version_parts(ver)
28
+ ver2 = f'{res[0]}.{res[1]}.{str(int(res[2])+1)}'
29
+ save_version(ver2)
30
+ return ver2
File without changes
@@ -0,0 +1 @@
1
+ version = "1.0.10"