Skip to content

Commit

Permalink
3.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
SirDank committed Oct 22, 2024
1 parent 4a972d1 commit 1c71872
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 21 deletions.
74 changes: 61 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,25 @@
</p>

# 🚨 dankware 🚨

Python module with various features! Install with the below command!
```

```bash
pip install dankware
```

Update to the latest version with the below command!
```bash
pip install dankware[extras]
```

Update to the latest version with the below command!

```bash
pip install --upgrade dankware
```

# 🚨 Multithreading 🚨

```py
from dankware import multithread
import time
Expand All @@ -36,6 +44,7 @@ def example():

multithread(example, 10) # func: example | threads: 10 | single: 50 seconds | multi: 5 seconds
```

<img width="500" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/25fd06a6-ac4d-4f40-8b8a-24a7f0700623"><br>

```py
Expand All @@ -53,6 +62,7 @@ def example(num):
multithread(example, 10, new_list) # input_one: list
print(sum)
```

<img width="500" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/dbc2bd0a-192e-4311-8058-06ab68d01607"><br>

```py
Expand All @@ -68,6 +78,7 @@ def example(num1, num2):

multithread(example, 10, list1, list2) # input_one: list1 | input_two: list2
```

<img width="500" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/0b3e2d17-c1eb-4982-a6a8-be5bf643946b"><br>

```py
Expand All @@ -82,9 +93,10 @@ def example(num1, num2):

multithread(example, 10, new_list, 5, progress_bar=False) # input_two: 5 | disabled progress bar
```

<img width="60" alt="image" style="border-radius:5%" src="https://user-images.githubusercontent.com/52797753/153749433-95512c4d-afcd-4ad7-9797-caded6e44239.png"><br>

<p>&nbsp;</p>
<p>&nbsp;</p>

---

Expand All @@ -103,10 +115,11 @@ registry_path = r'Software\Google\Chrome\PreferenceMACs'

export_registry_keys(registry_root, registry_path, recursive=True, export_path=export_path)
```

<img width="500" alt="image" style="border-radius:5%" src="https://user-images.githubusercontent.com/52797753/221345714-f1cdea4a-0c08-4c47-8c95-c64d95d12dec.png">
<img width="500" alt="image" style="border-radius:5%" src="https://user-images.githubusercontent.com/52797753/221345782-3a5a6ef0-d3b4-48a7-b8f8-c40f210b067d.png"><br>

<p>&nbsp;</p>
<p>&nbsp;</p>

---

Expand Down Expand Up @@ -142,10 +155,11 @@ except: print(clr(err(sys.exc_info()),2))
try: value = 1/0
except: print(clr(err(sys.exc_info(),"mini"),2))
```

<img width="700" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/e2a22bab-05c7-4d10-abbe-9fcd6d3ecf4e"><br>
<img width="700" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/15a930c9-2633-42a9-a3eb-bbe0956624b0"><br>

<p>&nbsp;</p>
<p>&nbsp;</p>

---

Expand All @@ -156,16 +170,18 @@ from dankware import github_downloads
# full url > https://api.github.com/repos/EssentialsX/Essentials/releases/latest
for url in github_downloads("EssentialsX/Essentials"): print(url)
```

<img width="700" alt="image" style="border-radius:5%" src="https://user-images.githubusercontent.com/52797753/216242124-ed911013-bae4-4622-8c0a-0d11638da750.png"><br>

```py
from dankware import github_file_selector
# full url > https://api.github.com/repos/EssentialsX/Essentials/releases/latest
for url in github_file_selector("EssentialsX/Essentials", "remove", ('AntiBuild', 'Discord', 'GeoIP', 'Protect', 'XMPP')): print(url)
```

<img width="700" alt="image" style="border-radius:5%" src="https://user-images.githubusercontent.com/52797753/216241961-5359d662-a117-4eb4-b74e-e82b41a895bc.png"><br>

<p>&nbsp;</p>
<p>&nbsp;</p>

---

