Skip to content
This repository was archived by the owner on Oct 18, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
__pycache__
testing
testing
.pypirc
build.bat
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Compilation of useful python functions.

## Changelog

### v0.2.0
#### 9/18
- Added pypi package: [usefulfunctions2](https://pypi.org/project/usefulfunctions2/)

### v0.1.0
#### 9/13
- Added changelog
Expand Down
Binary file not shown.
Binary file added dist_old/usefulfunctions2-0.0.1.tar.gz
Binary file not shown.
Binary file not shown.
Binary file added dist_old/usefulfunctions2-0.0.2.tar.gz
Binary file not shown.
31 changes: 0 additions & 31 deletions func_menu.py

This file was deleted.

22 changes: 22 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "usefulfunctions2"
version = "0.2.0"
authors = [
{ name="dimani128", email="dimani128.github@gmail.com" },
]
description = "A compilation of useful python functions."
readme = "README.md"
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]

[project.urls]
"Homepage" = "https://github.com/dimani128/UsefulPythonFunctions"
"Bug Tracker" = "https://github.com/dimani128/UsefulPythonFunctions/issues"
Empty file.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

from time import sleep
from funcs import cls
from func_cls import cls

print("This text will dissapear in 2s.")
sleep(2)
Expand Down
2 changes: 1 addition & 1 deletion example_menu.py → src/usefulfunctions2/example_menu.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from funcs import menu
from func_menu import menu

match menu("Choose a menu", ['Hi', 'hello', 'tuples']):
case 0:
Expand Down
43 changes: 43 additions & 0 deletions src/usefulfunctions2/menu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

try:
from multipledispatch import dispatch
@dispatch(list)
def menu(options:list):
return menu('', tuple(options))

@dispatch(tuple)
def menu(options:tuple):
return menu('', options)

@dispatch(str, list)
def menu(title: str, options:list):
return menu(title, tuple(options))

@dispatch(str, tuple)
def menu(title: str, options:tuple):
try:
from kiwi_menu import Menu
except ModuleNotFoundError:
raise Exception("kiwi_menu not installed. please install kiwi_menu")

menu = Menu(
title,
options
)

return menu.show_menu()
except ModuleNotFoundError:
print("multipledispatch not installed. please install multipledispatch to enable more features")

def menu(title: str, options:tuple):
try:
from kiwi_menu import Menu
except ModuleNotFoundError:
raise Exception("kiwi_menu not installed. please install kiwi_menu")

menu = Menu(
title,
options
)

return menu.show_menu()