pypipr 1.0.83__py3-none-any.whl → 1.0.85__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pypipr
3
- Version: 1.0.83
3
+ Version: 1.0.85
4
4
  Summary: The Python Package Index Project
5
5
  Author: ufiapjj
6
6
  Author-email: ufiapjj@gmail.com
@@ -45,27 +45,16 @@ import pypipr
45
45
 
46
46
  `WINDOWS`
47
47
 
48
- # FUNCTION
49
-
50
- ## auto_reload
51
-
52
- `auto_reload(filename)`
53
-
54
- Menjalankan file python secara berulang.
55
- Dengan tujuan untuk melihat perubahan secara langsung.
56
- Pastikan kode aman untuk dijalankan.
57
- Jalankan kode ini di terminal console.
48
+ `PintUreg`
58
49
 
59
- ```py
60
- python -m pypipr.iflow.auto_reload file_name.py
61
- ```
50
+ # FUNCTION
62
51
 
63
52
  ## avg
64
53
 
65
54
  `avg(i)`
66
55
 
67
56
  Simple Average Function karena tidak disediakan oleh python
68
-
57
+
69
58
  ```python
70
59
  n = [1, 22, 2, 3, 13, 2, 123, 12, 31, 2, 2, 12, 2, 1]
71
60
  print(avg(n))
@@ -81,7 +70,7 @@ Output:
81
70
  `basename(path)`
82
71
 
83
72
  Mengembalikan nama file dari path
84
-
73
+
85
74
  ```python
86
75
  print(basename("/ini/nama/folder/ke/file.py"))
87
76
  ```
@@ -91,115 +80,12 @@ Output:
91
80
  file.py
92
81
  ```
93
82
 
94
- ## batch_calculate
95
-
96
- `batch_calculate(pattern)`
97
-
98
- Analisa perhitungan massal.
99
- Bisa digunakan untuk mencari alternatif terendah/tertinggi/dsb.
100
-
101
-
102
- ```python
103
- print(batch_calculate("{1 10} m ** {1 3}"))
104
- print(list(batch_calculate("{1 10} m ** {1 3}")))
105
- ```
106
-
107
- Output:
108
- ```py
109
- <generator object batch_calculate at 0x700e3453f0>
110
- [('1 m ** 1', <Quantity(1, 'meter')>), ('1 m ** 2', <Quantity(1, 'meter ** 2')>), ('1 m ** 3', <Quantity(1, 'meter ** 3')>), ('2 m ** 1', <Quantity(2, 'meter')>), ('2 m ** 2', <Quantity(2, 'meter ** 2')>), ('2 m ** 3', <Quantity(2, 'meter ** 3')>), ('3 m ** 1', <Quantity(3, 'meter')>), ('3 m ** 2', <Quantity(3, 'meter ** 2')>), ('3 m ** 3', <Quantity(3, 'meter ** 3')>), ('4 m ** 1', <Quantity(4, 'meter')>), ('4 m ** 2', <Quantity(4, 'meter ** 2')>), ('4 m ** 3', <Quantity(4, 'meter ** 3')>), ('5 m ** 1', <Quantity(5, 'meter')>), ('5 m ** 2', <Quantity(5, 'meter ** 2')>), ('5 m ** 3', <Quantity(5, 'meter ** 3')>), ('6 m ** 1', <Quantity(6, 'meter')>), ('6 m ** 2', <Quantity(6, 'meter ** 2')>), ('6 m ** 3', <Quantity(6, 'meter ** 3')>), ('7 m ** 1', <Quantity(7, 'meter')>), ('7 m ** 2', <Quantity(7, 'meter ** 2')>), ('7 m ** 3', <Quantity(7, 'meter ** 3')>), ('8 m ** 1', <Quantity(8, 'meter')>), ('8 m ** 2', <Quantity(8, 'meter ** 2')>), ('8 m ** 3', <Quantity(8, 'meter ** 3')>), ('9 m ** 1', <Quantity(9, 'meter')>), ('9 m ** 2', <Quantity(9, 'meter ** 2')>), ('9 m ** 3', <Quantity(9, 'meter ** 3')>), ('10 m ** 1', <Quantity(10, 'meter')>), ('10 m ** 2', <Quantity(10, 'meter ** 2')>), ('10 m ** 3', <Quantity(10, 'meter ** 3')>)]
111
- ```
112
-
113
- ## batchmaker
114
-
115
- `batchmaker(pattern: str)`
116
-
117
- Alat Bantu untuk membuat teks yang berulang.
118
- Gunakan `{[start][separator][finish]([separator][step])}`.
119
- ```
120
- [start] dan [finish] -> bisa berupa huruf maupun angka
121
- ([separator][step]) -> bersifat optional
122
- [separator] -> selain huruf dan angka
123
- [step] -> berupa angka positif
124
- ```
125
-
126
- ```python
127
- s = "Urutan {1/6/3} dan {10:9} dan {j k} dan {Z - A - 15} saja."
128
- print(batchmaker(s))
129
- print(list(batchmaker(s)))
130
- ```
131
-
132
- Output:
133
- ```py
134
- <generator object batchmaker at 0x700e49fe20>
135
- ['Urutan 1 dan 10 dan j dan Z saja.', 'Urutan 1 dan 10 dan j dan K saja.', 'Urutan 1 dan 10 dan k dan Z saja.', 'Urutan 1 dan 10 dan k dan K saja.', 'Urutan 1 dan 9 dan j dan Z saja.', 'Urutan 1 dan 9 dan j dan K saja.', 'Urutan 1 dan 9 dan k dan Z saja.', 'Urutan 1 dan 9 dan k dan K saja.', 'Urutan 4 dan 10 dan j dan Z saja.', 'Urutan 4 dan 10 dan j dan K saja.', 'Urutan 4 dan 10 dan k dan Z saja.', 'Urutan 4 dan 10 dan k dan K saja.', 'Urutan 4 dan 9 dan j dan Z saja.', 'Urutan 4 dan 9 dan j dan K saja.', 'Urutan 4 dan 9 dan k dan Z saja.', 'Urutan 4 dan 9 dan k dan K saja.']
136
- ```
137
-
138
- ## calculate
139
-
140
- `calculate(teks)`
141
-
142
- Mengembalikan hasil dari perhitungan teks menggunakan modul pint.
143
- Mendukung perhitungan matematika dasar dengan satuan.
144
-
145
- Return value:
146
- - Berupa class Quantity dari modul pint
147
-
148
- Format:
149
- - f"{result:~P}" -> pretty
150
- - f"{result:~H}" -> html
151
- - result.to_base_units() -> SI
152
- - result.to_compact() -> human readable
153
-
154
- ```python
155
- fx = "3 meter * 10 cm * 3 km"
156
- res = calculate(fx)
157
- print(res)
158
- print(res.to_base_units())
159
- print(res.to_compact())
160
- print(f"{res:~P}")
161
- print(f"{res:~H}")
162
- ```
163
-
164
- Output:
165
- ```py
166
- 90 centimeter * kilometer * meter
167
- 900.0 meter ** 3
168
- 900.0 meter ** 3
169
- 90 cm·km·m
170
- 90 cm km m
171
- ```
172
-
173
- ## choices
174
-
175
- `choices(iterator, title=None, prompt='', default=None)`
176
-
177
- Memudahkan dalam membuat pilihan untuk user dalam tampilan console
178
-
179
- ```py
180
- a = choices("ini hanya satu pilihan")
181
- b = choices(
182
- {
183
- "sedan": "audi",
184
- "suv": "volvo",
185
- "truck": "tesla",
186
- },
187
- title="Car Model",
188
- prompt="Pilih Mobil : ",
189
- )
190
- c = choices(
191
- iscandir(recursive=False),
192
- title="List File dan Folder",
193
- prompt="Pilih File atau Folder : ",
194
- )
195
- ```
196
-
197
83
  ## chunk_array
198
84
 
199
85
  `chunk_array(array, size, start=0)`
200
86
 
201
87
  Membagi array menjadi potongan-potongan dengan besaran yg diinginkan
202
-
88
+
203
89
  ```python
204
90
  arr = [2, 3, 12, 3, 3, 42, 42, 1, 43, 2, 42, 41, 4, 24, 32, 42, 3, 12, 32, 42, 42]
205
91
  print(chunk_array(arr, 5))
@@ -208,28 +94,17 @@ print(list(chunk_array(arr, 5)))
208
94
 
209
95
  Output:
210
96
  ```py
211
- <generator object chunk_array at 0x700e3c4440>
97
+ <generator object chunk_array at 0x79670d4440>
212
98
  [[2, 3, 12, 3, 3], [42, 42, 1, 43, 2], [42, 41, 4, 24, 32], [42, 3, 12, 32, 42], [42]]
213
99
  ```
214
100
 
215
- ## console_run
216
-
217
- `console_run(info, command=None, print_info=True, capture_output=False)`
218
-
219
- Menjalankan command seperti menjalankan command di Command Terminal
220
-
221
- ```py
222
- console_run('dir')
223
- console_run('ls')
224
- ```
225
-
226
101
  ## create_folder
227
102
 
228
103
  `create_folder(folder_name)`
229
104
 
230
105
  Membuat folder.
231
106
  Membuat folder secara recursive dengan permission.
232
-
107
+
233
108
  ```py
234
109
  create_folder("contoh_membuat_folder")
235
110
  create_folder("contoh/membuat/folder/recursive")
@@ -241,7 +116,7 @@ create_folder("./contoh_membuat_folder/secara/recursive")
241
116
  `datetime_from_string(iso_string, timezone='UTC')`
242
117
 
243
118
  Parse iso_string menjadi datetime object
244
-
119
+
245
120
  ```python
246
121
  print(datetime_from_string("2022-12-12 15:40:13").isoformat())
247
122
  print(datetime_from_string(
@@ -261,7 +136,7 @@ Output:
261
136
  `datetime_now(timezone=None)`
262
137
 
263
138
  Memudahkan dalam membuat Datetime untuk suatu timezone tertentu
264
-
139
+
265
140
  ```python
266
141
  print(datetime_now("Asia/Jakarta"))
267
142
  print(datetime_now("GMT"))
@@ -270,9 +145,9 @@ print(datetime_now("Etc/GMT+7"))
270
145
 
271
146
  Output:
272
147
  ```py
273
- 2024-04-23 12:41:20.880670+07:00
274
- 2024-04-23 05:41:20.881117+00:00
275
- 2024-04-22 22:41:20.881802-07:00
148
+ 2024-04-23 18:02:50.654905+07:00
149
+ 2024-04-23 11:02:50.655231+00:00
150
+ 2024-04-23 04:02:50.655801-07:00
276
151
  ```
277
152
 
278
153
  ## dict_first
@@ -280,7 +155,7 @@ Output:
280
155
  `dict_first(d: dict, remove=False)`
281
156
 
282
157
  Mengambil nilai (key, value) pertama dari dictionary dalam bentuk tuple.
283
-
158
+
284
159
  ```python
285
160
  d = {
286
161
  "key2": "value2",
@@ -303,7 +178,7 @@ Output:
303
178
 
304
179
  Mengembalikan nama folder dari path.
305
180
  Tanpa trailing slash di akhir.
306
-
181
+
307
182
  ```python
308
183
  print(dirname("/ini/nama/folder/ke/file.py"))
309
184
  ```
@@ -319,7 +194,7 @@ Output:
319
194
 
320
195
  Keluar dari program apabila seluruh variabel
321
196
  setara dengan empty
322
-
197
+
323
198
  ```py
324
199
  var1 = None
325
200
  var2 = '0'
@@ -331,7 +206,7 @@ exit_if_empty(var1, var2)
331
206
  `filter_empty(iterable, zero_is_empty=True, str_strip=True)`
332
207
 
333
208
  Mengembalikan iterabel yang hanya memiliki nilai
334
-
209
+
335
210
  ```python
336
211
  var = [1, None, False, 0, "0", True, {}, ['eee']]
337
212
  print(filter_empty(var))
@@ -339,7 +214,7 @@ print(filter_empty(var))
339
214
 
340
215
  Output:
341
216
  ```py
342
- <generator object filter_empty at 0x700e3453f0>
217
+ <generator object filter_empty at 0x7967056e30>
343
218
  ```
344
219
 
345
220
  ## get_class_method
@@ -347,29 +222,29 @@ Output:
347
222
  `get_class_method(cls)`
348
223
 
349
224
  Mengembalikan berupa tuple yg berisi list dari method dalam class
350
-
225
+
351
226
  ```python
352
227
  class ExampleGetClassMethod:
353
228
  def a():
354
229
  return [x for x in range(10)]
355
-
230
+
356
231
  def b():
357
232
  return [x for x in range(10)]
358
-
233
+
359
234
  def c():
360
235
  return [x for x in range(10)]
361
-
236
+
362
237
  def d():
363
238
  return [x for x in range(10)]
364
-
239
+
365
240
  print(get_class_method(ExampleGetClassMethod))
366
241
  print(list(get_class_method(ExampleGetClassMethod)))
367
242
  ```
368
243
 
369
244
  Output:
370
245
  ```py
371
- <generator object get_class_method at 0x700e347100>
372
- [<function ExampleGetClassMethod.a at 0x700e3e0fe0>, <function ExampleGetClassMethod.b at 0x700e3e1260>, <function ExampleGetClassMethod.c at 0x700e3e11c0>, <function ExampleGetClassMethod.d at 0x700e3e1120>]
246
+ <generator object get_class_method at 0x7967057100>
247
+ [<function ExampleGetClassMethod.a at 0x79670313a0>, <function ExampleGetClassMethod.b at 0x79779b6c00>, <function ExampleGetClassMethod.c at 0x79670f1580>, <function ExampleGetClassMethod.d at 0x79670f1620>]
373
248
  ```
374
249
 
375
250
  ## get_filemtime
@@ -377,7 +252,7 @@ Output:
377
252
  `get_filemtime(filename)`
378
253
 
379
254
  Mengambil informasi last modification time file dalam nano seconds
380
-
255
+
381
256
  ```python
382
257
  print(get_filemtime(__file__))
383
258
  ```
@@ -392,7 +267,7 @@ Output:
392
267
  `get_filesize(filename)`
393
268
 
394
269
  Mengambil informasi file size dalam bytes
395
-
270
+
396
271
  ```python
397
272
  print(get_filesize(__file__))
398
273
  ```
@@ -408,7 +283,7 @@ Output:
408
283
 
409
284
  Mendapatkan value dari object berdasarkan indexnya.
410
285
  Jika error out of range maka akan mengembalikan on_error.
411
-
286
+
412
287
  ```python
413
288
  l = [1, 3, 5]
414
289
  print(get_from_index(l, 7))
@@ -419,509 +294,343 @@ Output:
419
294
  None
420
295
  ```
421
296
 
422
- ## github_pull
423
-
424
- `github_pull()`
297
+ ## is_empty
425
298
 
426
- Menjalankan command `git pull`
299
+ `is_empty(variable, empty=[None, False, 0, 0, '0', '', '-0', '\n', '\t', set(), {}, [], ()])`
427
300
 
428
- ```py
429
- github_pull()
301
+ Mengecek apakah variable setara dengan nilai kosong pada empty.
302
+
303
+ Pengecekan nilai yang setara menggunakan simbol '==', sedangkan untuk
304
+ pengecekan lokasi memory yang sama menggunakan keyword 'is'
305
+
306
+ ```python
307
+ print(is_empty("teks"))
308
+ print(is_empty(True))
309
+ print(is_empty(False))
310
+ print(is_empty(None))
311
+ print(is_empty(0))
312
+ print(is_empty([]))
430
313
  ```
