vt-commons 0.0.1__tar.gz → 0.0.1.dev2__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 (26) hide show
  1. {vt_commons-0.0.1/src/vt_commons.egg-info → vt_commons-0.0.1.dev2}/PKG-INFO +50 -39
  2. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/README.md +49 -38
  3. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/pyproject.toml +1 -1
  4. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2/src/vt_commons.egg-info}/PKG-INFO +50 -39
  5. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/LICENSE +0 -0
  6. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/setup.cfg +0 -0
  7. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/__init__.py +0 -0
  8. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/collections/__init__.py +0 -0
  9. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/collections/utils.py +0 -0
  10. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/core_py/__init__.py +0 -0
  11. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/core_py/base.py +0 -0
  12. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/core_py/utils.py +0 -0
  13. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/op/__init__.py +0 -0
  14. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/op/base.py +0 -0
  15. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/os/__init__.py +0 -0
  16. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/os/_base_utils.py +0 -0
  17. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/os/linux.py +0 -0
  18. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/os/mac.py +0 -0
  19. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/os/posix.py +0 -0
  20. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/os/windows.py +0 -0
  21. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/py.typed +0 -0
  22. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/state/__init__.py +0 -0
  23. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt/utils/commons/commons/state/done.py +0 -0
  24. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt_commons.egg-info/SOURCES.txt +0 -0
  25. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt_commons.egg-info/dependency_links.txt +0 -0
  26. {vt_commons-0.0.1 → vt_commons-0.0.1.dev2}/src/vt_commons.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vt-commons
3
- Version: 0.0.1
3
+ Version: 0.0.1.dev2
4
4
  Summary: Reusable common utilities, interfaces and implementations for python projects.
5
5
  Author-email: Suhas Krishna Srivastava <suhas.srivastava@vaastav.tech>
6
6
  Maintainer-email: Suhas Krishna Srivastava <suhas.srivastava@vaastav.tech>
@@ -28,79 +28,90 @@ Dynamic: license-file
28
28
 
29
29
  # vt-commons
30
30
 
