iafisher 0.1.10__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.
- iafisher-0.1.10/LICENSE +21 -0
- iafisher-0.1.10/PKG-INFO +14 -0
- iafisher-0.1.10/pyproject.toml +22 -0
- iafisher-0.1.10/python/iafisher/__init__.py +0 -0
- iafisher-0.1.10/python/iafisher/colors/__init__.py +23 -0
- iafisher-0.1.10/python/iafisher/colors/colors.py +58 -0
- iafisher-0.1.10/python/iafisher/command/__init__.py +21 -0
- iafisher-0.1.10/python/iafisher/command/command.py +1081 -0
- iafisher-0.1.10/python/iafisher/command/tests.py +459 -0
- iafisher-0.1.10/python/iafisher/prelude/__init__.py +124 -0
- iafisher-0.1.10/python/iafisher/prelude/prelude.py +356 -0
- iafisher-0.1.10/python/iafisher/py.typed +0 -0
- iafisher-0.1.10/python/iafisher/scripting/__init__.py +4 -0
- iafisher-0.1.10/python/iafisher/scripting/scripting.py +33 -0
- iafisher-0.1.10/python/iafisher/tabular/__init__.py +3 -0
- iafisher-0.1.10/python/iafisher/tabular/tabular.py +182 -0
- iafisher-0.1.10/python/iafisher/tabular/tests.py +79 -0
- iafisher-0.1.10/python/iafisher/timehelper/__init__.py +45 -0
- iafisher-0.1.10/python/iafisher/timehelper/tests.py +23 -0
- iafisher-0.1.10/python/iafisher/timehelper/timehelper.py +124 -0
iafisher-0.1.10/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ian Fisher
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
iafisher-0.1.10/PKG-INFO
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: iafisher
|
|
3
|
+
Version: 0.1.10
|
|
4
|
+
Summary: iafisher's utility libraries for Python
|
|
5
|
+
Home-page: https://github.com/iafisher/foundation
|
|
6
|
+
License: MIT
|
|
7
|
+
Author: Ian Fisher
|
|
8
|
+
Author-email: ian@iafisher.com
|
|
9
|
+
Requires-Python: >=3.11,<4.0
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Project-URL: Repository, https://github.com/iafisher/foundation
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "iafisher"
|
|
3
|
+
version = "0.1.10"
|
|
4
|
+
description = "iafisher's utility libraries for Python"
|
|
5
|
+
authors = ["Ian Fisher <ian@iafisher.com>"]
|
|
6
|
+
license = "MIT"
|
|
7
|
+
homepage = "https://github.com/iafisher/foundation"
|
|
8
|
+
repository = "https://github.com/iafisher/foundation"
|
|
9
|
+
packages = [
|
|
10
|
+
{ include = "iafisher", from = "python" }
|
|
11
|
+
]
|
|
12
|
+
include = ["ian/py.typed"]
|
|
13
|
+
|
|
14
|
+
[tool.poetry.dependencies]
|
|
15
|
+
python = "^3.11"
|
|
16
|
+
|
|
17
|
+
[tool.poetry.group.dev.dependencies]
|
|
18
|
+
expecttest = "^0.3.0"
|
|
19
|
+
|
|
20
|
+
[build-system]
|
|
21
|
+
requires = ["poetry-core"]
|
|
22
|
+
build-backend = "poetry.core.masonry.api"
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from .colors import (
|
|
2
|
+
cyan,
|
|
3
|
+
eprint_ as eprint,
|
|
4
|
+
error,
|
|
5
|
+
gray,
|
|
6
|
+
green,
|
|
7
|
+
print_ as print,
|
|
8
|
+
red,
|
|
9
|
+
strip,
|
|
10
|
+
yellow,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
"cyan",
|
|
15
|
+
"eprint",
|
|
16
|
+
"error",
|
|
17
|
+
"gray",
|
|
18
|
+
"green",
|
|
19
|
+
"print",
|
|
20
|
+
"red",
|
|
21
|
+
"strip",
|
|
22
|
+
"yellow",
|
|
23
|
+
]
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from ..prelude import *
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def print_(*args: Any, file: Optional[SupportsWrite] = None, **kwargs: Any) -> None:
|
|
5
|
+
not_a_terminal = not _isatty(file if file is not None else sys.stdout)
|
|
6
|
+
|
|
7
|
+
message = " ".join(map(str, args))
|
|
8
|
+
# https://no-color.org/
|
|
9
|
+
if not_a_terminal or "NO_COLOR" in os.environ:
|
|
10
|
+
message = strip(message)
|
|
11
|
+
|
|
12
|
+
print(message, file=file, **kwargs)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def eprint_(*args: Any, **kwargs: Any) -> None:
|
|
16
|
+
print_(*args, file=sys.stderr, **kwargs)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def error(*args: Any) -> None:
|
|
20
|
+
print_(red("Error:"), *args, file=sys.stderr)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def red(s: str) -> str:
|
|
24
|
+
return _colored(s, 31)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def yellow(s: str) -> str:
|
|
28
|
+
return _colored(s, 33)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def cyan(s: str) -> str:
|
|
32
|
+
return _colored(s, 36)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def green(s: str) -> str:
|
|
36
|
+
return _colored(s, 32)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def gray(s: str) -> str:
|
|
40
|
+
return _colored(s, 90)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
_ansi_codes_re = lazy_re(r"\033\[[;?0-9]*[a-zA-Z]")
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def strip(s: str) -> str:
|
|
47
|
+
return _ansi_codes_re.get().sub("", s)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _colored(s: str, code: int) -> str:
|
|
51
|
+
return f"\033[{code}m{s}\033[0m"
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _isatty(stream: Any) -> bool:
|
|
55
|
+
try:
|
|
56
|
+
return stream.isatty()
|
|
57
|
+
except Exception:
|
|
58
|
+
return False
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from .command import (
|
|
2
|
+
Command,
|
|
3
|
+
Extra,
|
|
4
|
+
Group,
|
|
5
|
+
Mutex,
|
|
6
|
+
dispatch,
|
|
7
|
+
get_help_text,
|
|
8
|
+
get_help_text_recursive,
|
|
9
|
+
get_version,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"Command",
|
|
14
|
+
"Extra",
|
|
15
|
+
"Group",
|
|
16
|
+
"Mutex",
|
|
17
|
+
"dispatch",
|
|
18
|
+
"get_help_text",
|
|
19
|
+
"get_help_text_recursive",
|
|
20
|
+
"get_version",
|
|
21
|
+
]
|