431
314
 
432
- ## github_push
433
-
434
- `github_push(commit_msg=None)`
435
-
436
- Menjalankan command status, add, commit dan push
437
-
438
- ```py
439
- github_push('Commit Message')
315
+ Output:
316
+ ```py
317
+ False
318
+ False
319
+ True
320
+ True
321
+ True
322
+ True
440
323
  ```
441
324
 
442
- ## github_user
443
-
444
- `github_user(email=None, name=None)`
325
+ ## is_iterable
445
326
 
446
- Menyimpan email dan nama user secara global sehingga tidak perlu
447
- menginput nya setiap saat.
327
+ `is_iterable(var, str_is_iterable=False)`
448
328
 
449
- ```py
450
- github_user('my@emil.com', 'MyName')
329
+ Mengecek apakah suatu variabel bisa dilakukan forloop atau tidak
330
+
331
+ ```python
332
+ s = 'ini string'
333
+ print(is_iterable(s))
334
+
335
+ l = [12,21,2,1]
336
+ print(is_iterable(l))
337
+
338
+ r = range(100)
339
+ print(is_iterable(r))
340
+
341
+ d = {'a':1, 'b':2}
342
+ print(is_iterable(d.values()))
451
343
  ```
452
344
 
453
- ## iargv
454
-
455
- `iargv(key: int, cast=None, on_error=None)`
456
-
457
- ## idumps
345
+ Output:
346
+ ```py
347
+ False
348
+ True
349
+ True
350
+ True
351
+ ```
458
352
 
459
- `idumps(data, syntax='yaml', indent=4)`
353
+ ## is_valid_url
460
354
 
461
- Mengubah variabel data menjadi string untuk yang dapat dibaca untuk disimpan.
462
- String yang dihasilkan berbentuk syntax YAML/JSON/HTML.
355
+ `is_valid_url(path)`
463
356
 
357
+ Mengecek apakah path merupakan URL yang valid atau tidak.
358
+ Cara ini merupakan cara yang paling efektif.
359
+
464
360
  ```python
465
- data = {
466
- 'a': 123,
467
- 't': ['disini', 'senang', 'disana', 'senang'],
468
- 'l': (12, 23, [12, 42]),
469
- }
470
- print(idumps(data))
471
- print(idumps(data, syntax='html'))
361
+ print(is_valid_url("https://chat.openai.com/?model=text-davinci-002-render-sha"))
362
+ print(is_valid_url("https://chat.openai.com/?model/=text-dav/inci-002-render-sha"))
472
363
  ```
473
364
 
474
365
  Output:
475
366
  ```py
476
- a: 123
477
- l: !!python/tuple
478
- - 12
479
- - 23
480
- - - 12
481
- - 42
482
- t:
483
- - disini
484
- - senang
485
- - disana
486
- - senang
367
+ True
368
+ True
369
+ ```
487
370
 
488
- <table>
489
- <tbody>
490
- <tr>
491
- <th>a</th>
492
- <td>
493
- <span>123</span>
494
- </td>
495
- </tr>
496
- <tr>
497
- <th>t</th>
498
- <td>
499
- <ul>
500
- <li>
501
- <span>disini</span>
502
- </li>
503
- <li>
504
- <span>senang</span>
505
- </li>
506
- <li>
507
- <span>disana</span>
508
- </li>
509
- <li>
510
- <span>senang</span>
511
- </li>
512
- </ul>
513
- </td>
514
- </tr>
515
- <tr>
516
- <th>l</th>
517
- <td>
518
- <ul>
519
- <li>
520
- <span>12</span>
521
- </li>
522
- <li>
523
- <span>23</span>
524
- </li>
525
- <li>
526
- <ul>
527
- <li>
528
- <span>12</span>
529
- </li>
530
- <li>
531
- <span>42</span>
532
- </li>
533
- </ul>
534
- </li>
535
- </ul>
536
- </td>
537
- </tr>
538
- </tbody>
539
- </table>
371
+ ## ivars
372
+
373
+ `ivars(obj, skip_underscore=True)`
540
374
 
375
+ Membuat dictionary berdasarkan kategori untuk setiap
376
+ member dari object.
377
+
378
+ ```python
379
+ iprint(ivars(__import__('pypipr')))
541
380
  ```
542
381
 
543
- ## idumps_html
382
+ Output:
383
+ ```py
384
+ {'module': {'ibuiltins': <module 'pypipr.ibuiltins' from '/data/data/com.termux/files/home/pypipr/pypipr/ibuiltins/__init__.py'>,
385
+ 'iconsole': <module 'pypipr.iconsole' from '/data/data/com.termux/files/home/pypipr/pypipr/iconsole/__init__.py'>,
386
+ 'idjango': <module 'pypipr.idjango' from '/data/data/com.termux/files/home/pypipr/pypipr/idjango/__init__.py'>,
387
+ 'iengineering': <module 'pypipr.iengineering' from '/data/data/com.termux/files/home/pypipr/pypipr/iengineering/__init__.py'>,
388
+ 'ifunctions': <module 'pypipr.ifunctions' from '/data/data/com.termux/files/home/pypipr/pypipr/ifunctions/__init__.py'>,
389
+ 'iflow': <module 'pypipr.iflow' (<_frozen_importlib_external.NamespaceLoader object at 0x7974167690>)>,
390
+ 'asyncio': <module 'asyncio' from '/data/data/com.termux/files/usr/lib/python3.11/asyncio/__init__.py'>,
391
+ 'colorama': <module 'colorama' from '/data/data/com.termux/files/usr/lib/python3.11/site-packages/colorama/__init__.py'>,
392
+ 'datetime': <module 'datetime' from '/data/data/com.termux/files/usr/lib/python3.11/datetime.py'>,
393
+ 'functools': <module 'functools' from '/data/data/com.termux/files/usr/lib/python3.11/functools.py'>,
394
+ 'inspect': <module 'inspect' from '/data/data/com.termux/files/usr/lib/python3.11/inspect.py'>,
395
+ 'io': <module 'io' (frozen)>,
396
+ 'json': <module 'json' from '/data/data/com.termux/files/usr/lib/python3.11/json/__init__.py'>,
397
+ 'lxml': <module 'lxml' from '/data/data/com.termux/files/usr/lib/python3.11/site-packages/lxml/__init__.py'>,
398
+ 'math': <module 'math' from '/data/data/com.termux/files/usr/lib/python3.11/lib-dynload/math.cpython-311.so'>,
399
+ 'multiprocessing': <module 'multiprocessing' from '/data/data/com.termux/files/usr/lib/python3.11/multiprocessing/__init__.py'>,
400
+ 'operator': <module 'operator' from '/data/data/com.termux/files/usr/lib/python3.11/operator.py'>,
401
+ 'os': <module 'os' (frozen)>,
402
+ 'pathlib': <module 'pathlib' from '/data/data/com.termux/files/usr/lib/python3.11/pathlib.py'>,
403
+ 'pint': <module 'pint' from '/data/data/com.termux/files/usr/lib/python3.11/site-packages/pint/__init__.py'>,
404
+ 'pprint': <module 'pprint' from '/data/data/com.termux/files/usr/lib/python3.11/pprint.py'>,
405
+ 'queue': <module 'queue' from '/data/data/com.termux/files/usr/lib/python3.11/queue.py'>,
406
+ 'random': <module 'random' from '/data/data/com.termux/files/usr/lib/python3.11/random.py'>,
407
+ 're': <module 're' from '/data/data/com.termux/files/usr/lib/python3.11/re/__init__.py'>,
408
+ 'requests': <module 'requests' from '/data/data/com.termux/files/usr/lib/python3.11/site-packages/requests/__init__.py'>,
409
+ 'string': <module 'string' from '/data/data/com.termux/files/usr/lib/python3.11/string.py'>,
410
+ 'subprocess': <module 'subprocess' from '/data/data/com.termux/files/usr/lib/python3.11/subprocess.py'>,
411
+ 'sys': <module 'sys' (built-in)>,
412
+ 'textwrap': <module 'textwrap' from '/data/data/com.termux/files/usr/lib/python3.11/textwrap.py'>,
413
+ 'threading': <module 'threading' from '/data/data/com.termux/files/usr/lib/python3.11/threading.py'>,
414
+ 'time': <module 'time' (built-in)>,
415
+ 'tzdata': <module 'tzdata' from '/data/data/com.termux/files/usr/lib/python3.11/site-packages/tzdata/__init__.py'>,
416
+ 'uuid': <module 'uuid' from '/data/data/com.termux/files/usr/lib/python3.11/uuid.py'>,
417
+ 'webbrowser': <module 'webbrowser' from '/data/data/com.termux/files/usr/lib/python3.11/webbrowser.py'>,
418
+ 'yaml': <module 'yaml' from '/data/data/com.termux/files/usr/lib/python3.11/site-packages/yaml/__init__.py'>,
419
+ 'zoneinfo': <module 'zoneinfo' from '/data/data/com.termux/files/usr/lib/python3.11/zoneinfo/__init__.py'>},
420
+ 'class': {'ComparePerformance': <class 'pypipr.ibuiltins.ComparePerformance.ComparePerformance'>,
421
+ 'RunParallel': <class 'pypipr.ibuiltins.RunParallel.RunParallel'>,
422
+ 'APIMixinView': <class 'pypipr.idjango.APIMixinView.APIMixinView'>,
423
+ 'PintUregQuantity': <class 'pint.Quantity'>},
424
+ 'variable': {'LINUX': True,
425
+ 'WINDOWS': False,
426
+ 'PintUreg': <pint.registry.UnitRegistry object at 0x7974d973d0>},
427
+ 'function': {'avg': <function avg at 0x79779b6d40>,
428
+ 'basename': <function basename at 0x7977986a20>,
429
+ 'chunk_array': <function chunk_array at 0x7974cd1120>,
430
+ 'create_folder': <function create_folder at 0x7974cd1300>,
431
+ 'datetime_from_string': <function datetime_from_string at 0x7974cd14e0>,
432
+ 'datetime_now': <function datetime_now at 0x7974d7a160>,
433
+ 'dict_first': <function dict_first at 0x7974d7a0c0>,
434
+ 'dirname': <function dirname at 0x7974d7a020>,
435
+ 'exit_if_empty': <function exit_if_empty at 0x7974d534c0>,
436
+ 'filter_empty': <function filter_empty at 0x7974d79d00>,
437
+ 'get_class_method': <function get_class_method at 0x7974d798a0>,
438
+ 'get_filemtime': <function get_filemtime at 0x7974d79800>,
439
+ 'get_filesize': <function get_filesize at 0x7974d79620>,
440
+ 'get_from_index': <function get_from_index at 0x7974d794e0>,
441
+ 'is_empty': <function is_empty at 0x7974d79da0>,
442
+ 'is_iterable': <function is_iterable at 0x7974d7a200>,
443
+ 'is_valid_url': <function is_valid_url at 0x7974d793a0>,
444
+ 'ivars': <function ivars at 0x7974d79300>,
445
+ 'password_generator': <function password_generator at 0x7974d791c0>,
446
+ 'random_bool': <function random_bool at 0x7974d78d60>,
447
+ 'set_timeout': <function set_timeout at 0x7974d7b7e0>,
448
+ 'sets_ordered': <function sets_ordered at 0x7974d7b920>,
449
+ 'str_cmp': <function str_cmp at 0x7974d7b9c0>,
450
+ 'to_str': <function to_str at 0x7974d79bc0>,
451
+ 'choices': <function choices at 0x7974d7ba60>,
452
+ 'console_run': <function console_run at 0x7974d7bce0>,
453
+ 'input_char': <function input_char at 0x7974d7be20>,
454
+ 'log': <function log at 0x7974d9c040>,
455
+ 'print_colorize': <function print_colorize at 0x7974d9c0e0>,
456
+ 'print_dir': <function print_dir at 0x7974d9c220>,
457
+ 'print_log': <function print_log at 0x7974d7bec0>,
458
+ 'print_to_last_line': <function print_to_last_line at 0x7974d7bc40>,
459
+ 'text_colorize': <function text_colorize at 0x7974d7bd80>,
460
+ 'batch_calculate': <function batch_calculate at 0x796af39580>,
461
+ 'batchmaker': <function batchmaker at 0x796af1e980>,
462
+ 'calculate': <function calculate at 0x796af3a2a0>,
463
+ 'auto_reload': <function auto_reload at 0x796af3a480>,
464
+ 'github_pull': <function github_pull at 0x796af3a020>,
465
+ 'github_push': <function github_push at 0x796af3a700>,
466
+ 'github_user': <function github_user at 0x796af3aa20>,
467
+ 'pip_freeze_without_version': <function pip_freeze_without_version at 0x796ac71f80>,
468
+ 'poetry_publish': <function poetry_publish at 0x796ac72160>,
469
+ 'poetry_update_version': <function poetry_update_version at 0x796ac96980>,
470
+ 'iargv': <function iargv at 0x79672bc0e0>,
471
+ 'idumps': <function idumps at 0x79672bc220>,
472
+ 'idumps_html': <function idumps_html at 0x7967320c20>,
473
+ 'ienv': <function ienv at 0x79672bc360>,
474
+ 'iexec': <function iexec at 0x7967320ea0>,
475
+ 'ijoin': <function ijoin at 0x796ac71ee0>,
476
+ 'iloads': <function iloads at 0x7967320f40>,
477
+ 'iloads_html': <function iloads_html at 0x79673211c0>,
478
+ 'iopen': <function iopen at 0x796ac72200>,
479
+ 'iprint': <function iprint at 0x79672bc180>,
480
+ 'irange': <function irange at 0x796af3a3e0>,
481
+ 'ireplace': <function ireplace at 0x7967321080>,
482
+ 'iscandir': <function iscandir at 0x7967322e80>,
483
+ 'isplit': <function isplit at 0x7967322f20>}}
484
+ ```
544
485
 
545
- `idumps_html(data, indent=None)`
486
+ ## password_generator
546
487
 
547
- Serialisasi python variabel menjadi HTML.
548
- ```
549
- List -> <ul>...</ul>
550
- Dict -> <table>...</table>
551
- ```
488
+ `password_generator(length=8, characters='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~')`
552
489
 
490
+ Membuat pssword secara acak
491
+
553
492
  ```python
554
- data = {
555
- 'abc': 123,
556
- 'list': [1, 2, 3, 4, 5],
557
- 'dict': {'a': 1, 'b':2, 'c':3},
558
- }
559
- print(idumps_html(data))
493
+ print(password_generator())
560
494
  ```
561
495
 
562
496
  Output:
563
497
  ```py
564
- <table>
565
- <tbody>
566
- <tr>
567
- <th>abc</th>
568
- <td>
569
- <span>123</span>
570
- </td>
571
- </tr>
572
- <tr>
573
- <th>list</th>
574
- <td>
575
- <ul>
576
- <li>
577
- <span>1</span>
578
- </li>
579
- <li>
580
- <span>2</span>
581
- </li>
582
- <li>
583
- <span>3</span>
584
- </li>
585
- <li>
586
- <span>4</span>
587
- </li>
588
- <li>
589
- <span>5</span>
590
- </li>
591
- </ul>
592
- </td>
593
- </tr>
594
- <tr>
595
- <th>dict</th>
596
- <td>
597
- <table>
598
- <tbody>
599
- <tr>
600
- <th>a</th>
601
- <td>
602
- <span>1</span>
603
- </td>
604
- </tr>
605
- <tr>
606
- <th>b</th>
607
- <td>
608
- <span>2</span>
609
- </td>
610
- </tr>
611
- <tr>
612
- <th>c</th>
613
- <td>
614
- <span>3</span>
615
- </td>
616
- </tr>
617
- </tbody>
618
- </table>
619
- </td>
620
- </tr>
621
- </tbody>
622
- </table>
623
-
498
+ f]@vt^%Z
624
499
  ```
