string-to-code 0.2.12__tar.gz → 0.2.14__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.
- {string_to_code-0.2.12 → string_to_code-0.2.14}/PKG-INFO +3 -1
- {string_to_code-0.2.12 → string_to_code-0.2.14}/pyproject.toml +2 -2
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/core.py +6 -7
- {string_to_code-0.2.12 → string_to_code-0.2.14}/LICENSE +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/README.md +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/__init__.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/c_like_utils.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/string_to_code.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/to_ada.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/to_algol68.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/to_ballerina.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/to_bash.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/to_c.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/to_cobol.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/to_cpp.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/to_haskell.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/to_java.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/to_lisp.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/to_nim.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/to_pascal.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/to_python3.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/to_rust.py +0 -0
- {string_to_code-0.2.12 → string_to_code-0.2.14}/string_to_code/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: string-to-code
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.14
|
|
4
4
|
Summary: Generates a piece of messy code in a given language displaying a given string
|
|
5
5
|
Home-page: https://github.com/vil02/string_to_code_proj
|
|
6
6
|
License: MIT
|
|
@@ -12,6 +12,8 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
17
|
Project-URL: Repository, https://github.com/vil02/string_to_code_proj
|
|
16
18
|
Description-Content-Type: text/markdown
|
|
17
19
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "string-to-code"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.14"
|
|
4
4
|
description = "Generates a piece of messy code in a given language displaying a given string "
|
|
5
5
|
authors = ["piotr.idzik <vil02@o2.pl>"]
|
|
6
6
|
readme = "./string_to_code/README.md"
|
|
@@ -21,7 +21,7 @@ pytest-mock = ">3.0"
|
|
|
21
21
|
pylint = ">=2.0"
|
|
22
22
|
flake8 = ">=5.0"
|
|
23
23
|
flake8-pytest-style = "2.0.0"
|
|
24
|
-
ruff = "0.
|
|
24
|
+
ruff = "0.8.0"
|
|
25
25
|
coverage = ">=6.0"
|
|
26
26
|
black = ">=24.1"
|
|
27
27
|
mypy = ">=1.7"
|
|
@@ -3,11 +3,10 @@ core functions of the string_to_code module
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import typing
|
|
6
|
-
import collections.abc
|
|
7
6
|
import random
|
|
8
7
|
import functools
|
|
9
8
|
|
|
10
|
-
Strings: typing.TypeAlias =
|
|
9
|
+
Strings: typing.TypeAlias = list[str]
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
class Atom(typing.NamedTuple):
|
|
@@ -26,13 +25,13 @@ class SimpleFunction(typing.NamedTuple):
|
|
|
26
25
|
other functions of such type or displaying single characters
|
|
27
26
|
"""
|
|
28
27
|
|
|
29
|
-
called_list:
|
|
28
|
+
called_list: list[CalledListEntry]
|
|
30
29
|
|
|
31
30
|
|
|
32
|
-
SimpleFunctions: typing.TypeAlias =
|
|
31
|
+
SimpleFunctions: typing.TypeAlias = list[SimpleFunction]
|
|
33
32
|
|
|
34
33
|
|
|
35
|
-
def str_pieces(in_str: str, in_pieces_len:
|
|
34
|
+
def str_pieces(in_str: str, in_pieces_len: list[int]) -> Strings:
|
|
36
35
|
"""returns in_str split into pieces of lengths as in in_pieces_len"""
|
|
37
36
|
assert all(_ > 0 for _ in in_pieces_len)
|
|
38
37
|
assert sum(in_pieces_len) == len(in_str)
|
|
@@ -45,7 +44,7 @@ def str_pieces(in_str: str, in_pieces_len: typing.List[int]) -> Strings:
|
|
|
45
44
|
return res
|
|
46
45
|
|
|
47
46
|
|
|
48
|
-
def random_pieces_len(in_total_len: int) ->
|
|
47
|
+
def random_pieces_len(in_total_len: int) -> list[int]:
|
|
49
48
|
"""returns a list of positive numbers with their sum being in_total_len"""
|
|
50
49
|
cur_num = in_total_len
|
|
51
50
|
res = []
|
|
@@ -73,7 +72,7 @@ def _interesting_random_split(in_str: str) -> Strings:
|
|
|
73
72
|
|
|
74
73
|
def get_function_namer(
|
|
75
74
|
in_name_prefix: str = "f_",
|
|
76
|
-
) ->
|
|
75
|
+
) -> typing.Callable[[int], str]:
|
|
77
76
|
"""returns a default function namer"""
|
|
78
77
|
|
|
79
78
|
def _inner(in_id: int) -> str:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|