wolth 0.1.0__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.
- wolth/__init__.py +1 -0
- wolth/__main__.py +4 -0
- wolth/cli.py +18 -0
- wolth/collections/__init__.py +2 -0
- wolth/collections/enhanced/converter.py +26 -0
- wolth/collections/enhanced/enhanced_dict.py +38 -0
- wolth/collections/enhanced/enhanced_list.py +26 -0
- wolth/py.typed +1 -0
- wolth/utils.py +6 -0
- wolth-0.1.0.dist-info/METADATA +79 -0
- wolth-0.1.0.dist-info/RECORD +14 -0
- wolth-0.1.0.dist-info/WHEEL +4 -0
- wolth-0.1.0.dist-info/entry_points.txt +2 -0
- wolth-0.1.0.dist-info/licenses/LICENSE +21 -0
wolth/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Top-level package for solon."""
|
wolth/__main__.py
ADDED
wolth/cli.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Console script for solon."""
|
|
2
|
+
|
|
3
|
+
import typer
|
|
4
|
+
from rich.console import Console
|
|
5
|
+
|
|
6
|
+
from solon import utils
|
|
7
|
+
|
|
8
|
+
app = typer.Typer()
|
|
9
|
+
console = Console()
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@app.callback(invoke_without_command=True)
|
|
13
|
+
def main() -> None:
|
|
14
|
+
utils.do_something_useful()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
if __name__ == "__main__":
|
|
18
|
+
app()
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
def enhance(value):
|
|
2
|
+
from .enhanced_dict import EnhancedDict
|
|
3
|
+
from .enhanced_list import EnhancedList
|
|
4
|
+
|
|
5
|
+
if isinstance(value, dict) and not isinstance(value, EnhancedDict):
|
|
6
|
+
return EnhancedDict(value)
|
|
7
|
+
elif isinstance(value, list) and not isinstance(value, EnhancedList):
|
|
8
|
+
return EnhancedList(value)
|
|
9
|
+
else:
|
|
10
|
+
return value
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def to_dict(value):
|
|
14
|
+
from .enhanced_dict import EnhancedDict
|
|
15
|
+
from .enhanced_list import EnhancedList
|
|
16
|
+
|
|
17
|
+
if isinstance(value, EnhancedDict):
|
|
18
|
+
return value.to_dict()
|
|
19
|
+
elif isinstance(value, EnhancedList):
|
|
20
|
+
return value.to_dict()
|
|
21
|
+
elif isinstance(value, dict):
|
|
22
|
+
return {k: to_dict(v) for k, v in value.items()}
|
|
23
|
+
elif isinstance(value, list):
|
|
24
|
+
return [to_dict(item) for item in value]
|
|
25
|
+
else:
|
|
26
|
+
return value
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from .converter import enhance, to_dict
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class EnhancedDict(dict):
|
|
5
|
+
|
|
6
|
+
def __init__(self, *args, **kwargs):
|
|
7
|
+
super().__init__()
|
|
8
|
+
self.update(*args, **kwargs)
|
|
9
|
+
|
|
10
|
+
def __getattr__(self, name):
|
|
11
|
+
return self[name] if name in self else None
|
|
12
|
+
|
|
13
|
+
def __setattr__(self, name, value):
|
|
14
|
+
self[name] = value
|
|
15
|
+
|
|
16
|
+
def __delattr__(self, name):
|
|
17
|
+
if name in self:
|
|
18
|
+
del self[name]
|
|
19
|
+
|
|
20
|
+
def __setitem__(self, key, value):
|
|
21
|
+
return super().__setitem__(key, enhance(value))
|
|
22
|
+
|
|
23
|
+
def update(self, *args, **kwargs):
|
|
24
|
+
arg = args[0] if len(args) > 0 else {}
|
|
25
|
+
if isinstance(arg, dict):
|
|
26
|
+
arg = arg.items()
|
|
27
|
+
|
|
28
|
+
for k, v in arg:
|
|
29
|
+
self[k] = v
|
|
30
|
+
|
|
31
|
+
for k, v in kwargs.items():
|
|
32
|
+
self[k] = v
|
|
33
|
+
|
|
34
|
+
def to_dict(self) -> dict:
|
|
35
|
+
return {k: to_dict(v) for k, v in self.items()}
|
|
36
|
+
|
|
37
|
+
def __repr__(self):
|
|
38
|
+
return f"EnhancedDict({super().__repr__()})"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from .converter import enhance, to_dict
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class EnhancedList(list):
|
|
5
|
+
|
|
6
|
+
def __init__(self, iterable=()):
|
|
7
|
+
super().__init__(enhance(item) for item in iterable)
|
|
8
|
+
|
|
9
|
+
def __setitem__(self, index, value):
|
|
10
|
+
super().__setitem__(index, enhance(value))
|
|
11
|
+
|
|
12
|
+
def append(self, value):
|
|
13
|
+
super().append(enhance(value))
|
|
14
|
+
|
|
15
|
+
def extend(self, iterable):
|
|
16
|
+
super().extend(enhance(item) for item in iterable)
|
|
17
|
+
|
|
18
|
+
def insert(self, index, value):
|
|
19
|
+
super().insert(index, enhance(value))
|
|
20
|
+
|
|
21
|
+
def __getitem__(self, index):
|
|
22
|
+
value = super().__getitem__(index)
|
|
23
|
+
return enhance(value)
|
|
24
|
+
|
|
25
|
+
def to_dict(self) -> list:
|
|
26
|
+
return [to_dict(item) for item in self]
|
wolth/py.typed
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Marker file for PEP 561
|
wolth/utils.py
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: wolth
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: solon is a useful toolkit.
|
|
5
|
+
Project-URL: bugs, https://github.com/warmoss/solon/issues
|
|
6
|
+
Project-URL: changelog, https://github.com/warmoss/solon/releases
|
|
7
|
+
Project-URL: documentation, https://warmoss.github.io/solon/
|
|
8
|
+
Project-URL: homepage, https://github.com/warmoss/solon
|
|
9
|
+
Author-email: maks <maks@sapling.ink>
|
|
10
|
+
Maintainer-email: maks <maks@sapling.ink>
|
|
11
|
+
License: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Classifier: Typing :: Typed
|
|
14
|
+
Requires-Python: >=3.12
|
|
15
|
+
Requires-Dist: rich
|
|
16
|
+
Requires-Dist: typer
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# solon
|
|
20
|
+
|
|
21
|
+