625
500
 
626
- ## ienv
501
+ ## random_bool
627
502
 
628
- `ienv(on_windows=None, on_linux=None)`
503
+ `random_bool()`
629
504
 
630
- Mengambalikan hasil berdasarkan environment dimana program dijalankan
505
+ Menghasilkan nilai random True atau False.
506
+ Fungsi ini merupakan fungsi tercepat untuk mendapatkan random bool.
507
+ Fungsi ini sangat cepat, tetapi pemanggilan fungsi ini membutuhkan
508
+ overhead yg besar.
509
+
510
+ ```python
511
+ print(random_bool())
512
+ ```
631
513
 
632
- ```py
633
- getch = __import__(ienv(on_windows="msvcrt", on_linux="getch"))
514
+ Output:
515
+ ```py
516
+ False
517
+ ```
634
518
 
635
- inherit = ienv(
636
- on_windows=[BaseForWindows, BaseEnv, object],
637
- on_linux=[SpecialForLinux, BaseForLinux, BaseEnv, object]
638
- )
519
+ ## set_timeout
639
520
 
640
- class ExampleIEnv(*inherit):
641
- pass
521
+ `set_timeout(interval, func, args=None, kwargs=None)`
522
+
523
+ Menjalankan fungsi ketika sudah sekian detik.
524
+ Apabila timeout masih berjalan tapi kode sudah selesai dieksekusi semua, maka
525
+ program tidak akan berhenti sampai timeout selesai, kemudian fungsi dijalankan,
526
+ kemudian program dihentikan.
527
+
528
+ ```python
529
+ set_timeout(3, lambda: print("Timeout 3"))
530
+ x = set_timeout(7, print, args=["Timeout 7"])
531
+ print(x)
532
+ print("menghentikan timeout 7")
533
+ x.cancel()
642
534
  ```
643
535
 
644
- ## iexec
536
+ Output:
537
+ ```py
538
+ <Timer(Thread-2, started 521401433328)>
539
+ menghentikan timeout 7
540
+ ```
645
541
 
646
- `iexec(python_syntax, import_pypipr=True)`
542
+ ## sets_ordered
647
543
 
648
- improve exec() python function untuk mendapatkan outputnya
544
+ `sets_ordered(iterator)`
649
545
 
546
+ Hanya mengambil nilai unik dari suatu list
547
+
650
548
  ```python
651
- print(iexec('print(9*9)'))
549
+ array = [2, 3, 12, 3, 3, 42, 42, 1, 43, 2, 42, 41, 4, 24, 32, 42, 3, 12, 32, 42, 42]
550
+ print(sets_ordered(array))
551
+ print(list(sets_ordered(array)))
652
552
  ```
653
553
 
654
554
  Output:
655
555
  ```py
656
- 81
657
-
556
+ <generator object sets_ordered at 0x79670f8110>
557
+ [2, 3, 12, 42, 1, 43, 41, 4, 24, 32]
658
558
  ```
659
559
 
660
- ## ijoin
661
-
662
- `ijoin(iterable, separator='', start='', end='', remove_empty=False, recursive=True, recursive_flat=False, str_strip=False)`
560
+ ## str_cmp
663
561
 
664
- Simplify Python join functions like PHP function.
665
- Iterable bisa berupa sets, tuple, list, dictionary.
562
+ `str_cmp(t1, t2)`
666
563
 
564
+ Membandingakan string secara incase-sensitive menggunakan lower().
565
+ Lebih cepat dibandingkan upper(), casefold(), re.fullmatch(), len().
566
+ perbandingan ini sangat cepat, tetapi pemanggilan fungsi ini membutuhkan
567
+ overhead yg besar.
568
+
667
569
  ```python
668
- arr = {'asd','dfs','weq','qweqw'}
669
- print(ijoin(arr, ', '))
670
-
671
- arr = '/ini/path/seperti/url/'.split('/')
672
- print(ijoin(arr, ','))
673
- print(ijoin(arr, ',', remove_empty=True))
674
-
675
- arr = {'a':'satu', 'b':(12, 34, 56), 'c':'tiga', 'd':'empat'}
676
- print(ijoin(arr, separator='</li>\n<li>', start='<li>', end='</li>',
677
- recursive_flat=True))
678
- print(ijoin(arr, separator='</div>\n<div>', start='<div>', end='</div>'))
679
- print(ijoin(10, ' '))
570
+ print(str_cmp('teks1', 'Teks1'))
680
571
  ```
681
572
 
682
573
  Output:
683
574
  ```py
684
- weq, asd, dfs, qweqw
685
- ,ini,path,seperti,url,
686
- ini,path,seperti,url
687
- <li>satu</li>
688
- <li>12</li>
689
- <li>34</li>
690
- <li>56</li>
691
- <li>tiga</li>
692
- <li>empat</li>
693
- <div>satu</div>
694
- <div><div>12</div>
695
- <div>34</div>
696
- <div>56</div></div>
697
- <div>tiga</div>
698
- <div>empat</div>
699
- 10
575
+ True
700
576
  ```
701
577
 
702
- ## iloads
703
-
704
- `iloads(data, syntax='yaml')`
578
+ ## to_str
705
579
 
706
- Mengubah string data hasil dari idumps menjadi variabel.
707
- String data adalah berupa syntax YAML.
580
+ `to_str(value)`
708
581
 
582
+ Mengubah value menjadi string literal
583
+
709
584
  ```python
710
- data = {
711
- 'a': 123,
712
- 't': ['disini', 'senang', 'disana', 'senang'],
713
- 'l': (12, 23, [12, 42]),
714
- }
715
- s = idumps(data)
716
- print(iloads(s))
585
+ print(to_str(5))
586
+ print(to_str([]))
587
+ print(to_str(False))
588
+ print(to_str(True))
589
+ print(to_str(None))
717
590
  ```
718
591
 
719
592
  Output:
720
593
  ```py
721
- {'a': 123, 'l': (12, 23, [12, 42]), 't': ['disini', 'senang', 'disana', 'senang']}
722
- ```
594
+ 5
723
595
 
724
- ## iloads_html
596
+ False
597
+ True
725
598
 
726
- `iloads_html(html)`
599
+ ```
727
600
 
728
- Mengambil data yang berupa list `<ul>`, dan table `<table>` dari html
729
- dan menjadikannya data python berupa list.
730
- setiap data yang ditemukan akan dibungkus dengan tuple sebagai separator.
731
- ```
732
- list (<ul>) -> list -> list satu dimensi
733
- table (<table>) -> list[list] -> list satu dimensi didalam list
734
- ```
735
- apabila data berupa ul maka dapat dicek type(data) -> html_ul
736
- apabila data berupa ol maka dapat dicek type(data) -> html_ol
737
- apabila data berupa dl maka dapat dicek type(data) -> html_dl
738
- apabila data berupa table maka dapat dicek type(data) -> html_table
601
+ ## choices
739
602
 
740
- ```python
741
- import pprint
742
- pprint.pprint(iloads_html(iopen("https://harga-emas.org/")), depth=10)
743
- pprint.pprint(iloads_html(iopen("https://harga-emas.org/1-gram/")), depth=10)
603
+ `choices(iterator, title=None, prompt='', default=None)`
604
+
605
+ Memudahkan dalam membuat pilihan untuk user dalam tampilan console
606
+
607
+ ```py
608
+ a = choices("ini hanya satu pilihan")
609
+ b = choices(
610
+ {
611
+ "sedan": "audi",
612
+ "suv": "volvo",
613
+ "truck": "tesla",
614
+ },
615
+ title="Car Model",
616
+ prompt="Pilih Mobil : ",
617
+ )
618
+ c = choices(
619
+ iscandir(recursive=False),
620
+ title="List File dan Folder",
621
+ prompt="Pilih File atau Folder : ",
622
+ )
744
623
  ```
745
624
 
746
- Output:
747
- ```py
748
- (['Home', 'Emas 1 Gram', 'History', 'Trend', 'Perak 1 Gram', 'Pluang'],
749
- [['Harga Emas Hari Ini - Selasa, 23 April 2024'],
750
- ['Spot Emas USD↓2.309,06 (-21,07) / oz',
751
- 'Kurs IDR↓16.224,00 (-56,00) / USD',
752
- 'Emas IDR↓1.204.437 (-15.186) / gr'],
753
- ['LM Antam (Jual)↓1.325.000 (-18.000) / gr',
754
- 'LM Antam (Beli)↓1.223.000 (-15.000) / gr']],
755
- [['Harga Emas Hari Ini'],
756
- ['Gram', 'Gedung Antam Jakarta', 'Pegadaian'],
757
- ['per Gram (Rp)', 'per Batangan (Rp)', 'per Gram (Rp)', 'per Batangan (Rp)'],
758
- ['1000',
759
- '1.266 (-18)',
760
- '1.265.600 (-18.000)',
761
- '1.043.040 (+8.200)',
762
- '1.043.040.000 (+8.200.000)'],
763
- ['500',
764
- '2.531 (-36)',
765
- '1.265.640 (-18.000)',
766
- '1.043.082 (+8.200)',
767
- '521.541.000 (+4.100.000)'],
768
- ['250',
769
- '5.064 (-72)',
770
- '1.266.060 (-18.000)',
771
- '1.043.512 (+8.200)',
772
- '260.878.000 (+2.050.000)'],
773
- ['100',
774
- '12.671 (-180)',
775
- '1.267.120 (-18.000)',
776
- '1.044.600 (+8.200)',
777
- '104.460.000 (+820.000)'],
778
- ['50',
779
- '25.358 (-360)',
780
- '1.267.900 (-18.000)',
781
- '1.045.400 (+8.200)',
782
- '52.270.000 (+410.000)'],
783
- ['25',
784
- '50.779 (-720)',
785
- '1.269.480 (-18.000)',
786
- '1.047.040 (+8.200)',
787
- '26.176.000 (+205.000)'],
788
- ['10',
789
- '127.450 (-1.800)',
790
- '1.274.500 (-18.000)',
791
- '1.052.200 (+8.200)',
792
- '10.522.000 (+82.000)'],
793
- ['5',
794
- '256.000 (-3.600)',
795
- '1.280.000 (-18.000)',
796
- '1.057.800 (+8.200)',
797
- '5.289.000 (+41.000)'],
798
- ['3',
799
- '428.889 (-6.000)',
800
- '1.286.667 (-18.000)',
801
- '1.064.667 (+8.000)',
802
- '3.194.000 (+24.000)'],
803
- ['2',
804
- '647.500 (-9.000)',
805
- '1.295.000 (-18.000)',
806
- '1.073.500 (+8.500)',
807
- '2.147.000 (+17.000)'],
808
- ['1',
809
- '1.325.000 (-18.000)',
810
- '1.325.000 (-18.000)',
811
- '1.104.000 (+8.000)',
812
- '1.104.000 (+8.000)'],
813
- ['0.5',
814
- '2.850.000 (-36.000)',
815
- '1.425.000 (-18.000)',
816
- '1.208.000 (+8.000)',
817
- '604.000 (+4.000)'],
818
- ['Update harga LM Antam :23 April 2024, pukul 07:56Harga pembelian kembali '
819
- ':Rp. 1.223.000/gram (-15.000)',
820
- 'Update harga LM Pegadaian :31 Agustus 2023']],
821
- [['Spot Harga Emas Hari Ini (Market Open)'],
822
- ['Satuan', 'USD', 'Kurs\xa0Dollar', 'IDR'],
823
- ['Ounce\xa0(oz)', '2.309,06 (-21,07)', '16.224,00 (-56,00)', '37.462.189'],
824
- ['Gram\xa0(gr)', '74,24', '16.224,00', '1.204.437 (-15.186)'],
825
- ['Kilogram\xa0(kg)', '74.238,00', '16.224,00', '1.204.437.360'],
826
- ['Update harga emas :23 April 2024, pukul 12:41Update kurs :23 April 2024, '
827
- 'pukul 09:10']],
828
- [['Gram', 'UBS Gold 99.99%'],
829
- ['Jual', 'Beli'],
830
- ['/ Batang', '/ Gram', '/ Batang', '/ Gram'],
831
- ['100',
832
- '126.712.000 (-1.488.000)',
833
- '1.267.120 (-14.880)',
834
- '123.685.000 (-3.400.000)',
835
- '1.236.850 (-34.000)'],
836
- ['50',
837
- '63.395.000 (-855.000)',
838
- '1.267.900 (-17.100)',
839
- '61.895.000 (-1.700.000)',
840
- '1.237.900 (-34.000)'],
841
- ['25',
842
- '31.737.000 (-413.000)',
843
- '1.269.480 (-16.520)',
844
- '31.050.000 (-850.000)',
845
- '1.242.000 (-34.000)'],
846
- ['10',
847
- '12.745.000 (-165.000)',
848
- '1.274.500 (-16.500)',
849
- '12.470.000 (-340.000)',
850
- '1.247.000 (-34.000)'],
851
- ['5',
852
- '6.400.000 (-80.000)',
853
- '1.280.000 (-16.000)',
854
- '6.287.000 (-170.000)',
855
- '1.257.400 (-34.000)'],
856
- ['1',
857
- '1.325.000 (-15.000)',
858
- '1.325.000 (-15.000)',
859
- '1.290.000 (-34.000)',
860
- '1.290.000 (-34.000)'],
861
- ['', 'Update :23 April 2024, pukul 11:31']],
862
- [['Konversi Satuan'],
863
- ['Satuan', 'Ounce (oz)', 'Gram (gr)', 'Kilogram (kg)'],
864
- ['Ounce\xa0(oz)', '1', '31,1034767696', '0,0311034768'],
865
- ['Gram\xa0(gr)', '0,0321507466', '1', '0.001'],
866
- ['Kilogram\xa0(kg)', '32,1507466000', '1.000', '1']],
867
- [['Pergerakan Harga Emas Dunia'],
868
- ['Waktu', 'Emas'],
869
- ['Unit', 'USD', 'IDR'],
870
- ['Angka', '+/-', 'Angka', '+/-'],
871
- ['Hari Ini', 'Kurs', '', '', '16.280', '-56-0,34%'],
872
- ['oz', '2.330,13', '-21,07-0,90%', '37.934.516', '-472.327-1,25%'],
873
- ['gr', '74,92', '-0,68-0,90%', '1.219.623', '-15.186-1,25%'],
874
- ['30 Hari', 'Kurs', '', '', '15.662', '+562+3,59%'],
875
- ['oz', '2.165,64', '+143,42+6,62%', '33.918.254', '+3.543.936+10,45%'],
876
- ['gr', '69,63', '+4,61+6,62%', '1.090.497', '+113.940+10,45%'],
877
- ['2 Bulan', 'Kurs', '', '', '15.630', '+594+3,80%'],
878
- ['oz', '2.038,19', '+270,87+13,29%', '31.856.910', '+5.605.280+17,60%'],
879
- ['gr', '65,53', '+8,71+13,29', '1.024.223', '+180.214+17,60%'],
880
- ['6 Bulan', 'Kurs', '', '', '15.871', '+353+2,22%'],
881
- ['oz', '1.984,00', '+325,06+16,38%', '31.488.064', '+5.974.125+18,97%'],
882
- ['gr', '63,79', '+10,45+16,38%', '1.012.365', '+192.073+18,97%'],
883
- ['1 Tahun', 'Kurs', '', '', '15.731', '+493+3,13%'],
884
- ['oz', '1.823,86', '+485,20+26,60%', '28.691.142', '+8.771.048+30,57%'],
885
- ['gr', '58,64', '+15,60+26,60%', '922.442', '+281.996+30,57%'],
886
- ['2 Tahun', 'Kurs', '', '', '14.348', '+1.876+13,07%'],
887
- ['oz', '1.931,96', '+377,10+19,52%', '27.719.762', '+9.742.427+35,15%'],
888
- ['gr', '62,11', '+12,12+19,52%', '891.211', '+313.226+35,15%'],
889
- ['3 Tahun', 'Kurs', '', '', '14.530', '+1.694+11,66%'],
890
- ['oz', '1.777,11', '+531,95+29,93%', '25.821.408', '+11.640.781+45,08%'],
891
- ['gr', '57,14', '+17,10+29,93%', '830.178', '+374.260+45,08%'],
892
- ['5 Tahun', 'Kurs', '', '', '14.154', '+2.070+14,62%'],
893
- ['oz', '1.277,64', '+1.031,42+80,73%', '18.083.717', '+19.378.473+107,16%'],
894
- ['gr', '41,08', '+33,16+80,73%', '581.405', '+623.032+107,16%']])
895
- (['Home', 'Emas 1 Gram', 'History', 'Trend', 'Perak 1 Gram', 'Pluang'],
896
- [[''],
897
- ['Emas 24 KaratHarga Emas 1 Gram', ''],
898
- ['USD', '74,24↓', '-0,68-0,91%'],
899
- ['KURS', '16.233,90↓', '-12,45-0,08%'],
900
- ['IDR', '1.205.172,32↓', '-11.929,80-0,98%'],
901
- ['Selasa, 23 April 2024 12:41']],
902
- [[''],
903
- ['Emas 1 Gram (IDR)Emas 1 Gram (USD)Kurs USD-IDR',
904
- 'Hari Ini',
905
- '1 Bulan',
906
- '1 Tahun',
907
- '5 Tahun',
908
- 'Max',
909
- '']],
910
- [['Pergerakkan Harga Emas 1 Gram'],
911
- ['', 'Penutupan Kemarin', 'Pergerakkan Hari Ini', 'Rata-rata'],
912
- ['USD', '74,92', '74,24 - 74,92', '74,58'],
913
- ['KURS', '16.246,35', '16.233,90 - 16.246,35', '16.240,13'],
914
- ['IDR', '1.217.102,12', '1.205.172,32 - 1.217.102,12', '1.211.137,22'],
915
- [''],
916
- ['', 'Awal Tahun', 'Pergerakkan YTD', '+/- YTD'],
917
- ['USD', '66,32', '64,07 - 77,14', '+7,92 (11,94%)'],
918
- ['KURS', '15.390,10', '15.390,00 - 16.307,80', '+843,80 (5,48%)'],
919
- ['IDR', '1.020.729,53', '997.660,12 - 1.256.829,06', '+184.442,79 (18,07%)'],
920
- [''],
921
- ['', 'Tahun Lalu / 52 Minggu', 'Pergerakkan 52 Minggu', '+/- 52 Minggu'],
922
- ['USD', '63,76', '58,43 - 77,14', '+10,48 (16,44%)'],
923
- ['KURS', '14.936,00', '14.669,40 - 16.307,80', '+1.297,90 (8,69%)'],
924
- ['IDR', '952.339,68', '912.925,68 - 1.256.829,06', '+252.832,64 (26,55%)']])
625
+ ## console_run
626
+
627
+ `console_run(info, command=None, print_info=True, capture_output=False)`
628
+
629
+ Menjalankan command seperti menjalankan command di Command Terminal
630
+
631
+ ```py
632
+ console_run('dir')
633
+ console_run('ls')
925
634
  ```