31
+ ![PyPI - Types](https://img.shields.io/pypi/types/vt-commons)
32
+ ![GitHub License](https://img.shields.io/github/license/Vaastav-Technologies/py-commons)
31
33
  [![🔧 test](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/test.yml/badge.svg)](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/test.yml)
32
34
  [![💡 typecheck](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/typecheck.yml/badge.svg)](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/typecheck.yml)
33
35
  [![🛠️ lint](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/lint.yml/badge.svg)](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/lint.yml)
34
36
  [![📊 coverage](https://codecov.io/gh/Vaastav-Technologies/py-commons/branch/main/graph/badge.svg)](https://codecov.io/gh/Vaastav-Technologies/py-commons)
35
37
  [![📤 Upload Python Package](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/python-publish.yml/badge.svg)](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/python-publish.yml)
38
+ ![PyPI - Version](https://img.shields.io/pypi/v/vt-commons)
36
39
 
37
40
  ---
38
- Commons methods, utils, interfaces and implementations for python projects.
41
+ A fully typed library for commons methods, utils, interfaces and implementations for python projects.
39
42
 
40
43
  ### Install
41
44
 
42
- ```shell
43
- pip install vt-commons
44
- ```
45
+ ```shell
46
+ pip install vt-commons
47
+ ```
45
48
 
46
49
  #### Usage examples
47
50
 
48
51
  - Check for OS
49
52
  ```python
50
- from vt.utils.commons.commons.os import is_windows
53
+ from vt.utils.commons.commons.os import is_windows
51
54
 
52
- is_windows()
55
+ windows = is_windows()
53
56
  ```
54
57
  Check in `vt.utils.commons.commons.os` and documentation for more functions and utilities related to OS.
58
+
59
+
55
60
  - Perform some operation on a root directory
56
61
  ```python
57
- from vt.utils.commons.commons.op import RootDirOp, CWDRootDirOp, RootDirOps
58
- from pathlib import Path
62
+ from vt.utils.commons.commons.op import RootDirOp, CWDRootDirOp, RootDirOps
63
+ from pathlib import Path
59
64
 
60
- class MyRootDirectoryOperation(RootDirOp):
61
- ...
62
- @property
63
- def root_dir(self)-> Path:
64
- return Path('path', 'to', 'my', 'root-directory')
65
+ class MyRootDirectoryOperation(RootDirOp):
66
+ ...
67
+ @property
68
+ def root_dir(self)-> Path:
69
+ return Path('path', 'to', 'my', 'root-directory')
65
70
 
66
- certain_root_dir_operation: CWDRootDirOp = RootDirOps.from_path(Path('path', 'to', 'my', 'root-directory'))
71
+ certain_root_dir_operation: CWDRootDirOp = RootDirOps.from_path(Path('path', 'to', 'my', 'root-directory'))
67
72
  ```
68
73
  Check in `vt.utils.commons.commons.op` and documentation for more functions and utilities related to operations.
74
+
75
+
69
76
  - Perform state operations
70
77
  ```python
71
- from vt.utils.commons.commons.state import DoneMarker
72
-
73
- # Track state by marking done
74
- class MyStateManager(DoneMarker[int]):
75
- def __init__(self, *args, **kwargs):
76
- self.id_state = {1: False}
77
- ...
78
-
79
- def mark_done(self, _id: int)-> bool:
80
- # mark done for _id
81
- if self.id_state[_id] is True:
82
- return False
83
- self.id_state[_id] = True
84
- return True
78
+ from vt.utils.commons.commons.state import DoneMarker
79
+
80
+ # Track state by marking done
81
+ class MyStateManager(DoneMarker[int]):
82
+ def __init__(self, *args, **kwargs):
83
+ self.id_state = {1: False}
84
+ ...
85
+
86
+ def mark_done(self, _id: int)-> bool:
87
+ # mark done for _id
88
+ if self.id_state[_id] is True:
89
+ return False
90
+ self.id_state[_id] = True
91
+ return True
85
92
  ```
86
93
  Check in `vt.utils.commons.commons.state` and documentation for more functions and utilities related to tracking state.
94
+
95
+
87
96
  - Check if a value is `MISSING`
88
97
  ```python
89
- from vt.utils.commons.commons.core_py import MISSING, Missing, is_missing
90
-
91
- def some_operation(arg: Missing = MISSING):
92
- """
93
- ``MISSING`` can be used as a default value sentinel when ``None`` is a valid value for arg.
94
- """
95
- arg = 10 if is_missing(arg) else arg
96
- ...
98
+ from vt.utils.commons.commons.core_py import MISSING, Missing, is_missing
99
+
100
+ def some_operation(arg: Missing = MISSING):
101
+ """
102
+ ``MISSING`` can be used as a default value sentinel when ``None`` is a valid value for arg.
103
+ """
104
+ arg = 10 if is_missing(arg) else arg
105
+ ...
97
106
  ```
98
107
  Check in `vt.utils.commons.commons.core_py` and documentation for more functions and utilities related to function management.
108
+
109
+
99
110
  - Query and operate on iterables
100
111
  ```python
101
- from vt.utils.commons.commons.collections import get_first_true
112
+ from vt.utils.commons.commons.collections import get_first_true
102
113
 
103
- assert 3 == get_first_true([1, 3, 5, 7, 2, 1], 8, lambda x: x>2)
114
+ assert 3 == get_first_true([1, 3, 5, 7, 2, 1], 8, lambda x: x>2)
104
115
  ```
105
116
  Check in `vt.utils.commons.commons.collections` and documentation for more functions and utilities related to collection management.
106
117
 
@@ -1,78 +1,89 @@
1
1
  # vt-commons
2
2
 
3
+ ![PyPI - Types](https://img.shields.io/pypi/types/vt-commons)
4
+ ![GitHub License](https://img.shields.io/github/license/Vaastav-Technologies/py-commons)
3
5
  [![🔧 test](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/test.yml/badge.svg)](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/test.yml)
4
6
  [![💡 typecheck](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/typecheck.yml/badge.svg)](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/typecheck.yml)
5
7
  [![🛠️ lint](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/lint.yml/badge.svg)](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/lint.yml)
6
8
  [![📊 coverage](https://codecov.io/gh/Vaastav-Technologies/py-commons/branch/main/graph/badge.svg)](https://codecov.io/gh/Vaastav-Technologies/py-commons)
7
9
  [![📤 Upload Python Package](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/python-publish.yml/badge.svg)](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/python-publish.yml)
10
+ ![PyPI - Version](https://img.shields.io/pypi/v/vt-commons)
8
11
 
9
12
  ---
10
- Commons methods, utils, interfaces and implementations for python projects.
13
+ A fully typed library for commons methods, utils, interfaces and implementations for python projects.
11
14
 
12
15
  ### Install
13
16
 
14
- ```shell
15
- pip install vt-commons
16
- ```
17
+ ```shell
18
+ pip install vt-commons
19
+ ```
17
20
 
18
21
  #### Usage examples
19
22
 
20
23
  - Check for OS
21
24
  ```python
22
- from vt.utils.commons.commons.os import is_windows
25
+ from vt.utils.commons.commons.os import is_windows
23
26
 
24
- is_windows()
27
+ windows = is_windows()
25
28
  ```
26
29
  Check in `vt.utils.commons.commons.os` and documentation for more functions and utilities related to OS.
30
+
31
+
27
32
  - Perform some operation on a root directory
28
33
  ```python
29
- from vt.utils.commons.commons.op import RootDirOp, CWDRootDirOp, RootDirOps
30
- from pathlib import Path
34
+ from vt.utils.commons.commons.op import RootDirOp, CWDRootDirOp, RootDirOps
35
+ from pathlib import Path
31
36
 
32
- class MyRootDirectoryOperation(RootDirOp):
33
- ...
34
- @property
35
- def root_dir(self)-> Path:
36
- return Path('path', 'to', 'my', 'root-directory')
37
+ class MyRootDirectoryOperation(RootDirOp):
38
+ ...
39
+ @property
40
+ def root_dir(self)-> Path:
41
+ return Path('path', 'to', 'my', 'root-directory')
37
42
 
38
- certain_root_dir_operation: CWDRootDirOp = RootDirOps.from_path(Path('path', 'to', 'my', 'root-directory'))
43
+ certain_root_dir_operation: CWDRootDirOp = RootDirOps.from_path(Path('path', 'to', 'my', 'root-directory'))
39
44
  ```
40
45
  Check in `vt.utils.commons.commons.op` and documentation for more functions and utilities related to operations.
46
+
47
+
41
48
  - Perform state operations
42
49
  ```python
43
- from vt.utils.commons.commons.state import DoneMarker
44
-
45
- # Track state by marking done
46
- class MyStateManager(DoneMarker[int]):
47
- def __init__(self, *args, **kwargs):
48
- self.id_state = {1: False}
49
- ...
50
-
51
- def mark_done(self, _id: int)-> bool:
52
- # mark done for _id
53
- if self.id_state[_id] is True:
54
- return False
55
- self.id_state[_id] = True
56
- return True
50
+ from vt.utils.commons.commons.state import DoneMarker
51
+
52
+ # Track state by marking done
53
+ class MyStateManager(DoneMarker[int]):
54
+ def __init__(self, *args, **kwargs):
55
+ self.id_state = {1: False}
56
+ ...
57
+
58
+ def mark_done(self, _id: int)-> bool:
59
+ # mark done for _id
60
+ if self.id_state[_id] is True:
61
+ return False
62
+ self.id_state[_id] = True
63
+ return True
57
64
  ```
58
65
  Check in `vt.utils.commons.commons.state` and documentation for more functions and utilities related to tracking state.
66
+
67
+
59
68
  - Check if a value is `MISSING`
60
69
  ```python
61
- from vt.utils.commons.commons.core_py import MISSING, Missing, is_missing
62
-
63
- def some_operation(arg: Missing = MISSING):
64
- """
65
- ``MISSING`` can be used as a default value sentinel when ``None`` is a valid value for arg.
66
- """
67
- arg = 10 if is_missing(arg) else arg
68
- ...
70
+ from vt.utils.commons.commons.core_py import MISSING, Missing, is_missing
71
+
72
+ def some_operation(arg: Missing = MISSING):
73
+ """
74
+ ``MISSING`` can be used as a default value sentinel when ``None`` is a valid value for arg.
75
+ """
76
+ arg = 10 if is_missing(arg) else arg
77
+ ...
69
78
  ```
70
79
  Check in `vt.utils.commons.commons.core_py` and documentation for more functions and utilities related to function management.
80
+
81
+
71
82
  - Query and operate on iterables
72
83
  ```python
73
- from vt.utils.commons.commons.collections import get_first_true
84
+ from vt.utils.commons.commons.collections import get_first_true
74
85
 
75
- assert 3 == get_first_true([1, 3, 5, 7, 2, 1], 8, lambda x: x>2)
86
+ assert 3 == get_first_true([1, 3, 5, 7, 2, 1], 8, lambda x: x>2)
76
87
  ```
77
88
  Check in `vt.utils.commons.commons.collections` and documentation for more functions and utilities related to collection management.
78
89
 
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" # If not defined, then legacy behavior
7
7
 
8
8
  [project]
9
9
  name = "vt-commons"
10
- version = "0.0.1"
10
+ version = "0.0.1dev2"
11
11
  description = "Reusable common utilities, interfaces and implementations for python projects."
12
12
  readme = "README.md"
13
13
  authors = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vt-commons
3
- Version: 0.0.1
3
+ Version: 0.0.1.dev2
4
4
  Summary: Reusable common utilities, interfaces and implementations for python projects.
5
5
  Author-email: Suhas Krishna Srivastava <suhas.srivastava@vaastav.tech>
6
6
  Maintainer-email: Suhas Krishna Srivastava <suhas.srivastava@vaastav.tech>
@@ -28,79 +28,90 @@ Dynamic: license-file
28
28
 
29
29
  # vt-commons
30
30
 
31
+ ![PyPI - Types](https://img.shields.io/pypi/types/vt-commons)
32
+ ![GitHub License](https://img.shields.io/github/license/Vaastav-Technologies/py-commons)
31
33
  [![🔧 test](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/test.yml/badge.svg)](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/test.yml)
32
34
  [![💡 typecheck](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/typecheck.yml/badge.svg)](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/typecheck.yml)
33
35
  [![🛠️ lint](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/lint.yml/badge.svg)](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/lint.yml)
34
36
  [![📊 coverage](https://codecov.io/gh/Vaastav-Technologies/py-commons/branch/main/graph/badge.svg)](https://codecov.io/gh/Vaastav-Technologies/py-commons)
35
37
  [![📤 Upload Python Package](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/python-publish.yml/badge.svg)](https://github.com/Vaastav-Technologies/py-commons/actions/workflows/python-publish.yml)
38
+ ![PyPI - Version](https://img.shields.io/pypi/v/vt-commons)
36
39
 
37
40
  ---
38
- Commons methods, utils, interfaces and implementations for python projects.
41
+ A fully typed library for commons methods, utils, interfaces and implementations for python projects.
39
42
 
40
43
  ### Install
41
44
 
42
- ```shell
43
- pip install vt-commons
44
- ```
45
+ ```shell
46
+ pip install vt-commons
47
+ ```
45
48
 
46
49
  #### Usage examples
47
50
 
48
51
  - Check for OS
49
52
  ```python
50
- from vt.utils.commons.commons.os import is_windows
53
+ from vt.utils.commons.commons.os import is_windows
51
54
 
52
- is_windows()
55
+ windows = is_windows()
53
56
  ```
54
57
  Check in `vt.utils.commons.commons.os` and documentation for more functions and utilities related to OS.
58
+
59
+
55
60
  - Perform some operation on a root directory
56
61
  ```python
57
- from vt.utils.commons.commons.op import RootDirOp, CWDRootDirOp, RootDirOps
58
- from pathlib import Path
62
+ from vt.utils.commons.commons.op import RootDirOp, CWDRootDirOp, RootDirOps
63
+ from pathlib import Path
59
64
 
60
- class MyRootDirectoryOperation(RootDirOp):
61
- ...
62
- @property
63
- def root_dir(self)-> Path:
64
- return Path('path', 'to', 'my', 'root-directory')
65
+ class MyRootDirectoryOperation(RootDirOp):
66
+ ...
67
+ @property
68
+ def root_dir(self)-> Path:
69
+ return Path('path', 'to', 'my', 'root-directory')
65
70
 
66
- certain_root_dir_operation: CWDRootDirOp = RootDirOps.from_path(Path('path', 'to', 'my', 'root-directory'))
71
+ certain_root_dir_operation: CWDRootDirOp = RootDirOps.from_path(Path('path', 'to', 'my', 'root-directory'))
67
72
  ```
68
73
  Check in `vt.utils.commons.commons.op` and documentation for more functions and utilities related to operations.
74
+
75
+
69
76
  - Perform state operations
70
77
  ```python
71
- from vt.utils.commons.commons.state import DoneMarker
72
-
73
- # Track state by marking done
74
- class MyStateManager(DoneMarker[int]):
75
- def __init__(self, *args, **kwargs):
76
- self.id_state = {1: False}
77
- ...
78
-
79
- def mark_done(self, _id: int)-> bool:
80
- # mark done for _id
81
- if self.id_state[_id] is True:
82
- return False
83
- self.id_state[_id] = True
84
- return True
78
+ from vt.utils.commons.commons.state import DoneMarker
79
+
80
+ # Track state by marking done
81
+ class MyStateManager(DoneMarker[int]):
82
+ def __init__(self, *args, **kwargs):
83
+ self.id_state = {1: False}
84
+ ...
85
+
86
+ def mark_done(self, _id: int)-> bool:
87
+ # mark done for _id
88
+ if self.id_state[_id] is True:
89
+ return False
90
+ self.id_state[_id] = True
91
+ return True
85
92
  ```
86
93
  Check in `vt.utils.commons.commons.state` and documentation for more functions and utilities related to tracking state.
94
+
95
+
87
96
  - Check if a value is `MISSING`
88
97
  ```python
89
- from vt.utils.commons.commons.core_py import MISSING, Missing, is_missing
90
-
91
- def some_operation(arg: Missing = MISSING):
92
- """
93
- ``MISSING`` can be used as a default value sentinel when ``None`` is a valid value for arg.
94
- """
95
- arg = 10 if is_missing(arg) else arg
96
- ...
98
+ from vt.utils.commons.commons.core_py import MISSING, Missing, is_missing
99
+
100
+ def some_operation(arg: Missing = MISSING):
101
+ """
102
+ ``MISSING`` can be used as a default value sentinel when ``None`` is a valid value for arg.
103
+ """
104
+ arg = 10 if is_missing(arg) else arg
105
+ ...
97
106
  ```
98
107
  Check in `vt.utils.commons.commons.core_py` and documentation for more functions and utilities related to function management.
108
+
109
+
99
110
  - Query and operate on iterables
100
111
  ```python
101
- from vt.utils.commons.commons.collections import get_first_true
112
+ from vt.utils.commons.commons.collections import get_first_true
102
113
 
103
- assert 3 == get_first_true([1, 3, 5, 7, 2, 1], 8, lambda x: x>2)
114
+ assert 3 == get_first_true([1, 3, 5, 7, 2, 1], 8, lambda x: x>2)
104
115
  ```
105
116
  Check in `vt.utils.commons.commons.collections` and documentation for more functions and utilities related to collection management.
106
117
 
File without changes
File without changes