pypipr 1.0.115__tar.gz → 1.0.116__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pypipr-1.0.115 → pypipr-1.0.116}/PKG-INFO +186 -146
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/APIMixinView.py +11 -3
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/chr_to_int.py +1 -1
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/filter_empty.py +1 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/idumps_html.py +2 -1
- pypipr-1.0.116/pypipr/ienumerate.py +15 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/iloads_html.py +2 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/irange.py +10 -5
- pypipr-1.0.116/pypipr/restart.py +17 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pyproject.toml +1 -1
- {pypipr-1.0.115 → pypipr-1.0.116}/readme.md +185 -145
- pypipr-1.0.115/pypipr/ienumerate.py +0 -5
- pypipr-1.0.115/pypipr/restart.py +0 -8
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/ComparePerformance.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/LINUX.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/PintUreg.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/PintUregQuantity.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/RunParallel.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/WINDOWS.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/__init__.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/__terminal__.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/auto_reload.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/avg.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/basename.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/batch_calculate.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/batchmaker.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/calculate.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/choices.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/choices.py.bak +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/chunk_array.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/console_run.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/create_folder.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/datetime_from_string.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/datetime_now.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/dict_first.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/dirname.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/exit_if_empty.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/get_by_index.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/get_class_method.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/get_filemtime.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/get_filesize.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/github_pull.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/github_push.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/github_user.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/iargv.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/idumps.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/ienv.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/iexec.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/ijoin.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/iloads.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/input_char.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/int_to_bin.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/int_to_chr.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/int_to_hex.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/int_to_int.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/int_to_oct.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/iopen.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/iprint.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/ireplace.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/is_empty.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/is_iterable.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/is_valid_url.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/iscandir.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/isplit.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/ivars.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/log.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/password_generator.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/pip_freeze_without_version.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/poetry_publish.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/poetry_update_version.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/print_colorize.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/print_dir.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/print_log.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/print_to_last_line.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/random_bool.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/set_timeout.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/sets_ordered.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/str_cmp.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/text_colorize.py +0 -0
- {pypipr-1.0.115 → pypipr-1.0.116}/pypipr/to_str.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pypipr
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.116
|
4
4
|
Summary: The Python Package Index Project
|
5
5
|
Author: ufiapjj
|
6
6
|
Author-email: ufiapjj@gmail.com
|
@@ -163,7 +163,7 @@ file.py
|
|
163
163
|
|
164
164
|
## chr_to_int
|
165
165
|
|
166
|
-
`chr_to_int(s, start=
|
166
|
+
`chr_to_int(s, start=0, numbers='abcdefghijklmnopqrstuvwxyz')`
|
167
167
|
|
168
168
|
Fungsi ini berguna untuk mengubah urutan huruf menjadi angka.
|
169
169
|
|
@@ -175,9 +175,9 @@ print(chr_to_int('abc', numbers="abc")) # Output: 18
|
|
175
175
|
|
176
176
|
Output:
|
177
177
|
```py
|
178
|
+
25
|
178
179
|
26
|
179
|
-
|
180
|
-
18
|
180
|
+
17
|
181
181
|
```
|
182
182
|
|
183
183
|
## int_to_chr
|
@@ -236,20 +236,30 @@ kmd
|
|
236
236
|
Meningkatkan fungsi range() dari python untuk pengulangan menggunakan huruf
|
237
237
|
|
238
238
|
```python
|
239
|
-
print(irange(
|
240
|
-
print(irange(
|
241
|
-
|
242
|
-
|
243
|
-
|
239
|
+
print(irange(10))
|
240
|
+
print(irange(3, 15))
|
241
|
+
iprint(irange(13, 5))
|
242
|
+
iprint(irange(2, 10, 3))
|
243
|
+
iprint(irange(2, '10', 3))
|
244
|
+
iprint(irange('10'))
|
245
|
+
iprint(irange('10', '100', 7))
|
246
|
+
iprint(irange("h"))
|
247
|
+
iprint(irange("A", "D"))
|
248
|
+
iprint(irange("z", "a", 4))
|
244
249
|
```
|
245
250
|
|
246
251
|
Output:
|
247
252
|
```py
|
248
|
-
<generator object
|
249
|
-
<generator object
|
250
|
-
[
|
251
|
-
[
|
252
|
-
[
|
253
|
+
<generator object int_range at 0x7c60520540>
|
254
|
+
<generator object int_range at 0x7c60520540>
|
255
|
+
[13, 12, 11, 10, 9, 8, 7, 6]
|
256
|
+
[2, 5, 8]
|
257
|
+
[2, 5, 8]
|
258
|
+
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
259
|
+
[10, 17, 24, 31, 38, 45, 52, 59, 66, 73, 80, 87, 94]
|
260
|
+
['a', 'b', 'c', 'd', 'e', 'f', 'g']
|
261
|
+
['A', 'B', 'C']
|
262
|
+
['z', 'v', 'r', 'n', 'j', 'f', 'b']
|
253
263
|
```
|
254
264
|
|
255
265
|
## batchmaker
|
@@ -273,7 +283,7 @@ print(list(batchmaker(s)))
|
|
273
283
|
|
274
284
|
Output:
|
275
285
|
```py
|
276
|
-
<generator object batchmaker at
|
286
|
+
<generator object batchmaker at 0x7c605143a0>
|
277
287
|
['Urutan 1 dan 10 dan j dan Z saja.', 'Urutan 1 dan 10 dan j dan K saja.', 'Urutan 4 dan 10 dan j dan Z saja.', 'Urutan 4 dan 10 dan j dan K saja.']
|
278
288
|
```
|
279
289
|
|
@@ -327,7 +337,7 @@ print(list(batch_calculate("{1 10} m ** {1 3}")))
|
|
327
337
|
|
328
338
|
Output:
|
329
339
|
```py
|
330
|
-
<generator object batch_calculate at
|
340
|
+
<generator object batch_calculate at 0x7c6049b010>
|
331
341
|
[('1 m ** 1', <Quantity(1, 'meter')>), ('1 m ** 2', <Quantity(1, 'meter ** 2')>), ('2 m ** 1', <Quantity(2, 'meter')>), ('2 m ** 2', <Quantity(2, 'meter ** 2')>), ('3 m ** 1', <Quantity(3, 'meter')>), ('3 m ** 2', <Quantity(3, 'meter ** 2')>), ('4 m ** 1', <Quantity(4, 'meter')>), ('4 m ** 2', <Quantity(4, 'meter ** 2')>), ('5 m ** 1', <Quantity(5, 'meter')>), ('5 m ** 2', <Quantity(5, 'meter ** 2')>), ('6 m ** 1', <Quantity(6, 'meter')>), ('6 m ** 2', <Quantity(6, 'meter ** 2')>), ('7 m ** 1', <Quantity(7, 'meter')>), ('7 m ** 2', <Quantity(7, 'meter ** 2')>), ('8 m ** 1', <Quantity(8, 'meter')>), ('8 m ** 2', <Quantity(8, 'meter ** 2')>), ('9 m ** 1', <Quantity(9, 'meter')>), ('9 m ** 2', <Quantity(9, 'meter ** 2')>)]
|
332
342
|
```
|
333
343
|
|
@@ -439,7 +449,7 @@ print(list(chunk_array(arr, 5)))
|
|
439
449
|
|
440
450
|
Output:
|
441
451
|
```py
|
442
|
-
<generator object chunk_array at
|
452
|
+
<generator object chunk_array at 0x7c60520540>
|
443
453
|
[[2, 3, 12, 3, 3], [42, 42, 1, 43, 2], [42, 41, 4, 24, 32], [42, 3, 12, 32, 42], [42]]
|
444
454
|
```
|
445
455
|
|
@@ -490,9 +500,9 @@ print(datetime_now("Etc/GMT+7"))
|
|
490
500
|
|
491
501
|
Output:
|
492
502
|
```py
|
493
|
-
2024-
|
494
|
-
2024-
|
495
|
-
2024-04-30
|
503
|
+
2024-05-01 07:44:58.980167+07:00
|
504
|
+
2024-05-01 00:44:58.982218+00:00
|
505
|
+
2024-04-30 17:44:58.988830-07:00
|
496
506
|
```
|
497
507
|
|
498
508
|
## dict_first
|
@@ -593,11 +603,13 @@ Mengembalikan iterabel yang hanya memiliki nilai
|
|
593
603
|
```python
|
594
604
|
var = [1, None, False, 0, "0", True, {}, ['eee']]
|
595
605
|
print(filter_empty(var))
|
606
|
+
iprint(filter_empty(var))
|
596
607
|
```
|
597
608
|
|
598
609
|
Output:
|
599
610
|
```py
|
600
|
-
<generator object filter_empty at
|
611
|
+
<generator object filter_empty at 0x7c6049b010>
|
612
|
+
[1, '0', True, {}, ['eee']]
|
601
613
|
```
|
602
614
|
|
603
615
|
## get_class_method
|
@@ -626,8 +638,8 @@ print(list(get_class_method(ExampleGetClassMethod)))
|
|
626
638
|
|
627
639
|
Output:
|
628
640
|
```py
|
629
|
-
<generator object get_class_method at
|
630
|
-
[<function ExampleGetClassMethod.a at
|
641
|
+
<generator object get_class_method at 0x7c6049b2e0>
|
642
|
+
[<function ExampleGetClassMethod.a at 0x7c605391c0>, <function ExampleGetClassMethod.b at 0x7c605393a0>, <function ExampleGetClassMethod.c at 0x7c605394e0>, <function ExampleGetClassMethod.d at 0x7c60539580>]
|
631
643
|
```
|
632
644
|
|
633
645
|
## get_filesize
|
@@ -698,7 +710,8 @@ Output:
|
|
698
710
|
`idumps_html(data, indent=None)`
|
699
711
|
|
700
712
|
Serialisasi python variabel menjadi HTML.
|
701
|
-
|
713
|
+
|
714
|
+
```html
|
702
715
|
List -> <ul>...</ul>
|
703
716
|
Dict -> <table>...</table>
|
704
717
|
```
|
@@ -880,7 +893,16 @@ Output:
|
|
880
893
|
|
881
894
|
## ienumerate
|
882
895
|
|
883
|
-
`ienumerate(iterator, start=0, key=<function int_to_int at
|
896
|
+
`ienumerate(iterator, start=0, key=<function int_to_int at 0x7c679d1e40>)`
|
897
|
+
|
898
|
+
meningkatkan fungsi enumerate() pada python
|
899
|
+
untuk key menggunakan huruf dan basis angka lainnya.
|
900
|
+
|
901
|
+
```python
|
902
|
+
it = ["ini", "contoh", "enumerator"]
|
903
|
+
print(ienumerate(i))
|
904
|
+
iprint(ienumerate(it, key=int_to_chr))
|
905
|
+
```
|
884
906
|
|
885
907
|
## ienv
|
886
908
|
|
@@ -945,7 +967,7 @@ print(ijoin(10, ' '))
|
|
945
967
|
|
946
968
|
Output:
|
947
969
|
```py
|
948
|
-
weq, asd, dfs
|
970
|
+
weq, qweqw, asd, dfs
|
949
971
|
,ini,path,seperti,url,
|
950
972
|
ini,path,seperti,url
|
951
973
|
<li>satu</li>
|
@@ -970,10 +992,12 @@ ini,path,seperti,url
|
|
970
992
|
Mengambil data yang berupa list `<ul>`, dan table `<table>` dari html
|
971
993
|
dan menjadikannya data python berupa list.
|
972
994
|
setiap data yang ditemukan akan dibungkus dengan tuple sebagai separator.
|
995
|
+
|
973
996
|
```
|
974
997
|
list (<ul>) -> list -> list satu dimensi
|
975
998
|
table (<table>) -> list[list] -> list satu dimensi didalam list
|
976
999
|
```
|
1000
|
+
|
977
1001
|
apabila data berupa ul maka dapat dicek type(data) -> html_ul
|
978
1002
|
apabila data berupa ol maka dapat dicek type(data) -> html_ol
|
979
1003
|
apabila data berupa dl maka dapat dicek type(data) -> html_dl
|
@@ -988,10 +1012,10 @@ pprint.pprint(iloads_html(iopen("https://harga-emas.org/1-gram/")), depth=10)
|
|
988
1012
|
Output:
|
989
1013
|
```py
|
990
1014
|
(['Home', 'Emas 1 Gram', 'History', 'Trend', 'Perak 1 Gram', 'Pluang'],
|
991
|
-
[['Harga Emas Hari Ini -
|
992
|
-
['Spot Emas USD↓2.
|
993
|
-
'Kurs
|
994
|
-
'Emas IDR↓1.
|
1015
|
+
[['Harga Emas Hari Ini - Rabu, 01 Mei 2024'],
|
1016
|
+
['Spot Emas USD↓2.288,73 (-7,29) / oz',
|
1017
|
+
'Kurs IDR16.249,00 / USD',
|
1018
|
+
'Emas IDR↓1.195.673 (-3.808) / gr'],
|
995
1019
|
['LM Antam (Jual)1.325.000 / gr', 'LM Antam (Beli)1.221.000 / gr']],
|
996
1020
|
[['Harga Emas Hari Ini'],
|
997
1021
|
['Gram', 'Gedung Antam Jakarta', 'Pegadaian'],
|
@@ -1029,10 +1053,10 @@ Output:
|
|
1029
1053
|
'Update harga LM Pegadaian :31 Agustus 2023']],
|
1030
1054
|
[['Spot Harga Emas Hari Ini (Market Open)'],
|
1031
1055
|
['Satuan', 'USD', 'Kurs\xa0Dollar', 'IDR'],
|
1032
|
-
['Ounce\xa0(oz)', '2.
|
1033
|
-
['Gram\xa0(gr)', '73,
|
1034
|
-
['Kilogram\xa0(kg)', '73.
|
1035
|
-
['Update harga emas :
|
1056
|
+
['Ounce\xa0(oz)', '2.288,73 (-7,29)', '16.249,00', '37.189.574'],
|
1057
|
+
['Gram\xa0(gr)', '73,58', '16.249,00', '1.195.673 (-3.808)'],
|
1058
|
+
['Kilogram\xa0(kg)', '73.584,38', '16.249,00', '1.195.672.562'],
|
1059
|
+
['Update harga emas :01 Mei 2024, pukul 07:44Update kurs :30 April 2024, '
|
1036
1060
|
'pukul 13:10']],
|
1037
1061
|
[['Gram', 'UBS Gold 99.99%'],
|
1038
1062
|
['Jual', 'Beli'],
|
@@ -1053,37 +1077,37 @@ Output:
|
|
1053
1077
|
['Waktu', 'Emas'],
|
1054
1078
|
['Unit', 'USD', 'IDR'],
|
1055
1079
|
['Angka', '+/-', 'Angka', '+/-'],
|
1056
|
-
['Hari Ini', 'Kurs', '', '', '16.
|
1057
|
-
['oz', '2.
|
1058
|
-
['gr', '
|
1059
|
-
['30 Hari', 'Kurs', '', '', '15.
|
1060
|
-
['oz', '2.
|
1061
|
-
['gr', '
|
1080
|
+
['Hari Ini', 'Kurs', '', '', '16.249', '%'],
|
1081
|
+
['oz', '2.296,02', '-7,29-0,32%', '37.308.029', '-118.455-0,32%'],
|
1082
|
+
['gr', '73,82', '-0,23-0,32%', '1.199.481', '-3.808-0,32%'],
|
1083
|
+
['30 Hari', 'Kurs', '', '', '15.873', '+376+2,37%'],
|
1084
|
+
['oz', '2.239,34', '+49,39+2,21%', '35.545.044', '+1.644.530+4,63%'],
|
1085
|
+
['gr', '72,00', '+1,59+2,21%', '1.142.800', '+52.873+4,63%'],
|
1062
1086
|
['2 Bulan', 'Kurs', '', '', '15.715', '+534+3,40%'],
|
1063
|
-
['oz', '2.
|
1064
|
-
['gr', '66,
|
1065
|
-
['6 Bulan', 'Kurs', '', '', '15.
|
1066
|
-
['oz', '1.
|
1067
|
-
['gr', '
|
1087
|
+
['oz', '2.082,55', '+206,18+9,90%', '32.727.273', '+4.462.301+13,63%'],
|
1088
|
+
['gr', '66,96', '+6,63+9,90', '1.052.206', '+143.466+13,63%'],
|
1089
|
+
['6 Bulan', 'Kurs', '', '', '15.861', '+388+2,45%'],
|
1090
|
+
['oz', '1.990,54', '+298,19+14,98%', '31.571.955', '+5.617.619+17,79%'],
|
1091
|
+
['gr', '64,00', '+9,59+14,98%', '1.015.062', '+180.611+17,79%'],
|
1068
1092
|
['1 Tahun', 'Kurs', '', '', '15.731', '+518+3,29%'],
|
1069
|
-
['oz', '1.823,86', '+
|
1070
|
-
['gr', '58,64', '+
|
1093
|
+
['oz', '1.823,86', '+464,87+25,49%', '28.691.142', '+8.498.432+29,62%'],
|
1094
|
+
['gr', '58,64', '+14,95+25,49%', '922.442', '+273.231+29,62%'],
|
1071
1095
|
['2 Tahun', 'Kurs', '', '', '14.418', '+1.831+12,70%'],
|
1072
|
-
['oz', '1.
|
1073
|
-
['gr', '60,
|
1096
|
+
['oz', '1.867,23', '+421,50+22,57%', '26.921.722', '+10.267.852+38,14%'],
|
1097
|
+
['gr', '60,03', '+13,55+22,57%', '865.553', '+330.119+38,14%'],
|
1074
1098
|
['3 Tahun', 'Kurs', '', '', '14.468', '+1.781+12,31%'],
|
1075
|
-
['oz', '1.768,91', '+
|
1076
|
-
['gr', '56,87', '+
|
1077
|
-
['5 Tahun', 'Kurs', '', '', '14.
|
1078
|
-
['oz', '1.
|
1079
|
-
['gr', '
|
1099
|
+
['oz', '1.768,91', '+519,82+29,39%', '25.592.590', '+11.596.984+45,31%'],
|
1100
|
+
['gr', '56,87', '+16,71+29,39%', '822.821', '+372.852+45,31%'],
|
1101
|
+
['5 Tahun', 'Kurs', '', '', '14.282', '+1.967+13,77%'],
|
1102
|
+
['oz', '1.280,82', '+1.007,91+78,69%', '18.292.671', '+18.896.903+103,30%'],
|
1103
|
+
['gr', '41,18', '+32,41+78,69%', '588.123', '+607.550+103,30%']])
|
1080
1104
|
(['Home', 'Emas 1 Gram', 'History', 'Trend', 'Perak 1 Gram', 'Pluang'],
|
1081
1105
|
[[''],
|
1082
1106
|
['Emas 24 KaratHarga Emas 1 Gram', ''],
|
1083
|
-
['USD', '73,
|
1084
|
-
['KURS', '16.
|
1085
|
-
['IDR', '1.
|
1086
|
-
['
|
1107
|
+
['USD', '73,58↓', '-0,24-0,33%'],
|
1108
|
+
['KURS', '16.264,05↑', '+3,05+0,02%'],
|
1109
|
+
['IDR', '1.196.780,01↓', '-3.586,80-0,30%'],
|
1110
|
+
['Rabu, 01 Mei 2024 07:45']],
|
1087
1111
|
[[''],
|
1088
1112
|
['Emas 1 Gram (IDR)Emas 1 Gram (USD)Kurs USD-IDR',
|
1089
1113
|
'Hari Ini',
|
@@ -1094,19 +1118,19 @@ Output:
|
|
1094
1118
|
'']],
|
1095
1119
|
[['Pergerakkan Harga Emas 1 Gram'],
|
1096
1120
|
['', 'Penutupan Kemarin', 'Pergerakkan Hari Ini', 'Rata-rata'],
|
1097
|
-
['USD', '
|
1098
|
-
['KURS', '16.
|
1099
|
-
['IDR', '1.
|
1121
|
+
['USD', '73,82', '73,58 - 73,82', '73,70'],
|
1122
|
+
['KURS', '16.261,00', '16.261,00 - 16.264,05', '16.262,53'],
|
1123
|
+
['IDR', '1.200.366,81', '1.196.780,01 - 1.200.366,81', '1.198.573,41'],
|
1100
1124
|
[''],
|
1101
1125
|
['', 'Awal Tahun', 'Pergerakkan YTD', '+/- YTD'],
|
1102
|
-
['USD', '66,32', '64,07 - 77,14', '+7,
|
1103
|
-
['KURS', '15.390,10', '15.390,00 - 16.307,80', '+
|
1104
|
-
['IDR', '1.020.729,53', '997.660,12 - 1.256.829,06', '+
|
1126
|
+
['USD', '66,32', '64,07 - 77,14', '+7,26 (10,95%)'],
|
1127
|
+
['KURS', '15.390,10', '15.390,00 - 16.307,80', '+873,95 (5,68%)'],
|
1128
|
+
['IDR', '1.020.729,53', '997.660,12 - 1.256.829,06', '+176.050,48 (17,25%)'],
|
1105
1129
|
[''],
|
1106
1130
|
['', 'Tahun Lalu / 52 Minggu', 'Pergerakkan 52 Minggu', '+/- 52 Minggu'],
|
1107
|
-
['USD', '63,97', '58,43 - 77,14', '+9,
|
1108
|
-
['KURS', '14.673,55', '14.669,40 - 16.307,80', '+1.
|
1109
|
-
['IDR', '938.709,73', '912.925,68 - 1.256.829,06', '+
|
1131
|
+
['USD', '63,97', '58,43 - 77,14', '+9,61 (15,02%)'],
|
1132
|
+
['KURS', '14.673,55', '14.669,40 - 16.307,80', '+1.590,50 (10,84%)'],
|
1133
|
+
['IDR', '938.709,73', '912.925,68 - 1.256.829,06', '+258.070,28 (27,49%)']])
|
1110
1134
|
```
|
1111
1135
|
|
1112
1136
|
## iloads
|
@@ -1236,7 +1260,7 @@ Output:
|
|
1236
1260
|
```py
|
1237
1261
|
8
|
1238
1262
|
['mana', 'aja']
|
1239
|
-
[<Element a at
|
1263
|
+
[<Element a at 0x7c60536d50>, <Element a at 0x7c60571180>, <Element a at 0x7c60571220>, <Element a at 0x7c60571270>, <Element a at 0x7c605712c0>, <Element a at 0x7c60571310>, <Element a at 0x7c60571360>, <Element a at 0x7c605713b0>, <Element a at 0x7c60571400>, <Element a at 0x7c60571450>, <Element a at 0x7c605714a0>, <Element a at 0x7c605714f0>, <Element a at 0x7c60571540>, <Element a at 0x7c60571590>, <Element a at 0x7c605715e0>, <Element a at 0x7c60571630>, <Element a at 0x7c60571680>, <Element a at 0x7c605716d0>]
|
1240
1264
|
False
|
1241
1265
|
```
|
1242
1266
|
|
@@ -1298,7 +1322,7 @@ print(list(iscandir("./", recursive=False, scan_file=False)))
|
|
1298
1322
|
|
1299
1323
|
Output:
|
1300
1324
|
```py
|
1301
|
-
<generator object iscandir at
|
1325
|
+
<generator object iscandir at 0x7c60520840>
|
1302
1326
|
[PosixPath('.git'), PosixPath('.vscode'), PosixPath('pypipr'), PosixPath('__pycache__'), PosixPath('dist')]
|
1303
1327
|
```
|
1304
1328
|
|
@@ -1335,73 +1359,73 @@ Output:
|
|
1335
1359
|
'ComparePerformance': <class 'pypipr.ComparePerformance.ComparePerformance'>,
|
1336
1360
|
'PintUregQuantity': <class 'pint.Quantity'>,
|
1337
1361
|
'RunParallel': <class 'pypipr.RunParallel.RunParallel'>},
|
1338
|
-
'function': {'avg': <function avg at
|
1339
|
-
'get_filemtime': <function get_filemtime at
|
1340
|
-
'print_colorize': <function print_colorize at
|
1341
|
-
'print_log': <function print_log at
|
1342
|
-
'console_run': <function console_run at
|
1343
|
-
'auto_reload': <function auto_reload at
|
1344
|
-
'basename': <function basename at
|
1345
|
-
'chr_to_int': <function chr_to_int at
|
1346
|
-
'int_to_chr': <function int_to_chr at
|
1347
|
-
'irange': <function irange at
|
1348
|
-
'batchmaker': <function batchmaker at
|
1349
|
-
'calculate': <function calculate at
|
1350
|
-
'batch_calculate': <function batch_calculate at
|
1351
|
-
'is_empty': <function is_empty at
|
1352
|
-
'exit_if_empty': <function exit_if_empty at
|
1353
|
-
'input_char': <function input_char at
|
1354
|
-
'get_by_index': <function get_by_index at
|
1355
|
-
'choices': <function choices at
|
1356
|
-
'chunk_array': <function chunk_array at
|
1357
|
-
'create_folder': <function create_folder at
|
1358
|
-
'datetime_from_string': <function datetime_from_string at
|
1359
|
-
'datetime_now': <function datetime_now at
|
1360
|
-
'dict_first': <function dict_first at
|
1361
|
-
'dirname': <function dirname at
|
1362
|
-
'is_iterable': <function is_iterable at
|
1363
|
-
'to_str': <function to_str at
|
1364
|
-
'filter_empty': <function filter_empty at
|
1365
|
-
'get_class_method': <function get_class_method at
|
1366
|
-
'get_filesize': <function get_filesize at
|
1367
|
-
'github_pull': <function github_pull at
|
1368
|
-
'github_push': <function github_push at
|
1369
|
-
'github_user': <function github_user at
|
1370
|
-
'iargv': <function iargv at
|
1371
|
-
'idumps_html': <function idumps_html at
|
1372
|
-
'idumps': <function idumps at
|
1373
|
-
'int_to_int': <function int_to_int at
|
1374
|
-
'ienumerate': <function ienumerate at
|
1375
|
-
'ienv': <function ienv at
|
1376
|
-
'iexec': <function iexec at
|
1377
|
-
'ijoin': <function ijoin at
|
1378
|
-
'iloads_html': <function iloads_html at
|
1379
|
-
'iloads': <function iloads at
|
1380
|
-
'int_to_bin': <function int_to_bin at
|
1381
|
-
'int_to_hex': <function int_to_hex at
|
1382
|
-
'int_to_oct': <function int_to_oct at
|
1383
|
-
'is_valid_url': <function is_valid_url at
|
1384
|
-
'iopen': <function iopen at
|
1385
|
-
'iprint': <function iprint at
|
1386
|
-
'ireplace': <function ireplace at
|
1387
|
-
'iscandir': <function iscandir at
|
1388
|
-
'isplit': <function isplit at
|
1389
|
-
'ivars': <function ivars at
|
1390
|
-
'log': <function log at
|
1391
|
-
'password_generator': <function password_generator at
|
1392
|
-
'pip_freeze_without_version': <function pip_freeze_without_version at
|
1393
|
-
'poetry_publish': <function poetry_publish at
|
1394
|
-
'poetry_update_version': <function poetry_update_version at
|
1395
|
-
'print_dir': <function print_dir at
|
1396
|
-
'print_to_last_line': <function print_to_last_line at
|
1397
|
-
'random_bool': <function random_bool at
|
1398
|
-
'restart': <function restart at
|
1399
|
-
'set_timeout': <function set_timeout at
|
1400
|
-
'sets_ordered': <function sets_ordered at
|
1401
|
-
'str_cmp': <function str_cmp at
|
1402
|
-
'text_colorize': <function text_colorize at
|
1362
|
+
'function': {'avg': <function avg at 0x7c6ccae700>,
|
1363
|
+
'get_filemtime': <function get_filemtime at 0x7c67ad32e0>,
|
1364
|
+
'print_colorize': <function print_colorize at 0x7c67ad34c0>,
|
1365
|
+
'print_log': <function print_log at 0x7c67b8ab60>,
|
1366
|
+
'console_run': <function console_run at 0x7c67ad3380>,
|
1367
|
+
'auto_reload': <function auto_reload at 0x7c67abbec0>,
|
1368
|
+
'basename': <function basename at 0x7c67ad3240>,
|
1369
|
+
'chr_to_int': <function chr_to_int at 0x7c67ad3a60>,
|
1370
|
+
'int_to_chr': <function int_to_chr at 0x7c67ad3b00>,
|
1371
|
+
'irange': <function irange at 0x7c67ad3d80>,
|
1372
|
+
'batchmaker': <function batchmaker at 0x7c67ad3740>,
|
1373
|
+
'calculate': <function calculate at 0x7c678f82c0>,
|
1374
|
+
'batch_calculate': <function batch_calculate at 0x7c67ad3600>,
|
1375
|
+
'is_empty': <function is_empty at 0x7c678f8540>,
|
1376
|
+
'exit_if_empty': <function exit_if_empty at 0x7c678f8400>,
|
1377
|
+
'input_char': <function input_char at 0x7c678f84a0>,
|
1378
|
+
'get_by_index': <function get_by_index at 0x7c678f85e0>,
|
1379
|
+
'choices': <function choices at 0x7c678f87c0>,
|
1380
|
+
'chunk_array': <function chunk_array at 0x7c678f8860>,
|
1381
|
+
'create_folder': <function create_folder at 0x7c678f8900>,
|
1382
|
+
'datetime_from_string': <function datetime_from_string at 0x7c678f89a0>,
|
1383
|
+
'datetime_now': <function datetime_now at 0x7c678f8a40>,
|
1384
|
+
'dict_first': <function dict_first at 0x7c678f8ae0>,
|
1385
|
+
'dirname': <function dirname at 0x7c678f8b80>,
|
1386
|
+
'is_iterable': <function is_iterable at 0x7c678f8d60>,
|
1387
|
+
'to_str': <function to_str at 0x7c678f8e00>,
|
1388
|
+
'filter_empty': <function filter_empty at 0x7c678f8c20>,
|
1389
|
+
'get_class_method': <function get_class_method at 0x7c678f8cc0>,
|
1390
|
+
'get_filesize': <function get_filesize at 0x7c678f8f40>,
|
1391
|
+
'github_pull': <function github_pull at 0x7c678f8fe0>,
|
1392
|
+
'github_push': <function github_push at 0x7c678f91c0>,
|
1393
|
+
'github_user': <function github_user at 0x7c678f9260>,
|
1394
|
+
'iargv': <function iargv at 0x7c678f9080>,
|
1395
|
+
'idumps_html': <function idumps_html at 0x7c678f94e0>,
|
1396
|
+
'idumps': <function idumps at 0x7c678f93a0>,
|
1397
|
+
'int_to_int': <function int_to_int at 0x7c679d1e40>,
|
1398
|
+
'ienumerate': <function ienumerate at 0x7c678f99e0>,
|
1399
|
+
'ienv': <function ienv at 0x7c679d1d00>,
|
1400
|
+
'iexec': <function iexec at 0x7c679d1ee0>,
|
1401
|
+
'ijoin': <function ijoin at 0x7c679d2020>,
|
1402
|
+
'iloads_html': <function iloads_html at 0x7c679d2200>,
|
1403
|
+
'iloads': <function iloads at 0x7c679d1f80>,
|
1404
|
+
'int_to_bin': <function int_to_bin at 0x7c679d2160>,
|
1405
|
+
'int_to_hex': <function int_to_hex at 0x7c679d22a0>,
|
1406
|
+
'int_to_oct': <function int_to_oct at 0x7c679d2340>,
|
1407
|
+
'is_valid_url': <function is_valid_url at 0x7c679d2520>,
|
1408
|
+
'iopen': <function iopen at 0x7c677be980>,
|
1409
|
+
'iprint': <function iprint at 0x7c679d2480>,
|
1410
|
+
'ireplace': <function ireplace at 0x7c679d2840>,
|
1411
|
+
'iscandir': <function iscandir at 0x7c678760c0>,
|
1412
|
+
'isplit': <function isplit at 0x7c67876160>,
|
1413
|
+
'ivars': <function ivars at 0x7c67876200>,
|
1414
|
+
'log': <function log at 0x7c678762a0>,
|
1415
|
+
'password_generator': <function password_generator at 0x7c67876340>,
|
1416
|
+
'pip_freeze_without_version': <function pip_freeze_without_version at 0x7c67876480>,
|
1417
|
+
'poetry_publish': <function poetry_publish at 0x7c67876520>,
|
1418
|
+
'poetry_update_version': <function poetry_update_version at 0x7c67876660>,
|
1419
|
+
'print_dir': <function print_dir at 0x7c67876840>,
|
1420
|
+
'print_to_last_line': <function print_to_last_line at 0x7c678768e0>,
|
1421
|
+
'random_bool': <function random_bool at 0x7c67876980>,
|
1422
|
+
'restart': <function restart at 0x7c67876a20>,
|
1423
|
+
'set_timeout': <function set_timeout at 0x7c67876ac0>,
|
1424
|
+
'sets_ordered': <function sets_ordered at 0x7c67876b60>,
|
1425
|
+
'str_cmp': <function str_cmp at 0x7c67876c00>,
|
1426
|
+
'text_colorize': <function text_colorize at 0x7c67876ca0>},
|
1403
1427
|
'variable': {'LINUX': True,
|
1404
|
-
'PintUreg': <pint.registry.UnitRegistry object at
|
1428
|
+
'PintUreg': <pint.registry.UnitRegistry object at 0x7c69c3c810>,
|
1405
1429
|
'WINDOWS': False},
|
1406
1430
|
'module': {'asyncio': <module 'asyncio' from '/data/data/com.termux/files/usr/lib/python3.11/asyncio/__init__.py'>,
|
1407
1431
|
'colorama': <module 'colorama' from '/data/data/com.termux/files/usr/lib/python3.11/site-packages/colorama/__init__.py'>,
|
@@ -1475,7 +1499,7 @@ print(password_generator())
|
|
1475
1499
|
|
1476
1500
|
Output:
|
1477
1501
|
```py
|
1478
|
-
|
1502
|
+
~,xp2sfL
|
1479
1503
|
```
|
1480
1504
|
|
1481
1505
|
## pip_freeze_without_version
|
@@ -1533,7 +1557,7 @@ Output:
|
|
1533
1557
|
__enter__ : https:/www.google.com
|
1534
1558
|
__fspath__ : https:/www.google.com
|
1535
1559
|
__getstate__ : (None, {'_drv': '', '_root': '', '_parts': ['https:', 'www.google.com'], '_str': 'https:/www.google.com'})
|
1536
|
-
__hash__ :
|
1560
|
+
__hash__ : 6827837342351708966
|
1537
1561
|
__init__ : None
|
1538
1562
|
__init_subclass__ : None
|
1539
1563
|
__module__ : pathlib
|
@@ -1546,8 +1570,8 @@ Output:
|
|
1546
1570
|
_cached_cparts : ['https:', 'www.google.com']
|
1547
1571
|
_cparts : ['https:', 'www.google.com']
|
1548
1572
|
_drv :
|
1549
|
-
_flavour : <pathlib._PosixFlavour object at
|
1550
|
-
_hash :
|
1573
|
+
_flavour : <pathlib._PosixFlavour object at 0x7c74074910>
|
1574
|
+
_hash : 6827837342351708966
|
1551
1575
|
_parts : ['https:', 'www.google.com']
|
1552
1576
|
_root :
|
1553
1577
|
_str : https:/www.google.com
|
@@ -1569,7 +1593,7 @@ Output:
|
|
1569
1593
|
is_reserved : False
|
1570
1594
|
is_socket : False
|
1571
1595
|
is_symlink : False
|
1572
|
-
iterdir : <generator object Path.iterdir at
|
1596
|
+
iterdir : <generator object Path.iterdir at 0x7c605266c0>
|
1573
1597
|
joinpath : https:/www.google.com
|
1574
1598
|
name : www.google.com
|
1575
1599
|
parent : https:
|
@@ -1616,6 +1640,14 @@ False
|
|
1616
1640
|
|
1617
1641
|
`restart(*argv)`
|
1618
1642
|
|
1643
|
+
Mengulang program dari awal seperti memulai awal.
|
1644
|
+
|
1645
|
+
Bisa ditambahkan dengan argumen tambahan
|
1646
|
+
|
1647
|
+
```py
|
1648
|
+
restart("--stdio")
|
1649
|
+
```
|
1650
|
+
|
1619
1651
|
## set_timeout
|
1620
1652
|
|
1621
1653
|
`set_timeout(interval, func, args=None, kwargs=None)`
|
@@ -1635,7 +1667,7 @@ x.cancel()
|
|
1635
1667
|
|
1636
1668
|
Output:
|
1637
1669
|
```py
|
1638
|
-
<Timer(Thread-2, started
|
1670
|
+
<Timer(Thread-2, started 534167129328)>
|
1639
1671
|
menghentikan timeout 7
|
1640
1672
|
```
|
1641
1673
|
|
@@ -1653,7 +1685,7 @@ print(list(sets_ordered(array)))
|
|
1653
1685
|
|
1654
1686
|
Output:
|
1655
1687
|
```py
|
1656
|
-
<generator object sets_ordered at
|
1688
|
+
<generator object sets_ordered at 0x7c60548e10>
|
1657
1689
|
[2, 3, 12, 42, 1, 43, 41, 4, 24, 32]
|
1658
1690
|
```
|
1659
1691
|
|
@@ -1693,11 +1725,19 @@ text_colorize("Print some text", color=colorama.Fore.RED)
|
|
1693
1725
|
`APIMixinView()`
|
1694
1726
|
|
1695
1727
|
APIView adalah class view untuk membuat Website API
|
1696
|
-
|
1728
|
+
|
1729
|
+
Cara kerjanya adalah dengan menggunakan variabel GET
|
1730
|
+
untuk menerima data.
|
1731
|
+
Cara ini dipilih untuk menghindari CORS protection.
|
1732
|
+
|
1733
|
+
Key dan value dari parameter get akan disimpan
|
1734
|
+
dalam variabel dictionary APIDict yg bisa langsung
|
1735
|
+
diakses.
|
1697
1736
|
|
1698
1737
|
Class ini tidak bisa digunakan sendiri.
|
1699
|
-
Class ini harus menjadi mixin Class View karena
|
1700
|
-
memanggil method get().
|
1738
|
+
Class ini harus menjadi mixin Class View karena
|
1739
|
+
perlu trigger untuk memanggil method get().
|
1740
|
+
|
1701
1741
|
|
1702
1742
|
```py
|
1703
1743
|
class ExampleAPIView(APIMixinView, View):
|
@@ -1739,7 +1779,7 @@ print(ExampleComparePerformance().compare_performance())
|
|
1739
1779
|
|
1740
1780
|
Output:
|
1741
1781
|
```py
|
1742
|
-
{'a': <generator object ExampleComparePerformance.a.<locals>.<genexpr> at
|
1782
|
+
{'a': <generator object ExampleComparePerformance.a.<locals>.<genexpr> at 0x7c60548930>,
|
1743
1783
|
'b': (0, 1, 2, 3, 4, 5, 6, 7, 8, 9),
|
1744
1784
|
'c': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
|
1745
1785
|
'd': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]}
|
@@ -4,11 +4,19 @@ from django.http.response import HttpResponse
|
|
4
4
|
class APIMixinView:
|
5
5
|
"""
|
6
6
|
APIView adalah class view untuk membuat Website API
|
7
|
-
|
7
|
+
|
8
|
+
Cara kerjanya adalah dengan menggunakan variabel GET
|
9
|
+
untuk menerima data.
|
10
|
+
Cara ini dipilih untuk menghindari CORS protection.
|
11
|
+
|
12
|
+
Key dan value dari parameter get akan disimpan
|
13
|
+
dalam variabel dictionary APIDict yg bisa langsung
|
14
|
+
diakses.
|
8
15
|
|
9
16
|
Class ini tidak bisa digunakan sendiri.
|
10
|
-
Class ini harus menjadi mixin Class View karena
|
11
|
-
memanggil method get().
|
17
|
+
Class ini harus menjadi mixin Class View karena
|
18
|
+
perlu trigger untuk memanggil method get().
|
19
|
+
|
12
20
|
|
13
21
|
```py
|
14
22
|
class ExampleAPIView(APIMixinView, View):
|
@@ -0,0 +1,15 @@
|
|
1
|
+
from .int_to_int import int_to_int
|
2
|
+
|
3
|
+
def ienumerate(iterator, start=0, key=int_to_int):
|
4
|
+
"""
|
5
|
+
meningkatkan fungsi enumerate() pada python
|
6
|
+
untuk key menggunakan huruf dan basis angka lainnya.
|
7
|
+
|
8
|
+
```python
|
9
|
+
it = ["ini", "contoh", "enumerator"]
|
10
|
+
print(ienumerate(i))
|
11
|
+
iprint(ienumerate(it, key=int_to_chr))
|
12
|
+
```
|
13
|
+
"""
|
14
|
+
for i, v in enumerate(iterator, start):
|
15
|
+
yield (key(i), v)
|