926
635
 
927
636
  ## input_char
@@ -929,673 +638,946 @@ Output:
929
638
  `input_char(prompt=None, prompt_ending='', newline_after_input=True, echo_char=True, default=None)`
930
639
 
931
640
  Meminta masukan satu huruf tanpa menekan Enter.
932
-
641
+
933
642
  ```py
934
643
  input_char("Input char : ")
935
644
  input_char("Input char : ", default='Y')
936
645
  input_char("Input Char without print : ", echo_char=False)
937
646
  ```
938
647
 
939
- ## iopen
940
-
941
- `iopen(path, data=None, regex=None, css_select=None, xpath=None, file_append=False)`
942
-
943
- Membaca atau Tulis pada path yang bisa merupakan FILE maupun URL.
944
-
945
- Baca File :
946
- - Membaca seluruh file.
947
- - Jika berhasil content dapat diparse dengan regex.
948
- - Apabila File berupa html, dapat diparse dengan css atau xpath.
648
+ ## log
949
649
 
950
- Tulis File :
951
- - Menulis pada file.
952
- - Jika file tidak ada maka akan dibuat.
953
- - Jika file memiliki content maka akan di overwrite.
650
+ `log(text=None)`
954
651
 
955
- Membaca URL :
956
- - Mengakses URL dan mengembalikan isi html nya berupa teks.
957
- - Content dapat diparse dengan regex, css atau xpath.
958
-
959
- Tulis URL :
960
- - Mengirimkan data dengan metode POST ke url.
961
- - Jika berhasil dan response memiliki content, maka dapat diparse
962
- dengan regex, css atau xpath.
652
+ Decorator untuk mempermudah pembuatan log karena tidak perlu mengubah
653
+ fungsi yg sudah ada.
654
+ Melakukan print ke console untuk menginformasikan proses yg sedang
655
+ berjalan didalam program.
656
+
657
+ ```py
658
+ @log
659
+ def some_function():
660
+ pass
661
+
662
+ @log()
663
+ def some_function_again():
664
+ pass
665
+
666
+ @log("Calling some function")
667
+ def some_function_more():
668
+ pass
669
+
670
+ some_function()
671
+ some_function_again()
672
+ some_function_more()
673
+ ```
963
674
 
675
+ ## print_colorize
964
676
 
965
- ```python
966
- # FILE
967
- print(iopen("__iopen.txt", "mana aja"))
968
- print(iopen("__iopen.txt", regex="(\w+)"))
969
- # URL
970
- print(iopen("https://www.google.com/", css_select="a"))
971
- print(iopen("https://www.google.com/", dict(coba="dulu"), xpath="//a"))
972
- ```
677
+ `print_colorize(text, color='\x1b[32m', bright='\x1b[1m', color_end='\x1b[0m', text_start='', text_end='\n')`
973
678
 
974
- Output:
975
- ```py
976
- 8
977
- ['mana', 'aja']
978
- [<Element a at 0x702273dcc0>, <Element a at 0x700e41da40>, <Element a at 0x700e41dae0>, <Element a at 0x700e41db30>, <Element a at 0x700e41db80>, <Element a at 0x700e41dbd0>, <Element a at 0x700e41dc20>, <Element a at 0x700e41dc70>, <Element a at 0x700e41dcc0>, <Element a at 0x700e41dd10>, <Element a at 0x700e41dd60>, <Element a at 0x700e41ddb0>, <Element a at 0x700e41de00>, <Element a at 0x700e41de50>, <Element a at 0x700e41dea0>, <Element a at 0x700e41def0>, <Element a at 0x700e41df40>, <Element a at 0x700e41df90>]
979
- False
679
+ Print text dengan warna untuk menunjukan text penting
680
+
681
+ ```py
682
+ print_colorize("Print some text")
683
+ print_colorize("Print some text", color=colorama.Fore.RED)
980
684
  ```
981
685
 
982
- ## iprint
983
-
984
- `iprint(*args, color=None, sort_dicts=False, **kwargs)`
686
+ ## print_dir
985
687
 
986
- Improve print function dengan menambahkan color dan pretty print
987
- Color menggunakan colorama Fore + Back + Style
688
+ `print_dir(var, colorize=True)`
988
689
 
690
+ Print property dan method yang tersedia pada variabel
691
+
989
692
  ```python
990
- import colorama
991
- iprint(
992
- 'yang ini',
993
- {'12':12,'sdsd':{'12':21,'as':[88]}},
994
- color=colorama.Fore.BLUE + colorama.Style.BRIGHT
995
- )
693
+ import pathlib
694
+ p = pathlib.Path("https://www.google.com/")
695
+ print_dir(p, colorize=False)
996
696
  ```
997
697
 
998
698
  Output:
999
699
  ```py
1000
- yang ini {'12': 12, 'sdsd': {'12': 21, 'as': [88]}}
1001
- ```
700
+ __bytes__ : b'https:/www.google.com'
701
+ __class__ : .
702
+ __dir__ : ['__module__', '__doc__', '__slots__', '__new__', '_make_child_relpath', '__enter__', '__exit__', 'cwd', 'home', 'samefile', 'iterdir', '_scandir', 'glob', 'rglob', 'absolute', 'resolve', 'stat', 'owner', 'group', 'open', 'read_bytes', 'read_text', 'write_bytes', 'write_text', 'readlink', 'touch', 'mkdir', 'chmod', 'lchmod', 'unlink', 'rmdir', 'lstat', 'rename', 'replace', 'symlink_to', 'hardlink_to', 'link_to', 'exists', 'is_dir', 'is_file', 'is_mount', 'is_symlink', 'is_block_device', 'is_char_device', 'is_fifo', 'is_socket', 'expanduser', '__reduce__', '_parse_args', '_from_parts', '_from_parsed_parts', '_format_parsed_parts', '_make_child', '__str__', '__fspath__', 'as_posix', '__bytes__', '__repr__', 'as_uri', '_cparts', '__eq__', '__hash__', '__lt__', '__le__', '__gt__', '__ge__', 'drive', 'root', 'anchor', 'name', 'suffix', 'suffixes', 'stem', 'with_name', 'with_stem', 'with_suffix', 'relative_to', 'is_relative_to', 'parts', 'joinpath', '__truediv__', '__rtruediv__', 'parent', 'parents', 'is_absolute', 'is_reserved', 'match', '_cached_cparts', '_drv', '_hash', '_parts', '_pparts', '_root', '_str', '__getattribute__', '__setattr__', '__delattr__', '__ne__', '__init__', '__reduce_ex__', '__getstate__', '__subclasshook__', '__init_subclass__', '__format__', '__sizeof__', '__dir__', '__class__', '_flavour']
703
+ __doc__ : Path subclass for non-Windows systems.
1002
704
 
1003
- ## irange
705
+ On a POSIX system, instantiating a Path should return this object.
706
+
707
+ __enter__ : https:/www.google.com
708
+ __fspath__ : https:/www.google.com
709
+ __getstate__ : (None, {'_drv': '', '_root': '', '_parts': ['https:', 'www.google.com'], '_str': 'https:/www.google.com'})
710
+ __hash__ : 4247590312272611726
711
+ __init__ : None
712
+ __init_subclass__ : None
713
+ __module__ : pathlib
714
+ __reduce__ : (<class 'pathlib.PosixPath'>, ('https:', 'www.google.com'))
715
+ __repr__ : PosixPath('https:/www.google.com')
716
+ __sizeof__ : 72
717
+ __slots__ : ()
718
+ __str__ : https:/www.google.com
719
+ __subclasshook__ : NotImplemented
720
+ _cached_cparts : ['https:', 'www.google.com']
721
+ _cparts : ['https:', 'www.google.com']
722
+ _drv :
723
+ _flavour : <pathlib._PosixFlavour object at 0x7974d4c250>
724
+ _hash : 4247590312272611726
725
+ _parts : ['https:', 'www.google.com']
726
+ _root :
727
+ _str : https:/www.google.com
728
+ absolute : /data/data/com.termux/files/home/pypipr/https:/www.google.com
729
+ anchor :
730
+ as_posix : https:/www.google.com
731
+ cwd : /data/data/com.termux/files/home/pypipr
732
+ drive :
733
+ exists : False
734
+ expanduser : https:/www.google.com
735
+ home : /data/data/com.termux/files/home
736
+ is_absolute : False
737
+ is_block_device : False
738
+ is_char_device : False
739
+ is_dir : False
740
+ is_fifo : False
741
+ is_file : False
742
+ is_mount : False
743
+ is_reserved : False
744
+ is_socket : False
745
+ is_symlink : False
746
+ iterdir : <generator object Path.iterdir at 0x79670dcc80>
747
+ joinpath : https:/www.google.com
748
+ name : www.google.com
749
+ parent : https:
750
+ parents : <PosixPath.parents>
751
+ parts : ('https:', 'www.google.com')
752
+ resolve : /data/data/com.termux/files/home/pypipr/https:/www.google.com
753
+ root :
754
+ stem : www.google
755
+ suffix : .com
756
+ suffixes : ['.google', '.com']
757
+ ```
1004
758
 
1005
- `irange(start, finish, step=1)`
759
+ ## print_log
1006
760
 
1007
- Meningkatkan fungsi range() dari python untuk pengulangan menggunakan huruf
761
+ `print_log(text)`
1008
762
 
763
+ Akan melakukan print ke console.
764
+ Berguna untuk memberikan informasi proses program yg sedang berjalan.
765
+
1009
766
  ```python
1010
- print(irange('a', 'c'))
1011
- print(irange('z', 'a', 10))
1012
- print(list(irange('a', 'z', 10)))
1013
- print(list(irange(1, '7')))
1014
- print(list(irange(10, 5)))
767
+ print_log("Standalone Log")
1015
768
  ```
1016
769
 
1017
770
  Output:
1018
771
  ```py
1019
- <generator object irange at 0x700e3a28a0>
1020
- <generator object irange at 0x700e3a28a0>
1021
- ['a', 'k', 'u']
1022
- [1, 2, 3, 4, 5, 6, 7]
1023
- [10, 9, 8, 7, 6, 5]
772
+ >>> Standalone Log
1024
773
  ```
1025
774
 
1026
- ## ireplace
1027
-
1028
- `ireplace(string: str, replacements: dict, flags=re.IGNORECASE|re.MULTILINE|re.DOTALL)`
775
+ ## print_to_last_line
1029
776
 
1030
- STRing TRanslate mengubah string menggunakan kamus dari dict.
1031
- Replacement dapat berupa text biasa ataupun regex pattern.
1032
- Apabila replacement berupa regex, gunakan raw string `r"..."`
1033
- Untuk regex capturing gunakan `(...)`, dan untuk mengaksesnya
1034
- gunakan `\1`, `\2`, .., dst.
777
+ `print_to_last_line(text: str)`
1035
778
 
779
+ Melakukan print ke konsol tetapi akan menimpa baris terakhir.
780
+ Berguna untuk memberikan progress secara interaktif.
781
+
1036
782
  ```python
1037
- text = 'aku ini mau ke sini'
1038
- replacements = {
1039
- "sini": "situ",
1040
- r"(ini)": r"itu dan \1",
1041
- }
1042
- print(ireplace(text, replacements))
783
+ c = input("masukkan apa saja : ")
784
+ print_to_last_line(f"masukkan apa saja : {c} [ok]")
1043
785
  ```
1044
786
 
1045
787
  Output:
1046
788
  ```py
1047
- aku itu dan ini mau ke situ
789
+ masukkan apa saja : masukkan apa saja : [ok]
1048
790
  ```
1049
791
 
