homa 0.17__py3-none-any.whl → 0.18__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.
Potentially problematic release.
This version of homa might be problematic. Click here for more details.
- homa/helpers.py +8 -21
- homa/repositories/RandomNameRepository.py +7 -4
- homa/repositories/RandomTextRepository.py +2 -4
- {homa-0.17.dist-info → homa-0.18.dist-info}/METADATA +3 -1
- homa-0.18.dist-info/RECORD +17 -0
- homa-0.17.dist-info/RECORD +0 -17
- /homa/wordlists/{feminine_names.txt → feminine.txt} +0 -0
- /homa/wordlists/{masculine_names.txt → masculine.txt} +0 -0
- {homa-0.17.dist-info → homa-0.18.dist-info}/LICENSE +0 -0
- {homa-0.17.dist-info → homa-0.18.dist-info}/WHEEL +0 -0
- {homa-0.17.dist-info → homa-0.18.dist-info}/top_level.txt +0 -0
homa/helpers.py
CHANGED
|
@@ -7,16 +7,17 @@ import pkg_resources
|
|
|
7
7
|
|
|
8
8
|
def resource(name: str):
|
|
9
9
|
"""
|
|
10
|
-
The function `resource` takes a string
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
The function `resource` takes a string `name` as input and returns the filename of a resource in the
|
|
11
|
+
"homa" package.
|
|
12
|
+
|
|
13
13
|
:param name: The `name` parameter in the `resource` function is a string that represents the name of
|
|
14
|
-
the resource file you want to
|
|
14
|
+
the resource file you want to retrieve the filename for using `pkg_resources.resource_filename`
|
|
15
|
+
function
|
|
15
16
|
:type name: str
|
|
16
|
-
:return: The `resource` function is returning the filename of
|
|
17
|
-
|
|
17
|
+
:return: The `resource` function is returning the filename of the specified resource within the
|
|
18
|
+
"homa" package using `pkg_resources.resource_filename`.
|
|
18
19
|
"""
|
|
19
|
-
return pkg_resources.resource_filename("homa
|
|
20
|
+
return pkg_resources.resource_filename("homa", name)
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
def replaceVowels(raw: str) -> str:
|
|
@@ -98,20 +99,6 @@ def oneOf(values: list) -> any:
|
|
|
98
99
|
return values[randint(0, len(values))]
|
|
99
100
|
|
|
100
101
|
|
|
101
|
-
def root(path="") -> str:
|
|
102
|
-
"""
|
|
103
|
-
The `root` function returns the absolute path of the directory containing the current script file,
|
|
104
|
-
with an optional additional path appended to it.
|
|
105
|
-
|
|
106
|
-
:param path: The `path` parameter in the `root` function is a string that represents the relative
|
|
107
|
-
path from the current file's directory to another directory or file. It is used to construct the
|
|
108
|
-
full absolute path by appending it to the directory of the current file
|
|
109
|
-
:return: The function `root(path)` returns the absolute path of the directory containing the current
|
|
110
|
-
Python script file (__file__) concatenated with the provided `path` argument.
|
|
111
|
-
"""
|
|
112
|
-
return os.path.dirname(os.path.abspath(__file__)) + "/" + path
|
|
113
|
-
|
|
114
|
-
|
|
115
102
|
def isVowel(letter: str) -> bool:
|
|
116
103
|
"""
|
|
117
104
|
This Python function checks if a given letter is a vowel.
|
|
@@ -2,16 +2,19 @@ from random import shuffle
|
|
|
2
2
|
|
|
3
3
|
from ..helpers import fileAsArray
|
|
4
4
|
from ..helpers import oneOf
|
|
5
|
-
from ..helpers import root
|
|
6
5
|
from ..helpers import replaceVowels
|
|
7
6
|
from ..helpers import resource
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
class RandomNameRepository:
|
|
11
10
|
def __init__(self) -> None:
|
|
12
|
-
self.__masculine_firstnames = fileAsArray(
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
self.__masculine_firstnames = fileAsArray(
|
|
12
|
+
resource("wordlists/masculine.txt"))
|
|
13
|
+
|
|
14
|
+
self.__feminine_firstnames = fileAsArray(
|
|
15
|
+
resource("wordlists/feminine.txt"))
|
|
16
|
+
|
|
17
|
+
self.__surnames = fileAsArray(resource("wordlists/surnames.txt"))
|
|
15
18
|
|
|
16
19
|
shuffle(self.__masculine_firstnames)
|
|
17
20
|
shuffle(self.__feminine_firstnames)
|
|
@@ -4,15 +4,13 @@ import random
|
|
|
4
4
|
from ..helpers import randint
|
|
5
5
|
from ..helpers import oneOf
|
|
6
6
|
from ..helpers import fileAsArray
|
|
7
|
-
from ..helpers import
|
|
7
|
+
from ..helpers import resource
|
|
8
8
|
from ..helpers import replaceVowels
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class RandomTextRepository:
|
|
12
12
|
def __init__(self) -> None:
|
|
13
|
-
self.titles = fileAsArray(
|
|
14
|
-
root("wordlists/text/titles.txt")
|
|
15
|
-
)
|
|
13
|
+
self.titles = fileAsArray(resource("wordlists/titles.txt"))
|
|
16
14
|
random.shuffle(self.titles)
|
|
17
15
|
|
|
18
16
|
def token(self, lowerBound: int = 4, upperBound: int = 14):
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
homa/__init__.py,sha256=iPxn6CB50Dt59fYKMBO8yGlAwgFy5HscFPx786CVpSA,69
|
|
2
|
+
homa/helpers.py,sha256=9S9qZ0jvzpkd-QiuTcn_XNAFamuciPgRAEQx3RI30ck,5503
|
|
3
|
+
homa/main.py,sha256=2TvPspiYUi-eCJUbXRCWnFtbPNCYIcneSFBtnz65zNc,936
|
|
4
|
+
homa/repositories/RandomDateRepository.py,sha256=1fK_oPJ1ln-3Zs4O3eOhh427LeM48PNvXeGDJYV8d4o,1659
|
|
5
|
+
homa/repositories/RandomImageRepository.py,sha256=YxWP1hjDXk8yncBivINq2WTSXI1bNQ5zvHI2ckcrXLw,38
|
|
6
|
+
homa/repositories/RandomNameRepository.py,sha256=QiWDD_ed0-q66wFeKs5KWchDXbKIHtc5jjLYJSOYMiw,1847
|
|
7
|
+
homa/repositories/RandomTextRepository.py,sha256=2rXZNfpMRMXjCMGOKeXIJLfDLbMJN_5vfaeNBYsdj6Y,635
|
|
8
|
+
homa/repositories/__init__.py,sha256=11Dv_PG1H9sEy0SdxdYzisXegnjoVrZBPFJ3wNrZnzc,221
|
|
9
|
+
homa/wordlists/feminine.txt,sha256=lAxmPmUGlYv0gdpjSXPYPCoe8kmZ71jKqBO6V9n1C_c,713
|
|
10
|
+
homa/wordlists/masculine.txt,sha256=9aN-INCNQrnn4dwbQU6cEzUXw6rU24E9Jh111GcNDt0,673
|
|
11
|
+
homa/wordlists/surnames.txt,sha256=M3kiBxyExH7wqdEDGRUy6X2oEIvyqW3xChRY-uq0D9A,690
|
|
12
|
+
homa/wordlists/titles.txt,sha256=Am60g2qxACSZSaQwNFbfXxDAF6JxrFo8RXv5f-0Fv4c,15335
|
|
13
|
+
homa-0.18.dist-info/LICENSE,sha256=js3WDbJn9k5EN6sy1uuP2QBXxyPgS5DjO4Bf5yE35hQ,1072
|
|
14
|
+
homa-0.18.dist-info/METADATA,sha256=ROl7Ic5O7iL2oDDgBcfGQbJbCRiYQk8BUA3fHR_99kM,964
|
|
15
|
+
homa-0.18.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
16
|
+
homa-0.18.dist-info/top_level.txt,sha256=tmOfy2tuaAwc3W5-i6j61_vYJsXgR4ivBWkhJ3ZtJDc,5
|
|
17
|
+
homa-0.18.dist-info/RECORD,,
|
homa-0.17.dist-info/RECORD
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
homa/__init__.py,sha256=iPxn6CB50Dt59fYKMBO8yGlAwgFy5HscFPx786CVpSA,69
|
|
2
|
-
homa/helpers.py,sha256=l6JjaZg_eWgGwGbS509A378Pyrm0R6mS6BUtVYEAJyQ,6220
|
|
3
|
-
homa/main.py,sha256=2TvPspiYUi-eCJUbXRCWnFtbPNCYIcneSFBtnz65zNc,936
|
|
4
|
-
homa/repositories/RandomDateRepository.py,sha256=1fK_oPJ1ln-3Zs4O3eOhh427LeM48PNvXeGDJYV8d4o,1659
|
|
5
|
-
homa/repositories/RandomImageRepository.py,sha256=YxWP1hjDXk8yncBivINq2WTSXI1bNQ5zvHI2ckcrXLw,38
|
|
6
|
-
homa/repositories/RandomNameRepository.py,sha256=nc0_d5SSRI_PsKT7K1_xE-CU3LGT-a8iqCTpJKFuZi0,1816
|
|
7
|
-
homa/repositories/RandomTextRepository.py,sha256=OHWLSTUftYZT-NaOUlkN4uI1JQW4KRwrmSuFs27su9A,654
|
|
8
|
-
homa/repositories/__init__.py,sha256=11Dv_PG1H9sEy0SdxdYzisXegnjoVrZBPFJ3wNrZnzc,221
|
|
9
|
-
homa/wordlists/feminine_names.txt,sha256=lAxmPmUGlYv0gdpjSXPYPCoe8kmZ71jKqBO6V9n1C_c,713
|
|
10
|
-
homa/wordlists/masculine_names.txt,sha256=9aN-INCNQrnn4dwbQU6cEzUXw6rU24E9Jh111GcNDt0,673
|
|
11
|
-
homa/wordlists/surnames.txt,sha256=M3kiBxyExH7wqdEDGRUy6X2oEIvyqW3xChRY-uq0D9A,690
|
|
12
|
-
homa/wordlists/titles.txt,sha256=Am60g2qxACSZSaQwNFbfXxDAF6JxrFo8RXv5f-0Fv4c,15335
|
|
13
|
-
homa-0.17.dist-info/LICENSE,sha256=js3WDbJn9k5EN6sy1uuP2QBXxyPgS5DjO4Bf5yE35hQ,1072
|
|
14
|
-
homa-0.17.dist-info/METADATA,sha256=6Vm68Ts3vu0-fjl6nazHcJ7LDga3TxH26S_fzpbhQ-U,893
|
|
15
|
-
homa-0.17.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
16
|
-
homa-0.17.dist-info/top_level.txt,sha256=tmOfy2tuaAwc3W5-i6j61_vYJsXgR4ivBWkhJ3ZtJDc,5
|
|
17
|
-
homa-0.17.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|