pypipr 1.0.74__py3-none-any.whl → 1.0.75__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.
pypipr/__init__.py CHANGED
@@ -15,6 +15,7 @@ from .ibuiltins.filter_empty import filter_empty
15
15
  from .ibuiltins.get_class_method import get_class_method
16
16
  from .ibuiltins.get_filemtime import get_filemtime
17
17
  from .ibuiltins.get_filesize import get_filesize
18
+ from .ibuiltins.get_from_index import get_from_index
18
19
  from .ibuiltins.is_empty import is_empty
19
20
  from .ibuiltins.is_iterable import is_iterable
20
21
  from .ibuiltins.is_valid_url import is_valid_url
@@ -0,0 +1,14 @@
1
+ def get_from_index(obj, index, on_error=None):
2
+ """
3
+ Mendapatkan value dari object berdasarkan indexnya.
4
+ Jika error out of range maka akan mengembalikan on_error.
5
+
6
+ ```python
7
+ l = [1, 3, 5]
8
+ print(pypipr.get_from_index(l, 7))
9
+ ```
10
+ """
11
+ try:
12
+ return obj[index]
13
+ except Exception as e:
14
+ return on_error
pypipr/terminal.py CHANGED
@@ -16,12 +16,12 @@ def main():
16
16
  pypipr.exit_if_empty(len(a))
17
17
 
18
18
  if a.isdigit():
19
- m = m[int(a)]
19
+ m = pypipr.get_from_index(m, int(a))
20
20
  else:
21
21
  m = [v for v in m if v.__contains__(a)]
22
- pypipr.exit_if_empty(m)
23
22
  if len(m) == 1:
24
- m = m[0]
23
+ m = pypipr.get_from_index(m, 0)
24
+ pypipr.exit_if_empty(m)
25
25
  a = None
26
26
 
27
27
  f = getattr(pypipr, m)
@@ -32,10 +32,11 @@ def main():
32
32
 
33
33
  if callable(f):
34
34
  import inspect
35
+
35
36
  s = inspect.signature(f)
36
37
  print(m, end="")
37
38
  pypipr.print_colorize(s)
38
-
39
+
39
40
  k = {}
40
41
  for i, v in s.parameters.items():
41
42
  print(f"{i} [{v.default}] : ", end="")
@@ -49,7 +50,5 @@ def main():
49
50
  pypipr.iprint(f)
50
51
 
51
52
 
52
-
53
-
54
53
  if __name__ == "__main__":
55
54
  main()
@@ -0,0 +1,47 @@
1
+ Metadata-Version: 2.1
2
+ Name: pypipr
3
+ Version: 1.0.75
4
+ Summary: The Python Package Index Project
5
+ Author: ufiapjj
6
+ Author-email: ufiapjj@gmail.com
7
+ Requires-Python: >=3.9
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.9
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Requires-Dist: colorama
14
+ Requires-Dist: cssselect
15
+ Requires-Dist: django
16
+ Requires-Dist: getch ; platform_system == "Linux"
17
+ Requires-Dist: lxml
18
+ Requires-Dist: pint
19
+ Requires-Dist: pyyaml
20
+ Requires-Dist: requests
21
+ Requires-Dist: tzdata
22
+ Description-Content-Type: text/markdown
23
+
24
+
25
+ # About
26
+ The Python Package Index Project (pypipr)
27
+
28
+ pypi : https://pypi.org/project/pypipr
29
+
30
+
31
+ # Setup
32
+ Install with pip
33
+ ```
34
+ pip install pypipr
35
+ ```
36
+
37
+ Then import pypipr
38
+ ```python
39
+ import pypipr
40
+ ```
41
+
42
+ # CONSTANT
43
+
44
+ `LINUX`
45
+
46
+ `WINDOWS`
47
+
@@ -1,4 +1,4 @@
1
- pypipr/__init__.py,sha256=hasiiuE5bwKMir5v7kj09Z7uxAZFaj4lliC_zVQJRqU,2835
1
+ pypipr/__init__.py,sha256=Y86ftq36BtOM0G-TMUjgzLy6g5EpeUfMARmx7nRf2Ls,2888
2
2
  pypipr/ibuiltins/ComparePerformance.py,sha256=fCATdlDgmgiz7QkQNLDMF9VweicesjOaTtfQeBRr64U,2229