1050
- ## is_empty
1051
-
1052
- `is_empty(variable, empty=[None, False, 0, 0, '0', '', '-0', '\n', '\t', set(), {}, [], ()])`
1053
-
1054
- Mengecek apakah variable setara dengan nilai kosong pada empty.
1055
-
1056
- Pengecekan nilai yang setara menggunakan simbol '==', sedangkan untuk
1057
- pengecekan lokasi memory yang sama menggunakan keyword 'is'
792
+ ## text_colorize
1058
793
 
1059
- ```python
1060
- print(is_empty("teks"))
1061
- print(is_empty(True))
1062
- print(is_empty(False))
1063
- print(is_empty(None))
1064
- print(is_empty(0))
1065
- print(is_empty([]))
1066
- ```
794
+ `text_colorize(text, color='\x1b[32m', bright='\x1b[1m', color_end='\x1b[0m')`
1067
795
 
1068
- Output:
1069
- ```py
1070
- False
1071
- False
1072
- True
1073
- True
1074
- True
1075
- True
796
+ return text dengan warna untuk menunjukan text penting
797
+
798
+ ```py
799
+ text_colorize("Print some text")
800
+ text_colorize("Print some text", color=colorama.Fore.RED)
1076
801
  ```
1077
802
 
1078
- ## is_iterable
1079
-
1080
- `is_iterable(var, str_is_iterable=False)`
803
+ ## batch_calculate
1081
804
 
1082
- Mengecek apakah suatu variabel bisa dilakukan forloop atau tidak
805
+ `batch_calculate(pattern)`
1083
806
 
807
+ Analisa perhitungan massal.
808
+ Bisa digunakan untuk mencari alternatif terendah/tertinggi/dsb.
809
+
810
+
1084
811
  ```python
1085
- s = 'ini string'
1086
- print(is_iterable(s))
1087
-
1088
- l = [12,21,2,1]
1089
- print(is_iterable(l))
1090
-
1091
- r = range(100)
1092
- print(is_iterable(r))
1093
-
1094
- d = {'a':1, 'b':2}
1095
- print(is_iterable(d.values()))
812
+ print(batch_calculate("{1 10} m ** {1 3}"))
813
+ print(list(batch_calculate("{1 10} m ** {1 3}")))
1096
814
  ```
1097
815
 
1098
816
  Output:
1099
817
  ```py
1100
- False
1101
- True
1102
- True
1103
- True
818
+ <generator object batch_calculate at 0x7967057c40>
819
+ [('1 m ** 1', <Quantity(1, 'meter')>), ('1 m ** 2', <Quantity(1, 'meter ** 2')>), ('1 m ** 3', <Quantity(1, 'meter ** 3')>), ('2 m ** 1', <Quantity(2, 'meter')>), ('2 m ** 2', <Quantity(2, 'meter ** 2')>), ('2 m ** 3', <Quantity(2, 'meter ** 3')>), ('3 m ** 1', <Quantity(3, 'meter')>), ('3 m ** 2', <Quantity(3, 'meter ** 2')>), ('3 m ** 3', <Quantity(3, 'meter ** 3')>), ('4 m ** 1', <Quantity(4, 'meter')>), ('4 m ** 2', <Quantity(4, 'meter ** 2')>), ('4 m ** 3', <Quantity(4, 'meter ** 3')>), ('5 m ** 1', <Quantity(5, 'meter')>), ('5 m ** 2', <Quantity(5, 'meter ** 2')>), ('5 m ** 3', <Quantity(5, 'meter ** 3')>), ('6 m ** 1', <Quantity(6, 'meter')>), ('6 m ** 2', <Quantity(6, 'meter ** 2')>), ('6 m ** 3', <Quantity(6, 'meter ** 3')>), ('7 m ** 1', <Quantity(7, 'meter')>), ('7 m ** 2', <Quantity(7, 'meter ** 2')>), ('7 m ** 3', <Quantity(7, 'meter ** 3')>), ('8 m ** 1', <Quantity(8, 'meter')>), ('8 m ** 2', <Quantity(8, 'meter ** 2')>), ('8 m ** 3', <Quantity(8, 'meter ** 3')>), ('9 m ** 1', <Quantity(9, 'meter')>), ('9 m ** 2', <Quantity(9, 'meter ** 2')>), ('9 m ** 3', <Quantity(9, 'meter ** 3')>), ('10 m ** 1', <Quantity(10, 'meter')>), ('10 m ** 2', <Quantity(10, 'meter ** 2')>), ('10 m ** 3', <Quantity(10, 'meter ** 3')>)]
1104
820
  ```
1105
821
 
1106
- ## is_valid_url
1107
-
1108
- `is_valid_url(path)`
822
+ ## batchmaker
1109
823
 
1110
- Mengecek apakah path merupakan URL yang valid atau tidak.
1111
- Cara ini merupakan cara yang paling efektif.
824
+ `batchmaker(pattern: str)`
1112
825
 
826
+ Alat Bantu untuk membuat teks yang berulang.
827
+ Gunakan `{[start][separator][finish]([separator][step])}`.
828
+ ```
829
+ [start] dan [finish] -> bisa berupa huruf maupun angka
830
+ ([separator][step]) -> bersifat optional
831
+ [separator] -> selain huruf dan angka
832
+ [step] -> berupa angka positif
833
+ ```
834
+
1113
835
  ```python
1114
- print(is_valid_url("https://chat.openai.com/?model=text-davinci-002-render-sha"))
1115
- print(is_valid_url("https://chat.openai.com/?model/=text-dav/inci-002-render-sha"))
836
+ s = "Urutan {1/6/3} dan {10:9} dan {j k} dan {Z - A - 15} saja."
837
+ print(batchmaker(s))
838
+ print(list(batchmaker(s)))
1116
839
  ```
1117
840
 
1118
841
  Output:
1119
842
  ```py
1120
- True
1121
- True
843
+ <generator object batchmaker at 0x79670ec160>
844
+ ['Urutan 1 dan 10 dan j dan Z saja.', 'Urutan 1 dan 10 dan j dan K saja.', 'Urutan 1 dan 10 dan k dan Z saja.', 'Urutan 1 dan 10 dan k dan K saja.', 'Urutan 1 dan 9 dan j dan Z saja.', 'Urutan 1 dan 9 dan j dan K saja.', 'Urutan 1 dan 9 dan k dan Z saja.', 'Urutan 1 dan 9 dan k dan K saja.', 'Urutan 4 dan 10 dan j dan Z saja.', 'Urutan 4 dan 10 dan j dan K saja.', 'Urutan 4 dan 10 dan k dan Z saja.', 'Urutan 4 dan 10 dan k dan K saja.', 'Urutan 4 dan 9 dan j dan Z saja.', 'Urutan 4 dan 9 dan j dan K saja.', 'Urutan 4 dan 9 dan k dan Z saja.', 'Urutan 4 dan 9 dan k dan K saja.']
1122
845
  ```
1123
846
 
1124
- ## iscandir
1125
-
1126
- `iscandir(folder_name='.', glob_pattern='*', recursive=True, scan_file=True, scan_folder=True)`
1127
-
1128
- Mempermudah scandir untuk mengumpulkan folder dan file.
847
+ ## calculate
1129
848
 
1130
- ```python
1131
- print(iscandir())
1132
- print(list(iscandir("./", recursive=False, scan_file=False)))
1133
- ```
849
+ `calculate(teks)`
1134
850
 
1135
- Output:
1136
- ```py
1137
- <generator object iscandir at 0x700e3c4840>
1138
- [PosixPath('.git'), PosixPath('.vscode'), PosixPath('pypipr'), PosixPath('__pycache__'), PosixPath('dist')]
851
+ Mengembalikan hasil dari perhitungan teks menggunakan modul pint.
852
+ Mendukung perhitungan matematika dasar dengan satuan.
853
+
854
+ Return value:
855
+ - Berupa class Quantity dari modul pint
856
+
857
+ Format:
858
+ - f"{result:~P}" -> pretty
859
+ - f"{result:~H}" -> html
860
+ - result.to_base_units() -> SI
861
+ - result.to_compact() -> human readable
862
+
863
+ ```python
864
+ fx = "3 meter * 10 cm * 3 km"
865
+ res = calculate(fx)
866
+ print(res)
867
+ print(res.to_base_units())
868
+ print(res.to_compact())
869
+ print(f"{res:~P}")
870
+ print(f"{res:~H}")
1139
871
  ```
1140
872
 
1141
- ## isplit
873
+ Output:
874
+ ```py
875
+ 90 centimeter * kilometer * meter
876
+ 900.0 meter ** 3
877
+ 900.0 meter ** 3
878
+ 90 cm·km·m
879
+ 90 cm km m
880
+ ```
1142
881
 
1143
- `isplit(text, separator='', include_separator=False)`
882
+ ## auto_reload
1144
883
 
1145
- Memecah text menjadi list berdasarkan separator.
884
+ `auto_reload(filename)`
1146
885
 
1147
- ```python
1148
- t = '/ini/contoh/path/'
1149
- print(isplit(t, separator='/'))
886
+ Menjalankan file python secara berulang.
887
+ Dengan tujuan untuk melihat perubahan secara langsung.
888
+ Pastikan kode aman untuk dijalankan.
889
+ Jalankan kode ini di terminal console.
890
+
891
+ ```py
892
+ python -m pypipr.iflow.auto_reload file_name.py
1150
893
  ```
1151
894
 
1152
- Output:
1153
- ```py
1154
- ['', 'ini', 'contoh', 'path', '']
895
+ ## github_pull
896
+
897
+ `github_pull()`
898
+
899
+ Menjalankan command `git pull`
900
+
901
+ ```py
902
+ github_pull()
1155
903
  ```
1156
904
 
1157
- ## ivars
905
+ ## github_push
1158
906
 
1159
- `ivars(obj, skip_underscore=True)`
907
+ `github_push(commit_msg=None)`
1160
908
 
1161
- Membuat dictionary berdasarkan kategori untuk setiap
1162
- member dari object.
909
+ Menjalankan command status, add, commit dan push
910
+
911
+ ```py
912
+ github_push('Commit Message')
913
+ ```
1163
914
 
1164
- ```python
1165
- iprint(ivars(__import__('pypipr')))
915
+ ## github_user
916
+
917
+ `github_user(email=None, name=None)`
918
+
919
+ Menyimpan email dan nama user secara global sehingga tidak perlu
920
+ menginput nya setiap saat.
921
+
922
+ ```py
923
+ github_user('my@emil.com', 'MyName')
1166
924
  ```
1167
925
 
1168
- Output:
1169
- ```py
1170
- {'module': {'ibuiltins': <module 'pypipr.ibuiltins' from '/data/data/com.termux/files/home/pypipr/pypipr/ibuiltins/__init__.py'>,
1171
- 'iconsole': <module 'pypipr.iconsole' from '/data/data/com.termux/files/home/pypipr/pypipr/iconsole/__init__.py'>,
1172
- 'idjango': <module 'pypipr.idjango' from '/data/data/com.termux/files/home/pypipr/pypipr/idjango/__init__.py'>,
1173
- 'iengineering': <module 'pypipr.iengineering' from '/data/data/com.termux/files/home/pypipr/pypipr/iengineering/__init__.py'>,
1174
- 'ifunctions': <module 'pypipr.ifunctions' from '/data/data/com.termux/files/home/pypipr/pypipr/ifunctions/__init__.py'>,
1175
- 'iflow': <module 'pypipr.iflow' (<_frozen_importlib_external.NamespaceLoader object at 0x70181677d0>)>,
1176
- 'colorama': <module 'colorama' from '/data/data/com.termux/files/usr/lib/python3.11/site-packages/colorama/__init__.py'>,
1177
- 'datetime': <module 'datetime' from '/data/data/com.termux/files/usr/lib/python3.11/datetime.py'>,
1178
- 'functools': <module 'functools' from '/data/data/com.termux/files/usr/lib/python3.11/functools.py'>,
1179
- 'inspect': <module 'inspect' from '/data/data/com.termux/files/usr/lib/python3.11/inspect.py'>,
1180
- 'io': <module 'io' (frozen)>,
1181
- 'json': <module 'json' from '/data/data/com.termux/files/usr/lib/python3.11/json/__init__.py'>,
1182
- 'lxml': <module 'lxml' from '/data/data/com.termux/files/usr/lib/python3.11/site-packages/lxml/__init__.py'>,
1183
- 'math': <module 'math' from '/data/data/com.termux/files/usr/lib/python3.11/lib-dynload/math.cpython-311.so'>,
1184
- 'operator': <module 'operator' from '/data/data/com.termux/files/usr/lib/python3.11/operator.py'>,
1185
- 'os': <module 'os' (frozen)>,
1186
- 'pathlib': <module 'pathlib' from '/data/data/com.termux/files/usr/lib/python3.11/pathlib.py'>,
1187
- 'pint': <module 'pint' from '/data/data/com.termux/files/usr/lib/python3.11/site-packages/pint/__init__.py'>,
1188
- 'pprint': <module 'pprint' from '/data/data/com.termux/files/usr/lib/python3.11/pprint.py'>,
1189
- 'queue': <module 'queue' from '/data/data/com.termux/files/usr/lib/python3.11/queue.py'>,
1190
- 'random': <module 'random' from '/data/data/com.termux/files/usr/lib/python3.11/random.py'>,
1191
- 're': <module 're' from '/data/data/com.termux/files/usr/lib/python3.11/re/__init__.py'>,
1192
- 'requests': <module 'requests' from '/data/data/com.termux/files/usr/lib/python3.11/site-packages/requests/__init__.py'>,
1193
- 'string': <module 'string' from '/data/data/com.termux/files/usr/lib/python3.11/string.py'>,
1194
- 'subprocess': <module 'subprocess' from '/data/data/com.termux/files/usr/lib/python3.11/subprocess.py'>,
1195
- 'sys': <module 'sys' (built-in)>,
1196
- 'textwrap': <module 'textwrap' from '/data/data/com.termux/files/usr/lib/python3.11/textwrap.py'>,
1197
- 'time': <module 'time' (built-in)>,
1198
- 'tzdata': <module 'tzdata' from '/data/data/com.termux/files/usr/lib/python3.11/site-packages/tzdata/__init__.py'>,
1199
- 'uuid': <module 'uuid' from '/data/data/com.termux/files/usr/lib/python3.11/uuid.py'>,
1200
- 'webbrowser': <module 'webbrowser' from '/data/data/com.termux/files/usr/lib/python3.11/webbrowser.py'>,
1201
- 'yaml': <module 'yaml' from '/data/data/com.termux/files/usr/lib/python3.11/site-packages/yaml/__init__.py'>,
1202
- 'zoneinfo': <module 'zoneinfo' from '/data/data/com.termux/files/usr/lib/python3.11/zoneinfo/__init__.py'>},
1203
- 'class': {'ComparePerformance': <class 'pypipr.ibuiltins.ComparePerformance.ComparePerformance'>,
1204
- 'RunParallel': <class 'pypipr.ibuiltins.RunParallel.RunParallel'>,
1205
- 'APIMixinView': <class 'pypipr.idjango.APIMixinView.APIMixinView'>,
1206
- 'PintUregQuantity': <class 'pint.Quantity'>},
1207
- 'function': {'avg': <function avg at 0x7022732d40>,
1208
- 'basename': <function basename at 0x70226fea20>,
1209
- 'chunk_array': <function chunk_array at 0x701eed8ae0>,
1210
- 'create_folder': <function create_folder at 0x701eed8cc0>,
1211
- 'datetime_from_string': <function datetime_from_string at 0x701eed8ea0>,
1212
- 'datetime_now': <function datetime_now at 0x701ef5bba0>,
1213
- 'dict_first': <function dict_first at 0x701ef5bb00>,
1214
- 'dirname': <function dirname at 0x701ef5ba60>,
1215
- 'exit_if_empty': <function exit_if_empty at 0x701ef5b920>,
1216
- 'filter_empty': <function filter_empty at 0x701ef7e7a0>,
1217
- 'get_class_method': <function get_class_method at 0x701ef7db20>,
1218
- 'get_filemtime': <function get_filemtime at 0x701ef7d9e0>,
1219
- 'get_filesize': <function get_filesize at 0x701ef7d800>,
1220
- 'get_from_index': <function get_from_index at 0x701ef7d620>,
1221
- 'is_empty': <function is_empty at 0x701ef7e8e0>,
1222
- 'is_iterable': <function is_iterable at 0x701ef7dc60>,
1223
- 'is_valid_url': <function is_valid_url at 0x701ef7d6c0>,
1224
- 'ivars': <function ivars at 0x701ef7d3a0>,
1225
- 'password_generator': <function password_generator at 0x701ef7d300>,
1226
- 'random_bool': <function random_bool at 0x701ef7cf40>,
1227
- 'set_timeout': <function set_timeout at 0x701ef7f2e0>,
1228
- 'sets_ordered': <function sets_ordered at 0x701ef7f420>,
1229
- 'str_cmp': <function str_cmp at 0x701ef7f4c0>,
1230
- 'to_str': <function to_str at 0x701ef7dbc0>,
1231
- 'choices': <function choices at 0x701ef7f560>,
1232
- 'console_run': <function console_run at 0x701ef7f7e0>,
1233
- 'input_char': <function input_char at 0x701ef7f920>,
1234
- 'log': <function log at 0x701ef7fb00>,
1235
- 'print_colorize': <function print_colorize at 0x701ef7fba0>,
1236
- 'print_dir': <function print_dir at 0x701ef7fce0>,
1237
- 'print_log': <function print_log at 0x701ef7f9c0>,
1238
- 'print_to_last_line': <function print_to_last_line at 0x701ef7f740>,
1239
- 'text_colorize': <function text_colorize at 0x701ef7f880>,
1240
- 'batch_calculate': <function batch_calculate at 0x701817d080>,
1241
- 'batchmaker': <function batchmaker at 0x701815e480>,
1242
- 'calculate': <function calculate at 0x701817dda0>,
1243
- 'auto_reload': <function auto_reload at 0x701817df80>,
1244
- 'github_pull': <function github_pull at 0x701817db20>,
1245
- 'github_push': <function github_push at 0x701817e200>,
1246
- 'github_user': <function github_user at 0x701817e520>,
1247
- 'pip_freeze_without_version': <function pip_freeze_without_version at 0x7017eb5b20>,
1248
- 'poetry_publish': <function poetry_publish at 0x7017eb5c60>,
1249
- 'poetry_update_version': <function poetry_update_version at 0x7017eda480>,
1250
- 'iargv': <function iargv at 0x700e5abba0>,
1251
- 'idumps': <function idumps at 0x700e5ac360>,
1252
- 'idumps_html': <function idumps_html at 0x700e610720>,
1253
- 'ienv': <function ienv at 0x700e5abe20>,
1254
- 'iexec': <function iexec at 0x700e6109a0>,
1255
- 'ijoin': <function ijoin at 0x7017eb59e0>,
1256
- 'iloads': <function iloads at 0x700e610a40>,
1257
- 'iloads_html': <function iloads_html at 0x700e610cc0>,
1258
- 'iopen': <function iopen at 0x7017eb5d00>,
1259
- 'iprint': <function iprint at 0x700e5abc40>,
1260
- 'irange': <function irange at 0x701817dee0>,
1261
- 'ireplace': <function ireplace at 0x700e610b80>,
1262
- 'iscandir': <function iscandir at 0x700e612980>,
1263
- 'isplit': <function isplit at 0x700e612a20>},
1264
- 'property': {},
1265
- 'variable': {'LINUX': True,
1266
- 'WINDOWS': False,
1267
- 'PintUreg': <pint.registry.UnitRegistry object at 0x701efa3290>},
1268
- 'method': {},
1269
- '__module__': {},
1270
- '__class__': {},
1271
- '__function__': {},
1272
- '__property__': {},
1273
- '__variable__': {},
1274
- '__method__': {}}
926
+ ## pip_freeze_without_version
927
+
928
+ `pip_freeze_without_version(filename=None)`
929
+
930
+ Memberikan list dari dependencies yang terinstall tanpa version.
931
+ Bertujuan untuk menggunakan Batteries Included Python.
932
+
933
+ ```py
934
+ print(pip_freeze_without_version())
1275
935
  ```
