LeonPy 0.1.4__tar.gz
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-0.1.4/LeonPy/__init__.py +1 -0
- leonpy-0.1.4/LeonPy/tools.py +86 -0
- leonpy-0.1.4/LeonPy.egg-info/PKG-INFO +10 -0
- leonpy-0.1.4/LeonPy.egg-info/SOURCES.txt +8 -0
- leonpy-0.1.4/LeonPy.egg-info/dependency_links.txt +1 -0
- leonpy-0.1.4/LeonPy.egg-info/top_level.txt +1 -0
- leonpy-0.1.4/PKG-INFO +10 -0
- leonpy-0.1.4/pyproject.toml +13 -0
- leonpy-0.1.4/setup.cfg +4 -0
- leonpy-0.1.4/setup.py +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .tools import uniqueinstr, stringinfo
|
|
@@ -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 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
LeonPy
|
leonpy-0.1.4/PKG-INFO
ADDED
|
@@ -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,13 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "LeonPy"
|
|
7
|
+
version = "0.1.4"
|
|
8
|
+
description = "Mini biblioteka maturalna do pracy ze stringami"
|
|
9
|
+
authors = [
|
|
10
|
+
{ name = "Leon Hajnos", email = "leon.hajnos@sto64.krakow.pl" }
|
|
11
|
+
]
|
|
12
|
+
requires-python = ">=3.8"
|
|
13
|
+
readme = "README.md"
|
leonpy-0.1.4/setup.cfg
ADDED
leonpy-0.1.4/setup.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name="LeonPy",
|
|
5
|
+
version="0.1.4",
|
|
6
|
+
description="Mini biblioteka maturalna do pracy ze stringami",
|
|
7
|
+
author="Leon Hajnos",
|
|
8
|
+
author_email="leon.hajnos@sto64.krakow.pl",
|
|
9
|
+
packages=find_packages(),
|
|
10
|
+
python_requires=">=3.8",
|
|
11
|
+
)
|