pypipr 1.0.75__py3-none-any.whl → 1.0.77__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
@@ -60,4 +60,31 @@ from .ifunctions.iprint import iprint
60
60
  from .ifunctions.irange import irange
61
61
  from .ifunctions.ireplace import ireplace
62
62
  from .ifunctions.iscandir import iscandir
63
- from .ifunctions.isplit import isplit
63
+ from .ifunctions.isplit import isplit
64
+ import colorama
65
+ import datetime
66
+ import functools
67
+ import inspect
68
+ import io
69
+ import json
70
+ import lxml
71
+ import math
72
+ import operator
73
+ import os
74
+ import pathlib
75
+ import pint
76
+ import pprint
77
+ import queue
78
+ import random
79
+ import re
80
+ import requests
81
+ import string
82
+ import subprocess
83
+ import sys
84
+ import textwrap
85
+ import time
86
+ import tzdata
87
+ import uuid
88
+ import webbrowser
89
+ import yaml
90
+ import zoneinfo
@@ -3,9 +3,9 @@ def chunk_array(array, size, start=0):
3
3
  Membagi array menjadi potongan-potongan dengan besaran yg diinginkan
4
4
 
5
5
  ```python
6
- array = [2, 3, 12, 3, 3, 42, 42, 1, 43, 2, 42, 41, 4, 24, 32, 42, 3, 12, 32, 42, 42]
7
- print(chunck_array(array, 5))
8
- print(list(chunck_array(array, 5)))
6
+ arr = [2, 3, 12, 3, 3, 42, 42, 1, 43, 2, 42, 41, 4, 24, 32, 42, 3, 12, 32, 42, 42]
7
+ print(chunk_array(arr, 5))
8
+ print(list(chunk_array(arr, 5)))
9
9
  ```
10
10
  """
11
11
  for i in range(start, len(array), size):
@@ -17,6 +17,7 @@ def get_class_method(cls):
17
17
  return [x for x in range(10)]
18
18
 
19
19
  print(get_class_method(ExampleGetClassMethod))
20
+ print(list(get_class_method(ExampleGetClassMethod)))
20
21
  ```
21
22
  """
22
23
  for x in dir(cls):
@@ -5,10 +5,10 @@ def get_from_index(obj, index, on_error=None):
5
5
 
6
6
  ```python
7
7
  l = [1, 3, 5]
8
- print(pypipr.get_from_index(l, 7))
8
+ print(get_from_index(l, 7))
9
9
  ```
10
10
  """
11
11
  try:
12
12
  return obj[index]
13
- except Exception as e:
13
+ except Exception:
14
14
  return on_error
@@ -9,6 +9,7 @@ def print_dir(var, colorize=True):
9
9
  Print property dan method yang tersedia pada variabel
10
10
 
11
11
  ```python
12
+ import pathlib
12
13
  p = pathlib.Path("https://www.google.com/")
13
14
  print_dir(p, colorize=False)
14
15
  ```
@@ -6,7 +6,7 @@ def print_log(text):
6
6
  Akan melakukan print ke console.
7
7
  Berguna untuk memberikan informasi proses program yg sedang berjalan.
8
8
 
9
- ```py
9
+ ```python
10
10
  print_log("Standalone Log")
11
11
  ```
12
12
  """
@@ -9,7 +9,8 @@ def batch_calculate(pattern):
9
9
 
10
10
 
11
11
  ```python
12
- iprint(batch_calculate("{1 10} m ** {1 3}"))
12
+ print(batch_calculate("{1 10} m ** {1 3}"))
13
+ print(list(batch_calculate("{1 10} m ** {1 3}")))
13
14
  ```
14
15
  """
15
16
  patterns = batchmaker(pattern)
@@ -14,14 +14,14 @@ def iloads(data, syntax="yaml"):
14
14
  data = {
15
15
  'a': 123,
16
16
  't': ['disini', 'senang', 'disana', 'senang'],
17
- 'l': (12, 23, [12, 42])
17
+ 'l': (12, 23, [12, 42]),
18
18
  }
19
19
  s = idumps(data)
20
20
  print(iloads(s))
21
21
  ```
22
22
  """
23
23
  if syntax == "yaml":
24
- return yaml.safe_load(data)
24
+ return yaml.full_load(data)
25
25
  if syntax == "json":
26
26
  return json.load(data)
27
27
  if syntax == "html":
@@ -18,6 +18,7 @@ def iloads_html(html):
18
18
  apabila data berupa table maka dapat dicek type(data) -> html_table
19
19
 
20
20
  ```python
21
+ import pprint
21
22
  pprint.pprint(iloads_html(iopen("https://harga-emas.org/")), depth=10)
22
23
  pprint.pprint(iloads_html(iopen("https://harga-emas.org/1-gram/")), depth=10)
23
24
  ```
@@ -17,6 +17,7 @@ def iprint(
17
17
  Color menggunakan colorama Fore + Back + Style
18
18
 
19
19
  ```python
20
+ import colorama
20
21
  iprint(
21
22
  'yang ini',
22
23
  {'12':12,'sdsd':{'12':21,'as':[88]}},
pypipr/terminal.py CHANGED
@@ -42,7 +42,13 @@ def main():
42
42
  print(f"{i} [{v.default}] : ", end="")
43
43
  o = input()
44
44
  if len(o):
45
- k[i] = eval(o)
45
+ try:
46
+ k[i] = eval(o)
47
+ except Exception:
48
+ pypipr.print_colorize(
49
+ "Input harus dalam syntax python.",
50
+ color=pypipr.colorama.Fore.RED,
51
+ )
46
52
 
47
53
  print()
48
54
  f = f(**k)