1276
936
 
1277
- ## log
937
+ ## poetry_publish
1278
938
 
1279
- `log(text=None)`
939
+ `poetry_publish(token=None)`
1280
940
 
1281
- Decorator untuk mempermudah pembuatan log karena tidak perlu mengubah
1282
- fungsi yg sudah ada.
1283
- Melakukan print ke console untuk menginformasikan proses yg sedang
1284
- berjalan didalam program.
941
+ Publish project to pypi,org
942
+
943
+ ```py
944
+ poetry_publish()
945
+ ```
946
+
947
+ ## poetry_update_version
948
+
949
+ `poetry_update_version(mayor=False, minor=False, patch=False)`
1285
950
 
951
+ Update versi pada pyproject.toml menggunakan poetry
952
+
1286
953
  ```py
1287
- @log
1288
- def some_function():
1289
- pass
954
+ poetry_update_version()
955
+ ```
1290
956
 
1291
- @log()
1292
- def some_function_again():
1293
- pass
957
+ ## iargv
1294
958
 
1295
- @log("Calling some function")
1296
- def some_function_more():
1297
- pass
959
+ `iargv(key: int, cast=None, on_error=None)`
1298
960
 
1299
- some_function()
1300
- some_function_again()
1301
- some_function_more()
961
+ ## idumps
962
+
963
+ `idumps(data, syntax='yaml', indent=4)`
964
+
965
+ Mengubah variabel data menjadi string untuk yang dapat dibaca untuk disimpan.
966
+ String yang dihasilkan berbentuk syntax YAML/JSON/HTML.
967
+
968
+ ```python
969
+ data = {
970
+ 'a': 123,
971
+ 't': ['disini', 'senang', 'disana', 'senang'],
972
+ 'l': (12, 23, [12, 42]),
973
+ }
974
+ print(idumps(data))
975
+ print(idumps(data, syntax='html'))
1302
976
  ```
1303
977
 
1304
- ## password_generator
978
+ Output:
979
+ ```py
980
+ a: 123
981
+ l: !!python/tuple
982
+ - 12
983
+ - 23
984
+ - - 12
985
+ - 42
986
+ t:
987
+ - disini
988
+ - senang
989
+ - disana
990
+ - senang
1305
991
 
1306
- `password_generator(length=8, characters='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~')`
992
+ <table>
993
+ <tbody>
994
+ <tr>
995
+ <th>a</th>
996
+ <td>
997
+ <span>123</span>
998
+ </td>
999
+ </tr>
1000
+ <tr>
1001
+ <th>t</th>
1002
+ <td>
1003
+ <ul>
1004
+ <li>
1005
+ <span>disini</span>
1006
+ </li>
1007
+ <li>
1008
+ <span>senang</span>
1009
+ </li>
1010
+ <li>
1011
+ <span>disana</span>
1012
+ </li>
1013
+ <li>
1014
+ <span>senang</span>
1015
+ </li>
1016
+ </ul>
1017
+ </td>
1018
+ </tr>
1019
+ <tr>
1020
+ <th>l</th>
1021
+ <td>
1022
+ <ul>
1023
+ <li>
1024
+ <span>12</span>
1025
+ </li>
1026
+ <li>
1027
+ <span>23</span>
1028
+ </li>
1029
+ <li>
1030
+ <ul>
1031
+ <li>
1032
+ <span>12</span>
1033
+ </li>
1034
+ <li>
1035
+ <span>42</span>
1036
+ </li>
1037
+ </ul>
1038
+ </li>
1039
+ </ul>
1040
+ </td>
1041
+ </tr>
1042
+ </tbody>
1043
+ </table>
1307
1044
 
1308
- Membuat pssword secara acak
1045
+ ```
1309
1046
 
1047
+ ## idumps_html
1048
+
1049
+ `idumps_html(data, indent=None)`
1050
+
1051
+ Serialisasi python variabel menjadi HTML.
1052
+ ```
1053
+ List -> <ul>...</ul>
1054
+ Dict -> <table>...</table>
1055
+ ```
1056
+
1310
1057
  ```python
1311
- print(password_generator())
1058
+ data = {
1059
+ 'abc': 123,
1060
+ 'list': [1, 2, 3, 4, 5],
1061
+ 'dict': {'a': 1, 'b':2, 'c':3},
1062
+ }
1063
+ print(idumps_html(data))
1312
1064
  ```
1313
1065
 
1314
- Output:
1315
- ```py
1316
- AJc4[N|"
1066
+ Output:
1067
+ ```py
1068
+ <table>
1069
+ <tbody>
1070
+ <tr>
1071
+ <th>abc</th>
1072
+ <td>
1073
+ <span>123</span>
1074
+ </td>
1075
+ </tr>
1076
+ <tr>
1077
+ <th>list</th>
1078
+ <td>
1079
+ <ul>
1080
+ <li>
1081
+ <span>1</span>
1082
+ </li>
1083
+ <li>
1084
+ <span>2</span>
1085
+ </li>
1086
+ <li>
1087
+ <span>3</span>
1088
+ </li>
1089
+ <li>
1090
+ <span>4</span>
1091
+ </li>
1092
+ <li>
1093
+ <span>5</span>
1094
+ </li>
1095
+ </ul>
1096
+ </td>
1097
+ </tr>
1098
+ <tr>
1099
+ <th>dict</th>
1100
+ <td>
1101
+ <table>
1102
+ <tbody>
1103
+ <tr>
1104
+ <th>a</th>
1105
+ <td>
1106
+ <span>1</span>
1107
+ </td>
1108
+ </tr>
1109
+ <tr>
1110
+ <th>b</th>
1111
+ <td>
1112
+ <span>2</span>
1113
+ </td>
1114
+ </tr>
1115
+ <tr>
1116
+ <th>c</th>
1117
+ <td>
1118
+ <span>3</span>
1119
+ </td>
1120
+ </tr>
1121
+ </tbody>
1122
+ </table>
1123
+ </td>
1124
+ </tr>
1125
+ </tbody>
1126
+ </table>
1127
+
1317
1128
  ```
1318
1129
 
1319
- ## pip_freeze_without_version
1320
-
1321
- `pip_freeze_without_version(filename=None)`
1130
+ ## ienv
1322
1131
 
1323
- Memberikan list dari dependencies yang terinstall tanpa version.
1324
- Bertujuan untuk menggunakan Batteries Included Python.
1132
+ `ienv(on_windows=None, on_linux=None)`
1325
1133
 
1134
+ Mengambalikan hasil berdasarkan environment dimana program dijalankan
1135
+
1326
1136
  ```py
1327
- print(pip_freeze_without_version())
1137
+ getch = __import__(ienv(on_windows="msvcrt", on_linux="getch"))
1138
+
1139
+ inherit = ienv(
1140
+ on_windows=[BaseForWindows, BaseEnv, object],
1141
+ on_linux=[SpecialForLinux, BaseForLinux, BaseEnv, object]
1142
+ )
1143
+
1144
+ class ExampleIEnv(*inherit):
1145
+ pass
1328
1146
  ```
1329
1147
 
1330
- ## poetry_publish
1331
-
1332
- `poetry_publish(token=None)`
1148
+ ## iexec
1333
1149
 
1334
- Publish project to pypi,org
1150
+ `iexec(python_syntax, import_pypipr=True)`
1335
1151
 
1336
- ```py
1337
- poetry_publish()
1152
+ improve exec() python function untuk mendapatkan outputnya
1153
+
1154
+ ```python
1155
+ print(iexec('print(9*9)'))
1338
1156
  ```
1339
1157
 
1340
- ## poetry_update_version
1341
-
1342
- `poetry_update_version(mayor=False, minor=False, patch=False)`
1343
-
1344
- Update versi pada pyproject.toml menggunakan poetry
1158
+ Output:
1159
+ ```py
1160
+ 81
1345
1161
 
1346
- ```py
1347
- poetry_update_version()
1348
1162
  ```
1349
1163
 
1350
- ## print_colorize
1351
-
1352
- `print_colorize(text, color='\x1b[32m', bright='\x1b[1m', color_end='\x1b[0m', text_start='', text_end='\n')`
1164
+ ## ijoin
1353
1165
 
1354
- Print text dengan warna untuk menunjukan text penting
1166
+ `ijoin(iterable, separator='', start='', end='', remove_empty=False, recursive=True, recursive_flat=False, str_strip=False)`
1355
1167
 
1356
- ```py
1357
- print_colorize("Print some text")
1358
- print_colorize("Print some text", color=colorama.Fore.RED)
1168
+ Simplify Python join functions like PHP function.
1169
+ Iterable bisa berupa sets, tuple, list, dictionary.
1170
+
1171
+ ```python
1172
+ arr = {'asd','dfs','weq','qweqw'}
1173
+ print(ijoin(arr, ', '))
1174
+
1175
+ arr = '/ini/path/seperti/url/'.split('/')
1176
+ print(ijoin(arr, ','))
1177
+ print(ijoin(arr, ',', remove_empty=True))
1178
+
1179
+ arr = {'a':'satu', 'b':(12, 34, 56), 'c':'tiga', 'd':'empat'}
1180
+ print(ijoin(arr, separator='</li>\n<li>', start='<li>', end='</li>',
1181
+ recursive_flat=True))
1182
+ print(ijoin(arr, separator='</div>\n<div>', start='<div>', end='</div>'))
1183
+ print(ijoin(10, ' '))
1359
1184
  ```
1360
1185
 
1361
- ## print_dir
1186
+ Output:
1187
+ ```py
1188
+ weq, asd, dfs, qweqw
1189
+ ,ini,path,seperti,url,
1190
+ ini,path,seperti,url
1191
+ <li>satu</li>
1192
+ <li>12</li>
1193
+ <li>34</li>
1194
+ <li>56</li>
1195
+ <li>tiga</li>
1196
+ <li>empat</li>
1197
+ <div>satu</div>
1198
+ <div><div>12</div>
1199
+ <div>34</div>
1200
+ <div>56</div></div>
1201
+ <div>tiga</div>
1202
+ <div>empat</div>
1203
+ 10
1204
+ ```
1362
1205
 
1363
- `print_dir(var, colorize=True)`
1206
+ ## iloads
1364
1207
 
1365
- Print property dan method yang tersedia pada variabel
1208
+ `iloads(data, syntax='yaml')`
1366
1209
 
1210
+ Mengubah string data hasil dari idumps menjadi variabel.
1211
+ String data adalah berupa syntax YAML.
1212
+
1367
1213
  ```python
1368
- import pathlib
1369
- p = pathlib.Path("https://www.google.com/")
1370
- print_dir(p, colorize=False)
1214
+ data = {
1215
+ 'a': 123,
1216
+ 't': ['disini', 'senang', 'disana', 'senang'],
1217
+ 'l': (12, 23, [12, 42]),
1218
+ }
1219
+ s = idumps(data)
1220
+ print(iloads(s))
1371
1221
  ```
