Examples

File functions

>>> file_size("datei.py",size_type="MB")
>>> "0.000046875 Megabyte"
>>> list_files_in_directory("functions")
>>> ['function_a.py', 'function_b.py']
>>> create_directory(name="passwords")
>>> password = generate_password(8,True)
>>> create_text_file(text=password,directory="passwords",filename="passwords.txt")
>>> delete_file("C:/Users/User/pythonPr/function_a.py")
>>> "0.000046875 Megabyte"

Math Functions

>>> format_number(number=1000000,decimal_places=2,trailing_zero=True)
>>> "1.00M"
>>> fibonacci(50)
>>> [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
>>> is_prime(17)
>>> True
>>> prime_numbers(25)
>>> [2, 3, 5, 7, 11, 13, 17, 19, 23]
>>> gcd(5,15)
>>> 5
>>> lcm(5,15)
>>> 15
>>> factorial(8)
>>> 40320
>>> celsius_to_fahrenheit(50.7)
>>> 123.26
>>> fahrenheit_to_celsius(150.1)
>>> 65.61111111111111
>>> int_to_roman(67)
>>> "LXVII"
>>> distance_between_points(2.3,5.7,1.9,4.6)
>>> 1.170469991071963

Random Functions

>>> generate_password(length=15,include_special=False)
>>> "a3UbfmyUCmnfqC5"
>>> random_color()
>>> "#767b1c"
>>> my_list = [1,9,7,5]
>>> random_choice(my_list)
>>> 5
>>> my_list = [1,9,7,5]
>>> shuffle_list(my_list)
>>> [7,1,5,9]

Text Functions

>>> count_lines(directory=None,include_hidden=True)
>>> 24
>>> word_count("welcome to this package")
>>> 4
>>> reverse_string("hello")
>>> "olleh"
>>> remove_punctuation("this is a nice text.")
>>> "this is a nice text"
>>> replace_substring(text="Hello my friend",old="friend",new="dear")
>>> "Hello my dear"
>>> to_snake_case("I am using Python")
>>> "I_am_using_Python"
>>> to_camel_case("It is a very nice day")
>>> "itIsAVeryNiceDay"

Time Functions

>>> current_date('UTC+2')
>>> "18.08.2024"
>>> current_time('Europe/Berlin')
>>> "22:0:6"
>>> is_leap_year(2008)
>>> True

Userinput Functions

>>> intput("Please insert an integer ")
>>> Please insert an integer 5
>>> 5
>>> floatput("Please insert a float ")
>>> Please insert a float 3.5
>>> 3.5
>>> yes_no_input("Please answer with yes or no ")
>>> Please answer with yes or no no
>>> False
>>> wait_for_key("Please press a key")

For more uses please write a discord DM to konnija