Skip to main content

Python module with various features.

Project description

~ Visits ~

dankware

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

pip install dankware

Update to the latest version with the below command!

pip install --upgrade dankware

Multithreading

from dankware import multithread
import time

a = 0
def example():
    global a
    a += 1
    print(a)
    time.sleep(5)
        
multithread(example, 10) # func: example | threads: 10 | single: 50 seconds | multi: 5 seconds
image
from dankware import multithread
import time

new_list = [1, 2, 3, 4, 5]; sum = 0

def example(num):
    global sum
    sum += num
    time.sleep(5)

multithread(example, 10, new_list) # input_one: list
print(sum)
image
from dankware import multithread
import time

list1 = [1, 2, 3, 4, 5]
list2 = [5, 4, 3, 2, 1]

def example(num1, num2):
    print(num1 + num2)
    time.sleep(5)

multithread(example, 10, list1, list2) # input_one: list1 | input_two: list2
image
from dankware import multithread
import time

new_list = [1, 2, 3, 4, 5]

def example(num1, num2):
    print(num1 * num2)
    time.sleep(5)

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

 


Scraping

from dankware import github_downloads
for url in github_downloads("https://api.github.com/repos/EssentialsX/Essentials/releases/latest"): print(url)
image

 


Colour Special Characters

from dankware import clr
print(clr("\n  > Hey! Long time no see :)"))
image
from dankware import clr
print(clr("\n  This is a string: True | This is an integer: False"))
image
from dankware import clr, green, magenta # dankware now supports adding custom colours on both the text and the function itself!
print(clr(f"\n  > {magenta}Purple{white} thinks he's better than everyone else :(", colour=green))
image
from dankware import clr
print(clr("\n  > Error in sector [7] redirecting... | INTEGRITY_CHECK_SUCCESS: TRUE",2))
image
from dankware import clr
print(clr("\n  > Is this a randomly coloured string: TRUE | As you can see it does not colour True/False",3))
image

 


Banners

banner = '''

     888                   888                                             
     888                   888           s i r . d a n k ' s               
     888                   888                                             
 .d88888  8888b.  88888b.  888  888 888  888  888  8888b.  888d888 .d88b.  
d88" 888     "88b 888 "88b 888 .88P 888  888  888     "88b 888P"  d8P  Y8b 
888  888 .d888888 888  888 888888K  888  888  888 .d888888 888    88888888 
Y88b 888 888  888 888  888 888 "88b Y88b 888 d88P 888  888 888    Y8b.     
 "Y88888 "Y888888 888  888 888  888  "Y8888888P"  "Y888888 888     "Y8888  

'''

Colourize Banner (random)

from dankware import clr_banner
print(clr_banner(banner))
image

Align Banner (console center)

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

Align Coloured Banner

from dankware import align, clr_banner
print(align(clr_banner(banner)))
image

 


Gradient Reworked [ Originally By @venaxyt ]

from dankware import fade
banner = '''

                              888 d8b                   888    
       v e n a x y t ' s      888 Y8P                   888    
                              888                       888    
 .d88b.  888d888 8888b.   .d88888 888  .d88b.  88888b.  888888 
d88P"88b 888P"      "88b d88" 888 888 d8P  Y8b 888 "88b 888    
888  888 888    .d888888 888  888 888 88888888 888  888 888    
Y88b 888 888    888  888 Y88b 888 888 Y8b.     888  888 Y88b.  
 "Y88888 888    "Y888888  "Y88888 888  "Y8888  888  888  "Y888 
     888                                                       
Y8b d88P                                                       
 "Y88P"                                                        


'''

Black

print(fade(banner, "black"))
image
print(fade(banner, "black-v"))
image

Red

print(fade(banner, "red"))
image
print(fade(banner, "red-v"))
image

Green

print(fade(banner, "green"))
image
print(fade(banner, "green-v"))
image

Cyan

from dankware import fade
print(fade(banner, "cyan"))
image
print(fade(banner, "cyan-v"))
image

Blue

print(fade(banner, "blue"))
image
print(fade(banner, "blue-v"))
image

Purple

print(fade(banner, "purple"))
image
print(fade(banner, "purple-v"))
image

Pink

print(fade(banner, "pink-v"))
image

Random

print(fade(banner, "random"))
image

 


🚨 Also check out 🚨

image

 


Project details


Release history Release notifications | RSS feed

This version

2.4.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dankware-2.4.2.tar.gz (12.4 kB view hashes)

Uploaded Source

Built Distribution

dankware-2.4.2-py3-none-any.whl (9.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page