1372
1222
 
1373
1223
  Output:
1374
1224
  ```py
1375
- __bytes__ : b'https:/www.google.com'
1376
- __class__ : .
1377
- __dir__ : ['__module__', '__doc__', '__slots__', '__new__', '_make_child_relpath', '__enter__', '__exit__', 'cwd', 'home', 'samefile', 'iterdir', '_scandir', 'glob', 'rglob', 'absolute', 'resolve', 'stat', 'owner', 'group', 'open', 'read_bytes', 'read_text', 'write_bytes', 'write_text', 'readlink', 'touch', 'mkdir', 'chmod', 'lchmod', 'unlink', 'rmdir', 'lstat', 'rename', 'replace', 'symlink_to', 'hardlink_to', 'link_to', 'exists', 'is_dir', 'is_file', 'is_mount', 'is_symlink', 'is_block_device', 'is_char_device', 'is_fifo', 'is_socket', 'expanduser', '__reduce__', '_parse_args', '_from_parts', '_from_parsed_parts', '_format_parsed_parts', '_make_child', '__str__', '__fspath__', 'as_posix', '__bytes__', '__repr__', 'as_uri', '_cparts', '__eq__', '__hash__', '__lt__', '__le__', '__gt__', '__ge__', 'drive', 'root', 'anchor', 'name', 'suffix', 'suffixes', 'stem', 'with_name', 'with_stem', 'with_suffix', 'relative_to', 'is_relative_to', 'parts', 'joinpath', '__truediv__', '__rtruediv__', 'parent', 'parents', 'is_absolute', 'is_reserved', 'match', '_cached_cparts', '_drv', '_hash', '_parts', '_pparts', '_root', '_str', '__getattribute__', '__setattr__', '__delattr__', '__ne__', '__init__', '__reduce_ex__', '__getstate__', '__subclasshook__', '__init_subclass__', '__format__', '__sizeof__', '__dir__', '__class__', '_flavour']
1378
- __doc__ : Path subclass for non-Windows systems.
1379
-
1380
- On a POSIX system, instantiating a Path should return this object.
1381
-
1382
- __enter__ : https:/www.google.com
1383
- __fspath__ : https:/www.google.com
1384
- __getstate__ : (None, {'_drv': '', '_root': '', '_parts': ['https:', 'www.google.com'], '_str': 'https:/www.google.com'})
1385
- __hash__ : 2559351135473141218
1386
- __init__ : None
1387
- __init_subclass__ : None
1388
- __module__ : pathlib
1389
- __reduce__ : (<class 'pathlib.PosixPath'>, ('https:', 'www.google.com'))
1390
- __repr__ : PosixPath('https:/www.google.com')
1391
- __sizeof__ : 72
1392
- __slots__ : ()
1393
- __str__ : https:/www.google.com
1394
- __subclasshook__ : NotImplemented
1395
- _cached_cparts : ['https:', 'www.google.com']
1396
- _cparts : ['https:', 'www.google.com']
1397
- _drv :
1398
- _flavour : <pathlib._PosixFlavour object at 0x701ef47ed0>
1399
- _hash : 2559351135473141218
1400
- _parts : ['https:', 'www.google.com']
1401
- _root :
1402
- _str : https:/www.google.com
1403
- absolute : /data/data/com.termux/files/home/pypipr/https:/www.google.com
1404
- anchor :
1405
- as_posix : https:/www.google.com
1406
- cwd : /data/data/com.termux/files/home/pypipr
1407
- drive :
1408
- exists : False
1409
- expanduser : https:/www.google.com
1410
- home : /data/data/com.termux/files/home
1411
- is_absolute : False
1412
- is_block_device : False
1413
- is_char_device : False
1414
- is_dir : False
1415
- is_fifo : False
1416
- is_file : False
1417
- is_mount : False
1418
- is_reserved : False
1419
- is_socket : False
1420
- is_symlink : False
1421
- iterdir : <generator object Path.iterdir at 0x700e3ce6c0>
1422
- joinpath : https:/www.google.com
1423
- name : www.google.com
1424
- parent : https:
1425
- parents : <PosixPath.parents>
1426
- parts : ('https:', 'www.google.com')
1427
- resolve : /data/data/com.termux/files/home/pypipr/https:/www.google.com
1428
- root :
1429
- stem : www.google
1430
- suffix : .com
1431
- suffixes : ['.google', '.com']
1225
+ {'a': 123, 'l': (12, 23, [12, 42]), 't': ['disini', 'senang', 'disana', 'senang']}
1432
1226
  ```
1433
1227
 
1434
- ## print_log
1435
-
1436
- `print_log(text)`
1228
+ ## iloads_html
1437
1229
 
1438
- Akan melakukan print ke console.
1439
- Berguna untuk memberikan informasi proses program yg sedang berjalan.
1230
+ `iloads_html(html)`
1440
1231
 
1232
+ Mengambil data yang berupa list `<ul>`, dan table `<table>` dari html
1233
+ dan menjadikannya data python berupa list.
1234
+ setiap data yang ditemukan akan dibungkus dengan tuple sebagai separator.
1235
+ ```
1236
+ list (<ul>) -> list -> list satu dimensi
1237
+ table (<table>) -> list[list] -> list satu dimensi didalam list
1238
+ ```
1239
+ apabila data berupa ul maka dapat dicek type(data) -> html_ul
1240
+ apabila data berupa ol maka dapat dicek type(data) -> html_ol
1241
+ apabila data berupa dl maka dapat dicek type(data) -> html_dl
1242
+ apabila data berupa table maka dapat dicek type(data) -> html_table
1243
+
1441
1244
  ```python
1442
- print_log("Standalone Log")
1245
+ import pprint
1246
+ pprint.pprint(iloads_html(iopen("https://harga-emas.org/")), depth=10)
1247
+ pprint.pprint(iloads_html(iopen("https://harga-emas.org/1-gram/")), depth=10)
1443
1248
  ```
1444
1249
 
1445
1250
  Output:
1446
1251
  ```py
1447
- >>> Standalone Log
1252
+ Timeout 3
1253
+ (['Home', 'Emas 1 Gram', 'History', 'Trend', 'Perak 1 Gram', 'Pluang'],
1254
+ [['Harga Emas Hari Ini - Selasa, 23 April 2024'],
1255
+ ['Spot Emas USD↓2.303,92 (-26,21) / oz',
1256
+ 'Kurs IDR↓16.224,00 (-56,00) / USD',
1257
+ 'Emas IDR↓1.201.756 (-17.867) / gr'],
1258
+ ['LM Antam (Jual)↓1.325.000 (-18.000) / gr',
1259
+ 'LM Antam (Beli)↓1.223.000 (-15.000) / gr']],
1260
+ [['Harga Emas Hari Ini'],
1261
+ ['Gram', 'Gedung Antam Jakarta', 'Pegadaian'],
1262
+ ['per Gram (Rp)', 'per Batangan (Rp)', 'per Gram (Rp)', 'per Batangan (Rp)'],
1263
+ ['1000',
1264
+ '1.266 (-18)',
1265
+ '1.265.600 (-18.000)',
1266
+ '1.043.040 (+8.200)',
1267
+ '1.043.040.000 (+8.200.000)'],
1268
+ ['500',
1269
+ '2.531 (-36)',
1270
+ '1.265.640 (-18.000)',
1271
+ '1.043.082 (+8.200)',
1272
+ '521.541.000 (+4.100.000)'],
1273
+ ['250',
1274
+ '5.064 (-72)',
1275
+ '1.266.060 (-18.000)',
1276
+ '1.043.512 (+8.200)',
1277
+ '260.878.000 (+2.050.000)'],
1278
+ ['100',
1279
+ '12.671 (-180)',
1280
+ '1.267.120 (-18.000)',
1281
+ '1.044.600 (+8.200)',
1282
+ '104.460.000 (+820.000)'],
1283
+ ['50',
1284
+ '25.358 (-360)',
1285
+ '1.267.900 (-18.000)',
1286
+ '1.045.400 (+8.200)',
1287
+ '52.270.000 (+410.000)'],
1288
+ ['25',
1289
+ '50.779 (-720)',
1290
+ '1.269.480 (-18.000)',
1291
+ '1.047.040 (+8.200)',
1292
+ '26.176.000 (+205.000)'],
1293
+ ['10',
1294
+ '127.450 (-1.800)',
1295
+ '1.274.500 (-18.000)',
1296
+ '1.052.200 (+8.200)',
1297
+ '10.522.000 (+82.000)'],
1298
+ ['5',
1299
+ '256.000 (-3.600)',
1300
+ '1.280.000 (-18.000)',
1301
+ '1.057.800 (+8.200)',
1302
+ '5.289.000 (+41.000)'],
1303
+ ['3',
1304
+ '428.889 (-6.000)',
1305
+ '1.286.667 (-18.000)',
1306
+ '1.064.667 (+8.000)',
1307
+ '3.194.000 (+24.000)'],
1308
+ ['2',
1309
+ '647.500 (-9.000)',
1310
+ '1.295.000 (-18.000)',
1311
+ '1.073.500 (+8.500)',
1312
+ '2.147.000 (+17.000)'],
1313
+ ['1',
1314
+ '1.325.000 (-18.000)',
1315
+ '1.325.000 (-18.000)',
1316
+ '1.104.000 (+8.000)',
1317
+ '1.104.000 (+8.000)'],
1318
+ ['0.5',
1319
+ '2.850.000 (-36.000)',
1320
+ '1.425.000 (-18.000)',
1321
+ '1.208.000 (+8.000)',
1322
+ '604.000 (+4.000)'],
1323
+ ['Update harga LM Antam :23 April 2024, pukul 07:56Harga pembelian kembali '
1324
+ ':Rp. 1.223.000/gram (-15.000)',
1325
+ 'Update harga LM Pegadaian :31 Agustus 2023']],
1326
+ [['Spot Harga Emas Hari Ini (Market Open)'],
1327
+ ['Satuan', 'USD', 'Kurs\xa0Dollar', 'IDR'],
1328
+ ['Ounce\xa0(oz)', '2.303,92 (-26,21)', '16.224,00 (-56,00)', '37.378.798'],
1329
+ ['Gram\xa0(gr)', '74,07', '16.224,00', '1.201.756 (-17.867)'],
1330
+ ['Kilogram\xa0(kg)', '74.072,75', '16.224,00', '1.201.756.265'],
1331
+ ['Update harga emas :23 April 2024, pukul 18:02Update kurs :23 April 2024, '
1332
+ 'pukul 13:10']],
1333
+ [['Gram', 'UBS Gold 99.99%'],
1334
+ ['Jual', 'Beli'],
1335
+ ['/ Batang', '/ Gram', '/ Batang', '/ Gram'],
1336
+ ['100',
1337
+ '126.712.000 (-1.488.000)',
1338
+ '1.267.120 (-14.880)',
1339
+ '123.735.000 (-3.350.000)',
1340
+ '1.237.350 (-33.500)'],
1341
+ ['50',
1342
+ '63.395.000 (-855.000)',
1343
+ '1.267.900 (-17.100)',
1344
+ '61.920.000 (-1.675.000)',
1345
+ '1.238.400 (-33.500)'],
1346
+ ['25',
1347
+ '31.737.000 (-413.000)',
1348
+ '1.269.480 (-16.520)',
1349
+ '31.062.500 (-837.500)',
1350
+ '1.242.500 (-33.500)'],
1351
+ ['10',
1352
+ '12.745.000 (-165.000)',
1353
+ '1.274.500 (-16.500)',
1354
+ '12.475.000 (-335.000)',
1355
+ '1.247.500 (-33.500)'],
1356
+ ['5',
1357
+ '6.400.000 (-80.000)',
1358
+ '1.280.000 (-16.000)',
1359
+ '6.289.500 (-167.500)',
1360
+ '1.257.900 (-33.500)'],
1361
+ ['1',
1362
+ '1.325.000 (-15.000)',
1363
+ '1.325.000 (-15.000)',
1364
+ '1.290.500 (-33.500)',
1365
+ '1.290.500 (-33.500)'],
1366
+ ['', 'Update :23 April 2024, pukul 11:31']],
1367
+ [['Konversi Satuan'],
1368
+ ['Satuan', 'Ounce (oz)', 'Gram (gr)', 'Kilogram (kg)'],
1369
+ ['Ounce\xa0(oz)', '1', '31,1034767696', '0,0311034768'],
1370
+ ['Gram\xa0(gr)', '0,0321507466', '1', '0.001'],
1371
+ ['Kilogram\xa0(kg)', '32,1507466000', '1.000', '1']],
1372
+ [['Pergerakan Harga Emas Dunia'],
1373
+ ['Waktu', 'Emas'],
1374
+ ['Unit', 'USD', 'IDR'],
1375
+ ['Angka', '+/-', 'Angka', '+/-'],
1376
+ ['Hari Ini', 'Kurs', '', '', '16.280', '-56-0,34%'],
1377
+ ['oz', '2.330,13', '-26,21-1,12%', '37.934.516', '-555.718-1,46%'],
1378
+ ['gr', '74,92', '-0,84-1,12%', '1.219.623', '-17.867-1,46%'],
1379
+ ['30 Hari', 'Kurs', '', '', '15.662', '+562+3,59%'],
1380
+ ['oz', '2.165,64', '+138,28+6,39%', '33.918.254', '+3.460.544+10,20%'],
1381
+ ['gr', '69,63', '+4,45+6,39%', '1.090.497', '+111.259+10,20%'],
1382
+ ['2 Bulan', 'Kurs', '', '', '15.630', '+594+3,80%'],
1383
+ ['oz', '2.038,19', '+265,73+13,04%', '31.856.910', '+5.521.888+17,33%'],
1384
+ ['gr', '65,53', '+8,54+13,04', '1.024.223', '+177.533+17,33%'],
1385
+ ['6 Bulan', 'Kurs', '', '', '15.871', '+353+2,22%'],
1386
+ ['oz', '1.984,00', '+319,92+16,13%', '31.488.064', '+5.890.734+18,71%'],
1387
+ ['gr', '63,79', '+10,29+16,13%', '1.012.365', '+189.391+18,71%'],
1388
+ ['1 Tahun', 'Kurs', '', '', '15.731', '+493+3,13%'],
1389
+ ['oz', '1.823,86', '+480,06+26,32%', '28.691.142', '+8.687.656+30,28%'],
1390
+ ['gr', '58,64', '+15,43+26,32%', '922.442', '+279.315+30,28%'],
1391
+ ['2 Tahun', 'Kurs', '', '', '14.348', '+1.876+13,07%'],
1392
+ ['oz', '1.931,96', '+371,96+19,25%', '27.719.762', '+9.659.036+34,85%'],
1393
+ ['gr', '62,11', '+11,96+19,25%', '891.211', '+310.545+34,85%'],
1394
+ ['3 Tahun', 'Kurs', '', '', '14.530', '+1.694+11,66%'],
1395
+ ['oz', '1.777,11', '+526,81+29,64%', '25.821.408', '+11.557.390+44,76%'],
1396
+ ['gr', '57,14', '+16,94+29,64%', '830.178', '+371.579+44,76%'],
1397
+ ['5 Tahun', 'Kurs', '', '', '14.154', '+2.070+14,62%'],
1398
+ ['oz', '1.277,64', '+1.026,28+80,33%', '18.083.717', '+19.295.082+106,70%'],
1399
+ ['gr', '41,08', '+33,00+80,33%', '581.405', '+620.351+106,70%']])
1400
+ (['Home', 'Emas 1 Gram', 'History', 'Trend', 'Perak 1 Gram', 'Pluang'],
1401
+ [[''],
1402
+ ['Emas 24 KaratHarga Emas 1 Gram', ''],
1403
+ ['USD', '74,07↓', '-0,85-1,13%'],
1404
+ ['KURS', '16.210,30↓', '-36,05-0,22%'],
1405
+ ['IDR', '1.200.741,47↓', '-16.360,65-1,34%'],
1406
+ ['Selasa, 23 April 2024 18:02']],
1407
+ [[''],
1408
+ ['Emas 1 Gram (IDR)Emas 1 Gram (USD)Kurs USD-IDR',
1409
+ 'Hari Ini',
1410
+ '1 Bulan',
1411
+ '1 Tahun',
1412
+ '5 Tahun',
1413
+ 'Max',
1414
+ '']],
1415
+ [['Pergerakkan Harga Emas 1 Gram'],
1416
+ ['', 'Penutupan Kemarin', 'Pergerakkan Hari Ini', 'Rata-rata'],
1417
+ ['USD', '74,92', '74,07 - 74,92', '74,50'],
1418
+ ['KURS', '16.246,35', '16.210,30 - 16.246,35', '16.228,33'],
1419
+ ['IDR', '1.217.102,12', '1.200.741,47 - 1.217.102,12', '1.208.921,80'],
1420
+ [''],
1421
+ ['', 'Awal Tahun', 'Pergerakkan YTD', '+/- YTD'],
1422
+ ['USD', '66,32', '64,07 - 77,14', '+7,75 (11,69%)'],
1423
+ ['KURS', '15.390,10', '15.390,00 - 16.307,80', '+820,20 (5,33%)'],
1424
+ ['IDR', '1.020.729,53', '997.660,12 - 1.256.829,06', '+180.011,94 (17,64%)'],
1425
+ [''],
1426
+ ['', 'Tahun Lalu / 52 Minggu', 'Pergerakkan 52 Minggu', '+/- 52 Minggu'],
1427
+ ['USD', '63,76', '58,43 - 77,14', '+10,31 (16,17%)'],
1428
+ ['KURS', '14.936,00', '14.669,40 - 16.307,80', '+1.274,30 (8,53%)'],
1429
+ ['IDR', '952.339,68', '912.925,68 - 1.256.829,06', '+248.401,79 (26,08%)']])
1448
1430
  ```