|
|
22
|
+
|
|
23
|
+
solon is a useful toolkit.
|
|
24
|
+
|
|
25
|
+
* GitHub: https://github.com/warmoss/solon/
|
|
26
|
+
* PyPI package: https://pypi.org/project/solon/
|
|
27
|
+
* Created by: **[warmoss](https://audrey.feldroy.com/)** | GitHub https://github.com/warmoss | PyPI https://pypi.org/user/warmoss/
|
|
28
|
+
* Free software: MIT License
|
|
29
|
+
|
|
30
|
+
## Features
|
|
31
|
+
|
|
32
|
+
* TODO
|
|
33
|
+
|
|
34
|
+
## Documentation
|
|
35
|
+
|
|
36
|
+
Documentation is built with [Zensical](https://zensical.org/) and deployed to GitHub Pages.
|
|
37
|
+
|
|
38
|
+
* **Live site:** https://warmoss.github.io/solon/
|
|
39
|
+
* **Preview locally:** `just docs-serve` (serves at http://localhost:8000)
|
|
40
|
+
* **Build:** `just docs-build`
|
|
41
|
+
|
|
42
|
+
API documentation is auto-generated from docstrings using [mkdocstrings](https://mkdocstrings.github.io/).
|
|
43
|
+
|
|
44
|
+
Docs deploy automatically on push to `main` via GitHub Actions. To enable this, go to your repo's Settings > Pages and set the source to **GitHub Actions**.
|
|
45
|
+
|
|
46
|
+
## Development
|
|
47
|
+
|
|
48
|
+
To set up for local development:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Clone your fork
|
|
52
|
+
git clone git@github.com:your_username/solon.git
|
|
53
|
+
cd solon
|
|
54
|
+
|
|
55
|
+
# Install in editable mode with live updates
|
|
56
|
+
uv tool install --editable .
|
|
57
|
+
uv tool install rust-just
|
|
58
|
+
winget install --id GitHub.cli
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
This installs the CLI globally but with live updates - any changes you make to the source code are immediately available when you run `solon`.
|
|
62
|
+
|
|
63
|
+
Run tests:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
uv run pytest
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Run quality checks (format, lint, type check, test):
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
just qa
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Author
|
|
76
|
+
|
|
77
|
+
solon was created in 2026 by warmoss.
|
|
78
|
+
|
|
79
|
+
Built with [Cookiecutter](https://github.com/cookiecutter/cookiecutter) and the [audreyfeldroy/cookiecutter-pypackage](https://github.com/audreyfeldroy/cookiecutter-pypackage) project template.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
wolth/__init__.py,sha256=Kc0fyXK2CsZXbc5wEKbLKM6enJXF-Gm4GboW3k0AxaU,36
|
|
2
|
+
wolth/__main__.py,sha256=BFsFOSlPFrZ_3E5I-irWVmEV3JiPhP7o3kk1j40d8RQ,63
|
|
3
|
+
wolth/cli.py,sha256=WdKK2Ld0_yNyKI45GgudyhtniGRJV9TInJC9sFnvJOk,299
|
|
4
|
+
wolth/py.typed,sha256=TBDV9m9vjfnp9vsgTeJmpoNseoJEfHwvZaBLvLMfzz8,27
|
|
5
|
+
wolth/utils.py,sha256=raIS78dAgaUz0C30ljKomhBF6Ui0kROtzGMT_UAB61k,129
|
|
6
|
+
wolth/collections/__init__.py,sha256=NMH4XJXIKQzv86bSqeRDj-oQleM9lt3wPttzq1hbngA,100
|
|
7
|
+
wolth/collections/enhanced/converter.py,sha256=Bo9eSmK26p1fS7ckNDMK9dO3xCuMEnLS4hgBqyFpd5A,842
|
|
8
|
+
wolth/collections/enhanced/enhanced_dict.py,sha256=USLKYEvvGRIvCzRseX6z4BGnPwdj3Ka2ahuKSwQBbg0,976
|
|
9
|
+
wolth/collections/enhanced/enhanced_list.py,sha256=J9G5Ie8nUlM1KhlZMsAtQ2y2V0sRPUpl3U4ZeoWMOpo,718
|
|
10
|
+
wolth-0.1.0.dist-info/METADATA,sha256=Zp1gb0mqDZJPg2Ny5rajy8_ly7SVwcb0gXoPQC4rrlI,2252
|
|
11
|
+
wolth-0.1.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
12
|
+
wolth-0.1.0.dist-info/entry_points.txt,sha256=s3__Cke3foADyaQHxobp6nmzxf-AnK5cjeWUuk5LIZg,40
|
|
13
|
+
wolth-0.1.0.dist-info/licenses/LICENSE,sha256=tYCgDqHUJHdsSb6LGTIrPFnUfg_BpmeAp5Ijtf4fJfU,1083
|
|
14
|
+
wolth-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, maks
|
|
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.
|