hmkkit 1.0.0__py3-none-any.whl
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.
- hmkkit/__init__.py +4 -0
- hmkkit/hmkmath.py +16 -0
- hmkkit/hmkrandom.py +6 -0
- hmkkit/hmkstr.py +4 -0
- hmkkit/hmkutilities.py +17 -0
- hmkkit-1.0.0.dist-info/METADATA +133 -0
- hmkkit-1.0.0.dist-info/RECORD +11 -0
- hmkkit-1.0.0.dist-info/WHEEL +5 -0
- hmkkit-1.0.0.dist-info/licenses/IMPORTANT.txt +48 -0
- hmkkit-1.0.0.dist-info/licenses/LICENSE.txt +52 -0
- hmkkit-1.0.0.dist-info/top_level.txt +1 -0
hmkkit/__init__.py
ADDED
hmkkit/hmkmath.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
def average(*x) -> float: return sum(x)/len(x)
|
|
2
|
+
def multiplier(x): return lambda u: x*u
|
|
3
|
+
def divider(x): return lambda y: x/y
|
|
4
|
+
def incrementer(x): return lambda y: x+y
|
|
5
|
+
def decrementer(x): return lambda y: x-y
|
|
6
|
+
def percentage(x,y) -> float: return x/y*100
|
|
7
|
+
def per_mille(x,y) -> float: return x/y*1000
|
|
8
|
+
def even(x) -> bool: return x%2==0
|
|
9
|
+
def parity(x) -> str: return "even" if x%2==0 else "odd"
|
|
10
|
+
def odd(x) -> bool: return x%2==1
|
|
11
|
+
def composite(x) -> bool: return x > 1 and not prime(x)
|
|
12
|
+
def clamp(x, y, z): return max(y, min(x, z))
|
|
13
|
+
def sign(x): return (x > 0) - (x < 0)
|
|
14
|
+
def prime(x) -> bool: return x > 1 and all(x % i for i in range(2, int(x**0.5)+1))
|
|
15
|
+
def primality(x) -> str: return "prime" if prime(x) else "composite"if composite(x) else "neither"
|
|
16
|
+
def perfect(x) -> bool: return x > 1 and sum(i for i in range(1,x) if x%i==0)==x
|
hmkkit/hmkrandom.py
ADDED
hmkkit/hmkstr.py
ADDED
hmkkit/hmkutilities.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
def inspect(x) -> None: print(x); print(type(x))
|
|
2
|
+
def noop() -> None: pass
|
|
3
|
+
def flatten(x) -> list: return [i for sub in x for i in sub]
|
|
4
|
+
def unique(x) -> list: return list(dict.fromkeys(x))
|
|
5
|
+
def frequency(x) -> dict: return {i: x.count(i) for i in set(x)}
|
|
6
|
+
def empty(x) -> bool: return len(x)==0
|
|
7
|
+
def exists(x) -> bool: return len(x)>0
|
|
8
|
+
def between(x,y,z) -> bool: return y<=x<=z
|
|
9
|
+
def sign(x) -> int: return (x>0)-(x<0)
|
|
10
|
+
def timestamp() -> float:
|
|
11
|
+
import time; return time.time()
|
|
12
|
+
def elapsed(x) -> float:
|
|
13
|
+
import time; return time.time()-x
|
|
14
|
+
def filesize(x) -> int:
|
|
15
|
+
import os; return os.path.getsize(x)
|
|
16
|
+
def existsfile(x) -> bool:
|
|
17
|
+
import os; return os.path.exists(x)
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hmkkit
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A collection of useful Python functions created by Hmkings.
|
|
5
|
+
Author-email: Hmkings <hmkings37@gmail.com>
|
|
6
|
+
License-Expression: LicenseRef-HmkKit
|
|
7
|
+
Keywords: hmkkit,python,utilities,math,random,strings
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
12
|
+
Requires-Python: >=3.10
|
|
13
|
+
Description-Content-Type: text/plain
|
|
14
|
+
License-File: LICENSE.txt
|
|
15
|
+
License-File: IMPORTANT.txt
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
==================================================
|
|
19
|
+
HMKKIT
|
|
20
|
+
Python Utility Library
|
|
21
|
+
|
|
22
|
+
Created and developed by Hmkings.
|
|
23
|
+
|
|
24
|
+
ABOUT
|
|
25
|
+
|
|
26
|
+
HmkKit is a Python library containing a collection
|
|
27
|
+
of useful functions for mathematics, random
|
|
28
|
+
generation, string manipulation, and general
|
|
29
|
+
utilities.
|
|
30
|
+
|
|
31
|
+
It is designed to make common operations easier
|
|
32
|
+
to use through simple Python functions.
|
|
33
|
+
|
|
34
|
+
AUTHOR
|
|
35
|
+
|
|
36
|
+
Hmkings
|
|
37
|
+
|
|
38
|
+
VERSION
|
|
39
|
+
|
|
40
|
+
1.0.0
|
|
41
|
+
|
|
42
|
+
MODULES
|
|
43
|
+
|
|
44
|
+
1. hmkmath.py
|
|
45
|
+
Mathematical functions, including:
|
|
46
|
+
|
|
47
|
+
- Average
|
|
48
|
+
- Percentage and per-mille
|
|
49
|
+
- Even and odd checks
|
|
50
|
+
- Prime number checks
|
|
51
|
+
- Factors
|
|
52
|
+
- Midpoint
|
|
53
|
+
- Distance
|
|
54
|
+
- Root
|
|
55
|
+
|
|
56
|
+
2. hmkrandom.py
|
|
57
|
+
Random generation functions, including:
|
|
58
|
+
|
|
59
|
+
- Dice
|
|
60
|
+
- Random integer from 0 to 100
|
|
61
|
+
- Random decimal from 0 to 100
|
|
62
|
+
|
|
63
|
+
3. hmkstr.py
|
|
64
|
+
String functions, including:
|
|
65
|
+
|
|
66
|
+
- Character counting
|
|
67
|
+
- Isogram checking
|
|
68
|
+
- Reversing strings
|
|
69
|
+
- Palindrome checking
|
|
70
|
+
|
|
71
|
+
4. hmkutilities.py
|
|
72
|
+
General utility functions.
|
|
73
|
+
|
|
74
|
+
INSTALLATION
|
|
75
|
+
|
|
76
|
+
PyPI installation:
|
|
77
|
+
|
|
78
|
+
pip install hmkkit
|
|
79
|
+
|
|
80
|
+
Alternatively, download the ZIP distribution
|
|
81
|
+
and extract the package manually.
|
|
82
|
+
|
|
83
|
+
USAGE
|
|
84
|
+
|
|
85
|
+
Import the library:
|
|
86
|
+
|
|
87
|
+
import hmkkit
|
|
88
|
+
|
|
89
|
+
Example:
|
|
90
|
+
|
|
91
|
+
print(hmkkit.average(10, 20, 30))
|
|
92
|
+
print(hmkkit.prime(17))
|
|
93
|
+
hmkkit.inspect("Hello")
|
|
94
|
+
|
|
95
|
+
Import individual modules:
|
|
96
|
+
|
|
97
|
+
from hmkkit import hmkmath
|
|
98
|
+
from hmkkit import hmkrandom
|
|
99
|
+
from hmkkit import hmkstr
|
|
100
|
+
|
|
101
|
+
Example:
|
|
102
|
+
|
|
103
|
+
print(hmkmath.midpoint(10, 20))
|
|
104
|
+
print(hmkrandom.dice())
|
|
105
|
+
print(hmkstr.reverse("Hello"))
|
|
106
|
+
|
|
107
|
+
COPYRIGHT AND LICENSE
|
|
108
|
+
|
|
109
|
+
Copyright © 2026 Hmkings.
|
|
110
|
+
|
|
111
|
+
HmkKit is subject to its accompanying custom
|
|
112
|
+
software license.
|
|
113
|
+
|
|
114
|
+
Personal use, educational use, private copies,
|
|
115
|
+
and private modifications are permitted.
|
|
116
|
+
|
|
117
|
+
Public redistribution and other restricted
|
|
118
|
+
activities require prior written permission.
|
|
119
|
+
|
|
120
|
+
See LICENSE.txt and IMPORTANT.txt for details.
|
|
121
|
+
|
|
122
|
+
CONTACT
|
|
123
|
+
|
|
124
|
+
Primary:
|
|
125
|
+
hmkings37@gmail.com
|
|
126
|
+
|
|
127
|
+
Secondary:
|
|
128
|
+
hmkhmk@gmail.com
|
|
129
|
+
|
|
130
|
+
==================================================
|
|
131
|
+
HmkKit - Made by Hmkings
|
|
132
|
+
🦍
|
|
133
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
hmkkit/__init__.py,sha256=VBuvAHvvRR6Pu64p1nqh97Flm-XAd8D0DDdCo21yr8A,98
|
|
2
|
+
hmkkit/hmkmath.py,sha256=ic-HVyGfdbvNC33plUl4aAzxSp-nKfzmkppc197G40w,884
|
|
3
|
+
hmkkit/hmkrandom.py,sha256=ZbjlsPYVYzjk1zEJ7_sqQji3tcDwAvQyik41Hecjqwg,197
|
|
4
|
+
hmkkit/hmkstr.py,sha256=1fiQFHCybO8xKkbqMo3N2lSz-sPxf8OILWB2PVvpEkw,200
|
|
5
|
+
hmkkit/hmkutilities.py,sha256=a_PFvDicjdcxVEnq6cp9gxhUNYB_BdAOByib2NzfnOA,734
|
|
6
|
+
hmkkit-1.0.0.dist-info/licenses/IMPORTANT.txt,sha256=ooZ4DT2yr3SfdExwYqgd8zKJFnz-kR_FmQiTuyiZWqo,1535
|
|
7
|
+
hmkkit-1.0.0.dist-info/licenses/LICENSE.txt,sha256=DJ_JbcSKekymZDRYXrT7GfXGu5-O10Sf-pGNst8OKnk,1323
|
|
8
|
+
hmkkit-1.0.0.dist-info/METADATA,sha256=iMLy2zfDp7hPt0tkIoMHkKm3YaHPQ-WU_hLN7gnfmJw,5309
|
|
9
|
+
hmkkit-1.0.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
10
|
+
hmkkit-1.0.0.dist-info/top_level.txt,sha256=LpubRwvmaJtNHlv9pFLAMuQH_Z4xsQueNsGKD5pbdRQ,7
|
|
11
|
+
hmkkit-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
HMKKIT – COPYRIGHT & USAGE LICENSE
|
|
2
|
+
|
|
3
|
+
Copyright © 2026 Hmkings. All Rights Reserved.
|
|
4
|
+
|
|
5
|
+
HmkKit is an original software project created and developed by Hmkings. All original code, functions, modules, and other project components are owned by Hmkings.
|
|
6
|
+
|
|
7
|
+
1. Permitted Use
|
|
8
|
+
|
|
9
|
+
You are explicitly allowed to:
|
|
10
|
+
|
|
11
|
+
- Use HmkKit for personal, educational, and non-commercial purposes.
|
|
12
|
+
- Download and keep private copies of the software.
|
|
13
|
+
- Modify your private copies for your own use.
|
|
14
|
+
- Experiment with the code and learn from its implementation.
|
|
15
|
+
|
|
16
|
+
No additional permission is required for these permitted activities.
|
|
17
|
+
|
|
18
|
+
2. Restrictions
|
|
19
|
+
|
|
20
|
+
Without prior written permission from Hmkings, you may not:
|
|
21
|
+
|
|
22
|
+
- Redistribute or publicly share the original software.
|
|
23
|
+
- Publish modified versions of HmkKit.
|
|
24
|
+
- Reupload the project or its source code to other platforms.
|
|
25
|
+
- Claim authorship or ownership of the original project.
|
|
26
|
+
- Sell, sublicense, or commercially redistribute HmkKit.
|
|
27
|
+
|
|
28
|
+
3. Permission Requests
|
|
29
|
+
|
|
30
|
+
If you wish to redistribute, republish, commercially use, or otherwise use HmkKit beyond the permissions listed above, you must obtain written authorization from the copyright owner.
|
|
31
|
+
|
|
32
|
+
Primary contact:
|
|
33
|
+
hmkings37@gmail.com
|
|
34
|
+
|
|
35
|
+
Secondary contact:
|
|
36
|
+
hmkhmk@gmail.com
|
|
37
|
+
|
|
38
|
+
4. Ownership
|
|
39
|
+
|
|
40
|
+
Creating a private copy or modifying the software for personal use does not transfer ownership of the original project.
|
|
41
|
+
|
|
42
|
+
All original intellectual property remains the property of Hmkings.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
Created, developed, and owned by Hmkings.
|
|
47
|
+
|
|
48
|
+
Copyright © 2026 Hmkings. All Rights Reserved.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
Version 1.0
|
|
2
|
+
|
|
3
|
+
1. PERMITTED ACTIVITIES
|
|
4
|
+
|
|
5
|
+
Users are allowed to:
|
|
6
|
+
|
|
7
|
+
- Use HmkKit for personal, educational, and non-commercial purposes.
|
|
8
|
+
- Download and keep private copies.
|
|
9
|
+
- Modify private copies for personal use.
|
|
10
|
+
- Study the source code and use it for learning.
|
|
11
|
+
|
|
12
|
+
No additional permission is required for these activities.
|
|
13
|
+
|
|
14
|
+
2. RESTRICTED ACTIVITIES
|
|
15
|
+
|
|
16
|
+
Without prior written permission from Hmkings, users may not:
|
|
17
|
+
|
|
18
|
+
- Publicly redistribute or share HmkKit.
|
|
19
|
+
- Publish or distribute modified versions.
|
|
20
|
+
- Upload the original source code to other public platforms.
|
|
21
|
+
- Sell or commercially distribute HmkKit.
|
|
22
|
+
- Claim ownership or authorship of HmkKit's original code.
|
|
23
|
+
|
|
24
|
+
3. MODIFICATIONS
|
|
25
|
+
|
|
26
|
+
Users may modify their own private copies.
|
|
27
|
+
|
|
28
|
+
However, permission to modify a private copy does not grant permission to publish, distribute, or commercially use that modified version.
|
|
29
|
+
|
|
30
|
+
4. PERMISSION REQUESTS
|
|
31
|
+
|
|
32
|
+
Written authorization is required for activities restricted by this license.
|
|
33
|
+
|
|
34
|
+
Primary contact:
|
|
35
|
+
hmkings37@gmail.com
|
|
36
|
+
|
|
37
|
+
Secondary contact:
|
|
38
|
+
hmkhmk@gmail.com
|
|
39
|
+
|
|
40
|
+
5. DISCLAIMER
|
|
41
|
+
|
|
42
|
+
HmkKit is provided "AS IS", without warranties of any kind, to the extent permitted by applicable law.
|
|
43
|
+
|
|
44
|
+
6. ACCEPTANCE
|
|
45
|
+
|
|
46
|
+
By using or distributing HmkKit, users agree to comply with the applicable terms of this license.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
HmkKit
|
|
51
|
+
Created and developed by Hmkings.
|
|
52
|
+
Version 1.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
hmkkit
|