1449
1431
 
1450
- ## print_to_last_line
1451
-
1452
- `print_to_last_line(text: str)`
1432
+ ## iopen
1453
1433
 
1454
- Melakukan print ke konsol tetapi akan menimpa baris terakhir.
1455
- Berguna untuk memberikan progress secara interaktif.
1434
+ `iopen(path, data=None, regex=None, css_select=None, xpath=None, file_append=False)`
1456
1435
 
1436
+ Membaca atau Tulis pada path yang bisa merupakan FILE maupun URL.
1437
+
1438
+ Baca File :
1439
+ - Membaca seluruh file.
1440
+ - Jika berhasil content dapat diparse dengan regex.
1441
+ - Apabila File berupa html, dapat diparse dengan css atau xpath.
1442
+
1443
+ Tulis File :
1444
+ - Menulis pada file.
1445
+ - Jika file tidak ada maka akan dibuat.
1446
+ - Jika file memiliki content maka akan di overwrite.
1447
+
1448
+ Membaca URL :
1449
+ - Mengakses URL dan mengembalikan isi html nya berupa teks.
1450
+ - Content dapat diparse dengan regex, css atau xpath.
1451
+
1452
+ Tulis URL :
1453
+ - Mengirimkan data dengan metode POST ke url.
1454
+ - Jika berhasil dan response memiliki content, maka dapat diparse
1455
+ dengan regex, css atau xpath.
1456
+
1457
+
1457
1458
  ```python
1458
- c = input("masukkan apa saja : ")
1459
- print_to_last_line(f"masukkan apa saja : {c} [ok]")
1459
+ # FILE
1460
+ print(iopen("__iopen.txt", "mana aja"))
1461
+ print(iopen("__iopen.txt", regex="(\w+)"))
1462
+ # URL
1463
+ print(iopen("https://www.google.com/", css_select="a"))
1464
+ print(iopen("https://www.google.com/", dict(coba="dulu"), xpath="//a"))
1460
1465
  ```
1461
1466
 
1462
1467
  Output:
1463
1468
  ```py
1464
- masukkan apa saja : masukkan apa saja : [ok]
1469
+ 8
1470
+ ['mana', 'aja']
1471
+ [<Element a at 0x79670e3520>, <Element a at 0x7966f324e0>, <Element a at 0x7966f32580>, <Element a at 0x7966f325d0>, <Element a at 0x7966f32620>, <Element a at 0x7966f32670>, <Element a at 0x7966f326c0>, <Element a at 0x7966f32710>, <Element a at 0x7966f32760>, <Element a at 0x7966f327b0>, <Element a at 0x7966f32800>, <Element a at 0x7966f32850>, <Element a at 0x7966f328a0>, <Element a at 0x7966f328f0>, <Element a at 0x7966f32940>, <Element a at 0x7966f32990>, <Element a at 0x7966f329e0>, <Element a at 0x7966f32a30>]
1472
+ False
1465
1473
  ```
1466
1474
 
1467
- ## random_bool
1468
-
1469
- `random_bool()`
1475
+ ## iprint
1470
1476
 
1471
- Menghasilkan nilai random True atau False.
1472
- Fungsi ini merupakan fungsi tercepat untuk mendapatkan random bool.
1473
- Fungsi ini sangat cepat, tetapi pemanggilan fungsi ini membutuhkan
1474
- overhead yg besar.
1477
+ `iprint(*args, color=None, sort_dicts=False, **kwargs)`
1475
1478
 
1479
+ Improve print function dengan menambahkan color dan pretty print
1480
+ Color menggunakan colorama Fore + Back + Style
1481
+
1476
1482
  ```python
1477
- print(random_bool())
1483
+ import colorama
1484
+ iprint(
1485
+ 'yang ini',
1486
+ {'12':12,'sdsd':{'12':21,'as':[88]}},
1487
+ color=colorama.Fore.BLUE + colorama.Style.BRIGHT
1488
+ )
1478
1489
  ```
1479
1490
 
1480
1491
  Output:
1481
1492
  ```py
1482
- True
1493
+ yang ini {'12': 12, 'sdsd': {'12': 21, 'as': [88]}}
1483
1494
  ```
1484
1495
 
1485
- ## set_timeout
1486
-
1487
- `set_timeout(interval, func, args=None, kwargs=None)`
1496
+ ## irange
1488
1497
 
1489
- Menjalankan fungsi ketika sudah sekian detik.
1490
- Apabila timeout masih berjalan tapi kode sudah selesai dieksekusi semua, maka
1491
- program tidak akan berhenti sampai timeout selesai, kemudian fungsi dijalankan,
1492
- kemudian program dihentikan.
1498
+ `irange(start, finish, step=1)`
1493
1499
 
1500
+ Meningkatkan fungsi range() dari python untuk pengulangan menggunakan huruf
1501
+
1494
1502
  ```python
1495
- set_timeout(3, lambda: print("Timeout 3"))
1496
- x = set_timeout(7, print, args=["Timeout 7"])
1497
- print(x)
1498
- print("menghentikan timeout 7")
1499
- x.cancel()
1503
+ print(irange('a', 'c'))
1504
+ print(irange('z', 'a', 10))
1505
+ print(list(irange('a', 'z', 10)))
1506
+ print(list(irange(1, '7')))
1507
+ print(list(irange(10, 5)))
1500
1508
  ```
1501
1509
 
1502
1510
  Output:
1503
1511
  ```py
1504
- <Timer(Thread-2, started 481246035184)>
1505
- menghentikan timeout 7
1512
+ <generator object irange at 0x79670ae9b0>
1513
+ <generator object irange at 0x79670ae9b0>
1514
+ ['a', 'k', 'u']
1515
+ [1, 2, 3, 4, 5, 6, 7]
1516
+ [10, 9, 8, 7, 6, 5]
1506
1517
  ```
1507
1518
 
1508
- ## sets_ordered
1509
-
1510
- `sets_ordered(iterator)`
1519
+ ## ireplace
1511
1520
 
1512
- Hanya mengambil nilai unik dari suatu list
1521
+ `ireplace(string: str, replacements: dict, flags=re.IGNORECASE|re.MULTILINE|re.DOTALL)`
1513
1522
 
1523
+ STRing TRanslate mengubah string menggunakan kamus dari dict.
1524
+ Replacement dapat berupa text biasa ataupun regex pattern.
1525
+ Apabila replacement berupa regex, gunakan raw string `r"..."`
1526
+ Untuk regex capturing gunakan `(...)`, dan untuk mengaksesnya
1527
+ gunakan `\1`, `\2`, .., dst.
1528
+
1514
1529
  ```python
1515
- array = [2, 3, 12, 3, 3, 42, 42, 1, 43, 2, 42, 41, 4, 24, 32, 42, 3, 12, 32, 42, 42]
1516
- print(sets_ordered(array))
1517
- print(list(sets_ordered(array)))
1530
+ text = 'aku ini mau ke sini'
1531
+ replacements = {
1532
+ "sini": "situ",
1533
+ r"(ini)": r"itu dan \1",
1534
+ }
1535
+ print(ireplace(text, replacements))
1518
1536
  ```
1519
1537
 
1520
1538
  Output:
1521
1539
  ```py
1522
- <generator object sets_ordered at 0x700e3f4790>
1523
- [2, 3, 12, 42, 1, 43, 41, 4, 24, 32]
1540
+ aku itu dan ini mau ke situ
1524
1541
  ```
1525
1542
 
1526
- ## str_cmp
1527
-
1528
- `str_cmp(t1, t2)`
1543
+ ## iscandir
1529
1544
 
1530
- Membandingakan string secara incase-sensitive menggunakan lower().
1531
- Lebih cepat dibandingkan upper(), casefold(), re.fullmatch(), len().
1532
- perbandingan ini sangat cepat, tetapi pemanggilan fungsi ini membutuhkan
1533
- overhead yg besar.
1545
+ `iscandir(folder_name='.', glob_pattern='*', recursive=True, scan_file=True, scan_folder=True)`
1534
1546
 
1547
+ Mempermudah scandir untuk mengumpulkan folder dan file.
1548
+
1535
1549
  ```python
1536
- print(str_cmp('teks1', 'Teks1'))
1550
+ print(iscandir())
1551
+ print(list(iscandir("./", recursive=False, scan_file=False)))
1537
1552
  ```
1538
1553
 
1539
1554
  Output:
1540
1555
  ```py
1541
- True
1542
- ```
1543
-
1544
- ## text_colorize
1545
-
1546
- `text_colorize(text, color='\x1b[32m', bright='\x1b[1m', color_end='\x1b[0m')`
1547
-
1548
- return text dengan warna untuk menunjukan text penting
1549
-
1550
- ```py
1551
- text_colorize("Print some text")
1552
- text_colorize("Print some text", color=colorama.Fore.RED)
1556
+ <generator object iscandir at 0x79670d4a40>
1557
+ [PosixPath('.git'), PosixPath('.vscode'), PosixPath('pypipr'), PosixPath('__pycache__'), PosixPath('dist')]
1553
1558
  ```
1554
1559
 
1555
- ## to_str
1556
-
1557
- `to_str(value)`
1560
+ ## isplit
1558
1561
 
1559
- Mengubah value menjadi string literal
1562
+ `isplit(text, separator='', include_separator=False)`
1560
1563
 
1564
+ Memecah text menjadi list berdasarkan separator.
1565
+
1561
1566
  ```python
1562
- print(to_str(5))
1563
- print(to_str([]))
1564
- print(to_str(False))
1565
- print(to_str(True))
1566
- print(to_str(None))
1567
+ t = '/ini/contoh/path/'
1568
+ print(isplit(t, separator='/'))
1567
1569
  ```
1568
1570
 
1569
1571
  Output:
1570
1572
  ```py
1571
- 5
1572
-
1573
- False
1574
- True
1575
-
1573
+ ['', 'ini', 'contoh', 'path', '']
1576
1574
  ```
1577
1575
 
1578
1576
  # CLASS
1579
1577
 
1580
- ## APIMixinView
1581
-
1582
- `APIMixinView`
1583
-
1584
- APIView adalah class view untuk membuat Website API
1585
- Cara kerjanya adalah dengan menggunakan variabel GET untuk menerima data.
1586
-
1587
- Class ini tidak bisa digunakan sendiri.
1588
- Class ini harus menjadi mixin Class View karena perlu trigger untuk
1589
- memanggil method get().
1590
-
1591
- ```py
1592
- class ExampleAPIView(APIMixinView, View):
1593
- pass
1594
- ```
1595
-
1596
1578
  ## ComparePerformance
1597
1579
 
1598
- `ComparePerformance`
1580
+ `ComparePerformance()`
1599
1581
 
1600
1582
  Menjalankan seluruh method dalam class,
1601
1583
  Kemudian membandingkan waktu yg diperlukan.
@@ -1628,7 +1610,7 @@ print(ExampleComparePerformance().compare_performance())
1628
1610
 
1629
1611
  Output:
1630
1612
  ```py
1631
- {'a': <generator object ExampleComparePerformance.a.<locals>.<genexpr> at 0x700e3f4380>,
1613
+ {'a': <generator object ExampleComparePerformance.a.<locals>.<genexpr> at 0x79670fc450>,
1632
1614
  'b': (0, 1, 2, 3, 4, 5, 6, 7, 8, 9),
1633
1615
  'c': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
1634
1616
  'd': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]}
@@ -1639,13 +1621,9 @@ Output:
1639
1621
  {'a': 0, 'b': 0, 'c': 0, 'd': 0}
1640
1622
  ```
1641
1623
 
1642
- ## PintUregQuantity
1643
-
1644
- `PintUregQuantity`
1645
-
1646
1624
  ## RunParallel
1647
1625
 
1648
- `RunParallel`
1626
+ `RunParallel()`
1649
1627
 
1650
1628
  Menjalankan program secara bersamaan.
1651
1629
 
@@ -1688,7 +1666,7 @@ Menjalankan program secara bersamaan.
1688
1666
  Akses resource menggunakan parameter yang sudah disediakan yaitu
1689
1667
  `result: dict` dan `q: queue.Queue`.
1690
1668
 
1691
- ```python
1669
+ ```py
1692
1670
  class ExampleRunParallel(RunParallel):
1693
1671
  z = "ini"
1694
1672
 
@@ -1745,3 +1723,23 @@ if __name__ == "__main__":
1745
1723
  print(ExampleRunParallel().run_multi_processing())
1746
1724
  ```
1747
1725
 
1726
+ ## APIMixinView
1727
+
1728
+ `APIMixinView()`
1729
+
1730
+ APIView adalah class view untuk membuat Website API
1731
+ Cara kerjanya adalah dengan menggunakan variabel GET untuk menerima data.
1732
+
1733
+ Class ini tidak bisa digunakan sendiri.
1734
+ Class ini harus menjadi mixin Class View karena perlu trigger untuk
1735
+ memanggil method get().
1736
+
1737
+ ```py
1738
+ class ExampleAPIView(APIMixinView, View):
1739
+ pass
1740
+ ```
1741
+
1742
+ ## PintUregQuantity
1743
+
1744
+ `PintUregQuantity(value, units=None)`
1745
+