3
3
  pypipr/ibuiltins/LINUX.py,sha256=p8OJwS9GCs50pz2UlcbUooPWSZgWmLI67PjcnzDTSWI,100
4
4
  pypipr/ibuiltins/RunParallel.py,sha256=D9QAJr6O6l1yYFv5vypKmboeadAX996gBG9sjpHRkiM,5996
@@ -17,6 +17,7 @@ pypipr/ibuiltins/filter_empty.py,sha256=wJH15cR-bz-pgtWvgkduWpUbIxG7d0R36u_ZGCDf
17
17
  pypipr/ibuiltins/get_class_method.py,sha256=etCD0zHF2BNoQIIrQapo-Pmdp_h-ZRorTa20P3_UmY8,582
18
18
  pypipr/ibuiltins/get_filemtime.py,sha256=e8Glf4p9PJcL2yU8ZbrKOHYB-puaSNQsTS6Qhgp9F9s,227
19
19
  pypipr/ibuiltins/get_filesize.py,sha256=2RCjrdZvaBDCdessFj-h7gLi13rPe6IXJXZcAoywWIA,196
20
+ pypipr/ibuiltins/get_from_index.py,sha256=PEq7-8nKX0uolWSQ32jNKc8YJLhPvyXX5WHknYhvWjQ,351
20
21
  pypipr/ibuiltins/is_empty.py,sha256=eqsH6ATuuOLVVSpIsV_8zTBBibPrWjESu9LCMAv8YyY,683
21
22
  pypipr/ibuiltins/is_iterable.py,sha256=VCzLfFZyQO5qF2wFTVbuZIxyf4BVkflWiRQaOjd9kFs,922
22
23
  pypipr/ibuiltins/is_valid_url.py,sha256=g72vv4_9Zy8dtT0i1JvToRX-mgCzojQCBVHdO1KDwqo,1008
@@ -67,8 +68,8 @@ pypipr/ifunctions/ireplace.py,sha256=RcVMXmbXH_cl4hXpTI5wnuzdPtkatpuZgYsZkfBLAJU
67
68
  pypipr/ifunctions/iscandir.py,sha256=Ev6jus16vOXdNTN9Ia-_35ESplx7N_ZWA0kYoeimXbk,766
68
69
  pypipr/ifunctions/isplit.py,sha256=N2BiA_wVnrENYwokSzvo0CAiQWk3g7AnwuWFIUgevNM,383
69
70
  pypipr/pypipr.py.bak,sha256=HF-ehQd6BY8hm9fRkQHravLNrJRlI5g_AzbCc3dbikQ,1061
70
- pypipr/terminal.py,sha256=g3j9v8nNUTnVXYGt-DtDycjlCcyu8Ul8-ZCurKYGtSU,1213
71
- pypipr-1.0.74.dist-info/METADATA,sha256=bXn4O13PGGfv9QOLrj_90fEVnfZmUB06AVKMVqtft6A,29962
72
- pypipr-1.0.74.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
73
- pypipr-1.0.74.dist-info/entry_points.txt,sha256=ikcrTRCn3jaySem1mM9uhYEPDq2PVOs48CyEqLUkY38,47
74
- pypipr-1.0.74.dist-info/RECORD,,
71
+ pypipr/terminal.py,sha256=4NNTXu8OnDjE5YBCvu_WW7wnqzZMLpeIaabp6SNP9ik,1246
72
+ pypipr-1.0.75.dist-info/METADATA,sha256=GwGtnTkrFomBgghFeBSBztwsl151m8h4HK06dloFdrM,911
73
+ pypipr-1.0.75.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
74
+ pypipr-1.0.75.dist-info/entry_points.txt,sha256=ikcrTRCn3jaySem1mM9uhYEPDq2PVOs48CyEqLUkY38,47
75
+ pypipr-1.0.75.dist-info/RECORD,,