Expand All @@ -175,9 +191,10 @@ for url in github_file_selector("EssentialsX/Essentials", "remove", ('AntiBuild'
from dankware import random_ip
print(random_ip())
```

<img width="200" alt="image" style="border-radius:5%" src="https://user-images.githubusercontent.com/52797753/194127781-8f622448-4595-4c2a-a3e7-3e4356076840.png"><br>

<p>&nbsp;</p>
<p>&nbsp;</p>

---

Expand Down Expand Up @@ -209,9 +226,10 @@ for location in locations:
path = get_path(location)
print(path)
```

<img width="200" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/ee06bdd9-fbd3-4765-9450-6e2435dd6880"><br>

<p>&nbsp;</p>
<p>&nbsp;</p>

---

Expand All @@ -225,6 +243,7 @@ from dankware import clr
print(clr("\n > Hey! Long time no see :)"))
#print(clr("\n > Hey! Long time no see :)", colour_one = white_bright, colour_two = red_bright))
```

<img width="350" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/f8cd517e-c3df-4038-a1b1-df16f9d6ab8c"><br>

```py
Expand All @@ -234,12 +253,14 @@ from dankware import clr, white, magenta
# colour_two = white
print(clr("\n > Hey! Long time no see :)", colour_one = magenta, colour_two = white))
```

<img width="350" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/40dec334-39b7-4fcb-90c8-b6b824c372cb"><br>

```py
from dankware import clr
print(clr("\n This is a string: True | This is an integer: False"))
```

<img width="350" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/5bab7947-ffd1-49a9-b10b-dce31acf65fb"><br>

```py
Expand All @@ -248,30 +269,34 @@ from dankware import clr, green, magenta, white
# colour_two = green
print(clr(f"\n > {magenta}Purple{white} thinks he's better than everyone else :(", colour_two=green))
```

<img width="350" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/e43774dd-b76e-43af-832b-0305e282e565"><br>

```py
from dankware import clr
# preset = 2
print(clr("\n > Error in sector [7] redirecting... | INTEGRITY_CHECK: SUCCESS",2))
```

<img width="500" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/c69d3eeb-b4a0-45df-ab86-def37ac0f179"><br>

```py
from dankware import clr
# preset = 3
print(clr("\n > Is this a randomly coloured string: TRUE | As you can see it does not colour True/False",3))
```

<img width="650" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/f89c5126-c7a0-4060-ab01-8783f95224f4"><br>

```py
from dankware import clr, white, white_normal, white_dim, red, red_normal, red_dim
# preset = 3
print(clr("\n > This is a randomly coloured string based on the input colours!",3,colours=(white_bright, white_normal, white_dim, red_bright, red_normal, red_dim)))
```

<img width="650" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/bf27ee3e-a72b-4e52-85e5-85fa4df8fba6"><br>

<p>&nbsp;</p>
<p>&nbsp;</p>

---

Expand All @@ -293,28 +318,34 @@ Y88b 888 888 888 888 888 888 "88b Y88b 888 d88P 888 888 888 Y8b.
```

## ♦️ Colourize Banner (random) ♦️

```py
from dankware import clr
# preset = 4
print(clr(banner,4))
```

<img width="550" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/c34c6f9d-de2a-4a91-bb46-b262248caab4"><br>

## ♦️ Align Banner (console center) ♦️

```py
from dankware import align
print(align(banner)) # also works with single text line (even coloured)
```

<img width="800" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/678296e6-3668-4d54-bbb1-273547f7f654"><br>

## ♦️ Align Coloured Banner ♦️

```py
from dankware import align, clr
print(clr(align(banner),4)) # OR (preferably not) print(align(clr(banner,4)))
```

<img width="800" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/a90e4bc3-1c08-48e4-801a-2403c6b08d16"><br>

<p>&nbsp;</p>
<p>&nbsp;</p>

---

Expand All @@ -341,95 +372,112 @@ Y8b d88P
```

## ♦️ Black To White ♦️

```py
print(fade(banner, "black2white"))
print(fade(banner, "black2white-v"))
```

<p align="left">
<img width="400" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/9cd7e49c-fb2a-4973-87a9-6bfae1967db3" />
<img width="400" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/ed997994-8cce-47dd-bd8e-9db8293606ea" />
</p>

## ♦️ Yellow To Red ♦️

```py
print(fade(banner, "yellow2red"))
print(fade(banner, "yellow2red-v"))
```

<p align="left">
<img width="400" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/c92aed4e-a883-44c8-a9cc-c7916fae9b18" />
<img width="400" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/c9f07d49-3d7b-4213-addd-51d5af46fa87" />
</p>

## ♦️ Green To Yellow ♦️

```py
print(fade(banner, "green2yellow"))
print(fade(banner, "green2yellow-v"))
```

<p align="left">
<img width="400" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/4d6e9eed-7f51-46fe-9188-48adcb20d7c9" />
<img width="400" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/8c6c1c6a-fbcc-4170-a527-1b8856d1d1c1" />
</p>

## ♦️ Green To Cyan ♦️

```py
print(fade(banner, "green2cyan"))
print(fade(banner, "green2cyan-v"))
```

<p align="left">
<img width="400" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/5565e166-767a-4cb6-ba5a-a090b0348bc7" />
<img width="400" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/92252aaa-ad8f-42d9-93da-7e2926f69408" />
</p>

## ♦️ Blue To Cyan ♦️

```py
print(fade(banner, "blue2cyan"))
print(fade(banner, "blue2cyan-v"))
```

<p align="left">
<img width="400" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/49a6b5ee-1d23-44bb-908f-9515ff2877ca" />
<img width="400" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/6011a3ae-0922-4b4c-9ca8-33384293188c" />
</p>

## ♦️ Blue To Pink ♦️

```py
print(fade(banner, "blue2pink"))
print(fade(banner, "blue2pink-v"))
```

<p align="left">
<img width="400" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/ce5e798a-f6b9-408f-800c-980b8079caba" />
<img width="400" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/2f4fa5d0-121b-46a0-992f-457c7e404ecc" />
</p>

## ♦️ Pink To Red ♦️

```py
print(fade(banner, "pink2red"))
print(fade(banner, "pink2red-v"))
```

<p align="left">
<img width="400" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/7063ec77-16a9-42f0-9f46-3bc9284e4397" />
<img width="400" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/46ff4976-8c2a-491b-b4a5-979aab2f7a6a" />
</p>

## ♦️ Random ♦️

```py
print(fade(banner, "random"))
```

<p align="left">
<img width="400" alt="image" style="border-radius:5%" src="https://github.com/SirDank/dankware/assets/52797753/58a13389-7620-4c63-b967-c057b022af90" />
</p>

<p>&nbsp;</p>
<p>&nbsp;</p>

---

# 🚨 Also check out 🚨

<p align="center">
<a href="https://github.com/SirDank/dank.tool">
<img width="700" alt="image" src="https://user-images.githubusercontent.com/52797753/192086704-35f5a0db-3c5d-4782-95a9-6e2756cc8528.png">
</a>
</p>

<p>&nbsp;</p>
<p>&nbsp;</p>

---

Expand Down
8 changes: 4 additions & 4 deletions dankware/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@
white_dim = ''
yellow_dim = ''

from .text import clr, align, fade, random_ip
from .terminal import cls, title, rm_line, sys_open
from .multithread import multithread
from .text import clr, align, fade, random_ip # pylint: disable=wrong-import-position # noqa: E402
from .terminal import cls, title, rm_line, sys_open # pylint: disable=wrong-import-position # noqa: E402
from .multithread import multithread # pylint: disable=wrong-import-position # noqa: E402
#from .pillow import splash_screen
from .winreg import get_path
from .winreg import get_path # pylint: disable=wrong-import-position # noqa: E402

if os.name == 'nt':
from .winreg import export_registry_keys
5 changes: 2 additions & 3 deletions dankware/ctypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

if os.name == 'nt':
import ctypes
elif os.name == 'posix':
import pwd # pylint: disable=import-error

def is_admin() -> bool:

Expand All @@ -17,7 +15,8 @@ def is_admin() -> bool:
try: return ctypes.windll.shell32.IsUserAnAdmin()
except: return False
elif os.name == 'posix':
return pwd.getpwuid(os.getuid())[0] in ('root', '0') # pylint: disable=no-member
from pwd import getpwuid # pylint: disable=import-error, import-outside-toplevel
return getpwuid(os.getuid())[0] in ('root', '0') # pylint: disable=no-member
else:
raise ValueError(f"Unsupported Operating System: {os.name} | Supported: 'nt', 'posix'")

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

license = "MIT",
name = "dankware",
version = "3.6.3",
version = "3.6.4",
author = "SirDank",

author_email = "[email protected]",
Expand Down

0 comments on commit 1c71872

Please sign in to comment.