LeonPy 0.1.4__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.
LeonPy/__init__.py ADDED
@@ -0,0 +1 @@
1
+ from .tools import uniqueinstr, stringinfo
LeonPy/tools.py ADDED
@@ -0,0 +1,86 @@
1
+ class uniqueinstr:
2
+
3
+ @staticmethod
4
+ def count(string):
5
+ d = {}
6
+ for ch in string:
7
+ d[ch] = d.get(ch, 0) + 1
8
+ return d
9
+
10
+ @staticmethod
11
+ def as_dict(string):
12
+ return uniqueinstr.count(string)
13
+
14
+ @staticmethod
15
+ def as_list(string):
16
+ return list(uniqueinstr.count(string).items())
17
+
18
+ @staticmethod
19
+ def max(string):
20
+ counts = uniqueinstr.count(string)
21
+ max_val = max(counts.values())
22
+ return [(k, v) for k, v in counts.items() if v == max_val]
23
+ @staticmethod
24
+ def max_value(string):
25
+ counts = uniqueinstr.count(string)
26
+ max_val = max(counts.values())
27
+ return max_val
28
+ @staticmethod
29
+ def min(string):
30
+ counts = uniqueinstr.count(string)
31
+ min_val = min(counts.values())
32
+ return [(k, v) for k, v in counts.items() if v == min_val]
33
+ def min_value(string):
34
+ counts = uniqueinstr.count(string)
35
+ min_val = min(counts.values())
36
+ return min_val
37
+
38
+ @staticmethod
39
+ def unique(string):
40
+ counts = uniqueinstr.count(string)
41
+ return [(k, v) for k, v in counts.items() if v == 1]
42
+
43
+ class stringinfo:
44
+
45
+ @staticmethod
46
+ def length(string):
47
+ return len(string)
48
+
49
+ @staticmethod
50
+ def palindrome(string):
51
+ return string == string[::-1]
52
+
53
+ @staticmethod
54
+ def reversed(string):
55
+ return string[::-1]
56
+
57
+ @staticmethod
58
+ def words(string):
59
+ return string.split()
60
+
61
+ @staticmethod
62
+ def without_spaces(string):
63
+ return string.replace(" ", "")
64
+
65
+ class math:
66
+ @staticmethod
67
+ def fact(num):
68
+ s = 1
69
+ for i in range(num):
70
+ s = s*(i+1)
71
+ return s
72
+ @staticmethod
73
+ def nwd(numa,numb):
74
+ while numb != 0:
75
+ numa,numb = numb, numa%numb
76
+ return numa
77
+ @staticmethod
78
+ def nww(a,b):
79
+ c = math.nwd(a,b)
80
+ return a*b/c
81
+
82
+
83
+
84
+
85
+
86
+
@@ -0,0 +1,10 @@
1
+ Metadata-Version: 2.4
2
+ Name: LeonPy
3
+ Version: 0.1.4
4
+ Summary: Mini biblioteka maturalna do pracy ze stringami
5
+ Author: Leon Hajnos
6
+ Author-email: Leon Hajnos <leon.hajnos@sto64.krakow.pl>
7
+ Requires-Python: >=3.8
8
+ Description-Content-Type: text/markdown
9
+ Dynamic: author
10
+ Dynamic: requires-python
@@ -0,0 +1,6 @@
1
+ LeonPy/__init__.py,sha256=r3CdbknjEvsRs0Czubh_yhfi0lRiovbrgj9ei6pl0Ak,42
2
+ LeonPy/tools.py,sha256=nt3wkwtHm5QdAsJ_TweVXOXFXnhwQNT8uQ-7iHtUa4Q,1922
3
+ leonpy-0.1.4.dist-info/METADATA,sha256=wsBBohoju3vobD2w7SDxMw94trd0uoJFkUahcxEfXvA,287
4
+ leonpy-0.1.4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
5
+ leonpy-0.1.4.dist-info/top_level.txt,sha256=eQoscQhdB4RZLKhKO1ez3HSbn4NeQVvw-LzyXiXGK0w,7
6
+ leonpy-0.1.4.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ LeonPy