stdl 0.7.0__tar.gz → 0.8.0__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.
- stdl-0.8.0/PKG-INFO +101 -0
- {stdl-0.7.0 → stdl-0.8.0}/README.md +3 -30
- stdl-0.8.0/pyproject.toml +300 -0
- stdl-0.7.0/pyproject.toml → stdl-0.8.0/pyproject.toml.orig +71 -43
- stdl-0.8.0/stdl/__init__.py +39 -0
- stdl-0.8.0/stdl/__init__.pyi +27 -0
- {stdl-0.7.0 → stdl-0.8.0}/stdl/color.py +355 -180
- {stdl-0.7.0 → stdl-0.8.0}/stdl/decorators.py +3 -0
- {stdl-0.7.0 → stdl-0.8.0}/stdl/dt.py +50 -9
- stdl-0.8.0/stdl/fs.py +3141 -0
- {stdl-0.7.0 → stdl-0.8.0}/stdl/import_lazy.py +32 -19
- {stdl-0.7.0 → stdl-0.8.0}/stdl/log.py +4 -0
- {stdl-0.7.0 → stdl-0.8.0}/stdl/lst.py +8 -2
- {stdl-0.7.0 → stdl-0.8.0}/stdl/net.py +3 -0
- {stdl-0.7.0 → stdl-0.8.0}/stdl/st.py +28 -25
- stdl-0.7.0/.editorconfig +0 -12
- stdl-0.7.0/.github/workflows/lint.yml +0 -23
- stdl-0.7.0/.github/workflows/publish.yml +0 -25
- stdl-0.7.0/.github/workflows/test.yml +0 -33
- stdl-0.7.0/.gitignore +0 -134
- stdl-0.7.0/.pre-commit-config.yaml +0 -15
- stdl-0.7.0/.python-version +0 -1
- stdl-0.7.0/.readthedocs.yml +0 -31
- stdl-0.7.0/CONTRIBUTING.md +0 -81
- stdl-0.7.0/Justfile +0 -62
- stdl-0.7.0/PKG-INFO +0 -144
- stdl-0.7.0/docs/index.md +0 -45
- stdl-0.7.0/docs/reference/color.md +0 -1
- stdl-0.7.0/docs/reference/decorators.md +0 -1
- stdl-0.7.0/docs/reference/dt.md +0 -1
- stdl-0.7.0/docs/reference/fs.md +0 -1
- stdl-0.7.0/docs/reference/import_lazy.md +0 -1
- stdl-0.7.0/docs/reference/log.md +0 -1
- stdl-0.7.0/docs/reference/net.md +0 -1
- stdl-0.7.0/docs/reference/st.md +0 -1
- stdl-0.7.0/docs/requirements.txt +0 -4
- stdl-0.7.0/mkdocs.yml +0 -98
- stdl-0.7.0/stdl/__init__.py +0 -2
- stdl-0.7.0/stdl/fs.py +0 -1746
- stdl-0.7.0/tests/test_color.py +0 -699
- stdl-0.7.0/tests/test_decorators.py +0 -108
- stdl-0.7.0/tests/test_dt.py +0 -229
- stdl-0.7.0/tests/test_fs.py +0 -1549
- stdl-0.7.0/tests/test_lst.py +0 -27
- stdl-0.7.0/tests/test_pydantic_integration.py +0 -136
- stdl-0.7.0/tests/test_st.py +0 -148
- stdl-0.7.0/uv.lock +0 -696
- {stdl-0.7.0 → stdl-0.8.0}/LICENSE +0 -0
stdl-0.8.0/PKG-INFO
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: stdl
|
|
3
|
+
Version: 0.8.0
|
|
4
|
+
Summary: Extended Python Standard Library
|
|
5
|
+
Keywords: stdl,standard-library,python-utilities,filesystem,list-utils,ansi-colors,color-formats,terminal-links,lazy-import,text-processing
|
|
6
|
+
Author: Žiga Ivanšek
|
|
7
|
+
Author-email: Žiga Ivanšek <ziga.ivansek@gmail.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Typing :: Typed
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
+
Classifier: Topic :: Utilities
|
|
15
|
+
Classifier: Topic :: System :: Filesystems
|
|
16
|
+
Classifier: Topic :: Text Processing :: General
|
|
17
|
+
Classifier: Programming Language :: Python
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
25
|
+
Requires-Dist: python-dateutil>=2.8.2
|
|
26
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
27
|
+
Requires-Dist: toml>=0.10.2
|
|
28
|
+
Requires-Dist: anyio>=4.0.0 ; extra == 'async'
|
|
29
|
+
Requires-Dist: anyio>=4.0.0 ; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest>=9.0.3 ; extra == 'dev'
|
|
31
|
+
Requires-Dist: coverage>=7.14.1 ; extra == 'dev'
|
|
32
|
+
Requires-Dist: ruff==0.16.10 ; extra == 'dev'
|
|
33
|
+
Requires-Dist: pre-commit>=4.6.0 ; extra == 'dev'
|
|
34
|
+
Requires-Dist: pyrefly>=1.0.0 ; extra == 'dev'
|
|
35
|
+
Requires-Dist: codespell>=2.4.2 ; extra == 'dev'
|
|
36
|
+
Requires-Dist: pydantic>=2 ; extra == 'dev'
|
|
37
|
+
Requires-Dist: rattle-lint>=3.0.0 ; extra == 'dev'
|
|
38
|
+
Requires-Dist: tqdm>=4.67.1 ; extra == 'full'
|
|
39
|
+
Requires-Dist: anyio>=4.0.0 ; extra == 'test'
|
|
40
|
+
Requires-Dist: pytest>=9.0.3 ; extra == 'test'
|
|
41
|
+
Requires-Dist: coverage>=7.14.1 ; extra == 'test'
|
|
42
|
+
Requires-Dist: pydantic>=2 ; extra == 'test'
|
|
43
|
+
Requires-Python: >=3.11
|
|
44
|
+
Project-URL: Repository, https://github.com/zigai/stdl
|
|
45
|
+
Project-URL: Issues, https://github.com/zigai/stdl/issues
|
|
46
|
+
Project-URL: Homepage, https://github.com/zigai/stdl
|
|
47
|
+
Provides-Extra: async
|
|
48
|
+
Provides-Extra: dev
|
|
49
|
+
Provides-Extra: full
|
|
50
|
+
Provides-Extra: test
|
|
51
|
+
Description-Content-Type: text/markdown
|
|
52
|
+
|
|
53
|
+
# stdl
|
|
54
|
+
|
|
55
|
+
[](https://github.com/zigai/stdl/actions/workflows/test.yml)
|
|
56
|
+
[](https://stdl.readthedocs.io/en/latest/?badge=latest)
|
|
57
|
+
[](https://badge.fury.io/py/stdl)
|
|
58
|
+

|
|
59
|
+
[](https://pepy.tech/project/stdl)
|
|
60
|
+
[](https://github.com/zigai/stdl/blob/master/LICENSE)
|
|
61
|
+
|
|
62
|
+
`stdl` is a collection of Python utilities that complement the standard library.
|
|
63
|
+
|
|
64
|
+
## Features
|
|
65
|
+
|
|
66
|
+
- File and directory operations
|
|
67
|
+
- String manipulation
|
|
68
|
+
- ANSI color support for terminal output
|
|
69
|
+
- Date and time formatting
|
|
70
|
+
- List utils
|
|
71
|
+
- Lazy imports
|
|
72
|
+
- Logging configuration for `logging` and `loguru`
|
|
73
|
+
- [See docs](https://stdl.readthedocs.io/en/latest/?badge=latest)
|
|
74
|
+
|
|
75
|
+
## Installation
|
|
76
|
+
|
|
77
|
+
### Using pip
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
pip install stdl
|
|
81
|
+
pip install 'stdl[async]'
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Using uv
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
uv add stdl
|
|
88
|
+
uv add 'stdl[async]'
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### From source
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
pip install git+https://github.com/zigai/stdl.git
|
|
95
|
+
# or
|
|
96
|
+
uv add git+https://github.com/zigai/stdl.git
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## License
|
|
100
|
+
|
|
101
|
+
[MIT License](https://github.com/zigai/stdl/blob/master/LICENSE)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://github.com/zigai/stdl/actions/workflows/test.yml)
|
|
4
4
|
[](https://stdl.readthedocs.io/en/latest/?badge=latest)
|
|
5
5
|
[](https://badge.fury.io/py/stdl)
|
|
6
|
-

|
|
7
7
|
[](https://pepy.tech/project/stdl)
|
|
8
8
|
[](https://github.com/zigai/stdl/blob/master/LICENSE)
|
|
9
9
|
|
|
@@ -26,12 +26,14 @@
|
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
28
|
pip install stdl
|
|
29
|
+
pip install 'stdl[async]'
|
|
29
30
|
```
|
|
30
31
|
|
|
31
32
|
### Using uv
|
|
32
33
|
|
|
33
34
|
```sh
|
|
34
35
|
uv add stdl
|
|
36
|
+
uv add 'stdl[async]'
|
|
35
37
|
```
|
|
36
38
|
|
|
37
39
|
### From source
|
|
@@ -42,35 +44,6 @@ pip install git+https://github.com/zigai/stdl.git
|
|
|
42
44
|
uv add git+https://github.com/zigai/stdl.git
|
|
43
45
|
```
|
|
44
46
|
|
|
45
|
-
## Examples
|
|
46
|
-
|
|
47
|
-
### Lazy imports
|
|
48
|
-
|
|
49
|
-
```python
|
|
50
|
-
from typing import TYPE_CHECKING
|
|
51
|
-
from stdl.import_lazy import import_lazy
|
|
52
|
-
|
|
53
|
-
if TYPE_CHECKING:
|
|
54
|
-
from os.path import abspath, join
|
|
55
|
-
import numpy as np
|
|
56
|
-
import torch
|
|
57
|
-
else:
|
|
58
|
-
import_lazy("os.path", ["join", "abspath"], verbose=True)
|
|
59
|
-
import_lazy("numpy", alias="np", verbose=True)
|
|
60
|
-
import_lazy("torch", verbose=True)
|
|
61
|
-
|
|
62
|
-
print(np.zeros(4))
|
|
63
|
-
# importing "numpy" took 0.060s
|
|
64
|
-
# [0. 0. 0. 0.]
|
|
65
|
-
print(torch)
|
|
66
|
-
# <LazyImport: torch>
|
|
67
|
-
print(torch.randn(8))
|
|
68
|
-
# importing "torch" took 1.118s
|
|
69
|
-
# tensor([0., 0., 0., 0., 0., 0., 0., 0.])
|
|
70
|
-
print(torch)
|
|
71
|
-
# <module 'torch' from .../torch/__init__.py'
|
|
72
|
-
```
|
|
73
|
-
|
|
74
47
|
## License
|
|
75
48
|
|
|
76
49
|
[MIT License](https://github.com/zigai/stdl/blob/master/LICENSE)
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "stdl"
|
|
3
|
+
version = "0.8.0"
|
|
4
|
+
description = "Extended Python Standard Library"
|
|
5
|
+
license = "MIT"
|
|
6
|
+
license-files = ["LICENSE"]
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
requires-python = ">=3.11"
|
|
9
|
+
dependencies = [
|
|
10
|
+
"python-dateutil>=2.8.2",
|
|
11
|
+
"pyyaml>=6.0.2",
|
|
12
|
+
"toml>=0.10.2",
|
|
13
|
+
]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Typing :: Typed",
|
|
16
|
+
"Operating System :: OS Independent",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
19
|
+
"Topic :: Utilities",
|
|
20
|
+
"Topic :: System :: Filesystems",
|
|
21
|
+
"Topic :: Text Processing :: General",
|
|
22
|
+
"Programming Language :: Python",
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Programming Language :: Python :: 3.13",
|
|
28
|
+
"Programming Language :: Python :: 3.14",
|
|
29
|
+
"Programming Language :: Python :: 3.15",
|
|
30
|
+
]
|
|
31
|
+
keywords = [
|
|
32
|
+
"stdl",
|
|
33
|
+
"standard-library",
|
|
34
|
+
"python-utilities",
|
|
35
|
+
"filesystem",
|
|
36
|
+
"list-utils",
|
|
37
|
+
"ansi-colors",
|
|
38
|
+
"color-formats",
|
|
39
|
+
"terminal-links",
|
|
40
|
+
"lazy-import",
|
|
41
|
+
"text-processing",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[[project.authors]]
|
|
45
|
+
name = "Žiga Ivanšek"
|
|
46
|
+
email = "ziga.ivansek@gmail.com"
|
|
47
|
+
|
|
48
|
+
[project.optional-dependencies]
|
|
49
|
+
async = ["anyio>=4.0.0"]
|
|
50
|
+
full = ["tqdm>=4.67.1"]
|
|
51
|
+
dev = [
|
|
52
|
+
"anyio>=4.0.0",
|
|
53
|
+
"pytest>=9.0.3",
|
|
54
|
+
"coverage>=7.14.1",
|
|
55
|
+
"ruff==0.16.10",
|
|
56
|
+
"pre-commit>=4.6.0",
|
|
57
|
+
"pyrefly>=1.0.0",
|
|
58
|
+
"codespell>=2.4.2",
|
|
59
|
+
"pydantic>=2",
|
|
60
|
+
"rattle-lint>=3.0.0",
|
|
61
|
+
]
|
|
62
|
+
test = [
|
|
63
|
+
"anyio>=4.0.0",
|
|
64
|
+
"pytest>=9.0.3",
|
|
65
|
+
"coverage>=7.14.1",
|
|
66
|
+
"pydantic>=2",
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
[project.urls]
|
|
70
|
+
Repository = "https://github.com/zigai/stdl"
|
|
71
|
+
Issues = "https://github.com/zigai/stdl/issues"
|
|
72
|
+
Homepage = "https://github.com/zigai/stdl"
|
|
73
|
+
|
|
74
|
+
[build-system]
|
|
75
|
+
requires = ["uv_build>=0.11.25,<0.12.0"]
|
|
76
|
+
build-backend = "uv_build"
|
|
77
|
+
|
|
78
|
+
[tool.codespell]
|
|
79
|
+
skip = ".git,uv.lock"
|
|
80
|
+
|
|
81
|
+
[tool.coverage.run]
|
|
82
|
+
source = ["stdl"]
|
|
83
|
+
branch = true
|
|
84
|
+
|
|
85
|
+
[tool.coverage.report]
|
|
86
|
+
exclude_lines = [
|
|
87
|
+
"pragma: no cover",
|
|
88
|
+
"raise NotImplementedError",
|
|
89
|
+
"if TYPE_CHECKING:",
|
|
90
|
+
"if typing.TYPE_CHECKING:",
|
|
91
|
+
]
|
|
92
|
+
omit = [
|
|
93
|
+
"tests/*",
|
|
94
|
+
"tests/**",
|
|
95
|
+
]
|
|
96
|
+
|
|
97
|
+
[tool.pyrefly]
|
|
98
|
+
project-includes = ["stdl"]
|
|
99
|
+
project-excludes = ["tests/**"]
|
|
100
|
+
disable-project-excludes-heuristics = true
|
|
101
|
+
search-path = ["."]
|
|
102
|
+
disable-search-path-heuristics = true
|
|
103
|
+
python-version = "3.11"
|
|
104
|
+
enabled-ignores = [
|
|
105
|
+
"type",
|
|
106
|
+
"pyrefly",
|
|
107
|
+
]
|
|
108
|
+
use-ignore-files = false
|
|
109
|
+
check-unannotated-defs = true
|
|
110
|
+
infer-return-types = "checked"
|
|
111
|
+
infer-with-first-use = true
|
|
112
|
+
strict-callable-subtyping = false
|
|
113
|
+
spec-compliant-overloads = false
|
|
114
|
+
|
|
115
|
+
[tool.rattle]
|
|
116
|
+
root = true
|
|
117
|
+
enable = [
|
|
118
|
+
"blank-line-after-control-block",
|
|
119
|
+
"blank-line-after-terminal-control-block",
|
|
120
|
+
"blank-line-before-branch",
|
|
121
|
+
"blank-line-before-unrelated-block",
|
|
122
|
+
"no-suite-leading-trailing-blank-lines",
|
|
123
|
+
"module-all-at-bottom",
|
|
124
|
+
"no-underscore-all-exports",
|
|
125
|
+
"forbidden-call",
|
|
126
|
+
"no-relative-imports",
|
|
127
|
+
"no-underscore-import-aliases",
|
|
128
|
+
"no-unsafe-tempfile-factories",
|
|
129
|
+
"no-annotated-self",
|
|
130
|
+
"no-exception-message-variables",
|
|
131
|
+
"no-str-exception-translation",
|
|
132
|
+
"no-underscore-class",
|
|
133
|
+
"public-method-order",
|
|
134
|
+
"no-bare-object-annotations",
|
|
135
|
+
"no-named-tuple",
|
|
136
|
+
"no-static-if-condition",
|
|
137
|
+
"sorted-attributes",
|
|
138
|
+
"use-callable-ellipsis",
|
|
139
|
+
]
|
|
140
|
+
|
|
141
|
+
[tool.rattle.options.forbidden-call]
|
|
142
|
+
forbidden_calls = ["typing.cast"]
|
|
143
|
+
|
|
144
|
+
[tool.ruff]
|
|
145
|
+
line-length = 100
|
|
146
|
+
|
|
147
|
+
[tool.ruff.lint]
|
|
148
|
+
select = ["ALL"]
|
|
149
|
+
ignore = [
|
|
150
|
+
"ERA",
|
|
151
|
+
"FBT002",
|
|
152
|
+
"COM",
|
|
153
|
+
"CPY",
|
|
154
|
+
"DJ",
|
|
155
|
+
"ANN003",
|
|
156
|
+
"FIX",
|
|
157
|
+
"D100",
|
|
158
|
+
"D101",
|
|
159
|
+
"D102",
|
|
160
|
+
"D103",
|
|
161
|
+
"D104",
|
|
162
|
+
"D105",
|
|
163
|
+
"D106",
|
|
164
|
+
"D107",
|
|
165
|
+
"D205",
|
|
166
|
+
"D203",
|
|
167
|
+
"D212",
|
|
168
|
+
"E501",
|
|
169
|
+
"PIE804",
|
|
170
|
+
"S101",
|
|
171
|
+
"EM101",
|
|
172
|
+
"PYI041",
|
|
173
|
+
"PYI051",
|
|
174
|
+
"PYI046",
|
|
175
|
+
"PYI047",
|
|
176
|
+
"PYI049",
|
|
177
|
+
"PYI053",
|
|
178
|
+
"PYI054",
|
|
179
|
+
"RET501",
|
|
180
|
+
"SIM910",
|
|
181
|
+
"N812",
|
|
182
|
+
"PLC0415",
|
|
183
|
+
"PLR0904",
|
|
184
|
+
"PLR0913",
|
|
185
|
+
"PLR0917",
|
|
186
|
+
"PLR2004",
|
|
187
|
+
"PLR1711",
|
|
188
|
+
"TRY003",
|
|
189
|
+
"T20",
|
|
190
|
+
"SIM105",
|
|
191
|
+
"RET504",
|
|
192
|
+
"PLR0912",
|
|
193
|
+
"PLR0915",
|
|
194
|
+
"SIM105",
|
|
195
|
+
"TD",
|
|
196
|
+
"TC001",
|
|
197
|
+
"TC002",
|
|
198
|
+
"TC003",
|
|
199
|
+
"TC006",
|
|
200
|
+
"PLW0603",
|
|
201
|
+
"EM102",
|
|
202
|
+
"PLW2901",
|
|
203
|
+
"RSE102",
|
|
204
|
+
"PGH004",
|
|
205
|
+
"N806",
|
|
206
|
+
"FBT001",
|
|
207
|
+
"PTH",
|
|
208
|
+
"S310",
|
|
209
|
+
]
|
|
210
|
+
exclude = ["build"]
|
|
211
|
+
|
|
212
|
+
[tool.ruff.lint.per-file-ignores]
|
|
213
|
+
"__init__.py" = [
|
|
214
|
+
"F401",
|
|
215
|
+
"E402",
|
|
216
|
+
]
|
|
217
|
+
"**/tests/**/*.py" = [
|
|
218
|
+
"S104",
|
|
219
|
+
"S105",
|
|
220
|
+
"S106",
|
|
221
|
+
"TRY004",
|
|
222
|
+
"RUF003",
|
|
223
|
+
"RUF012",
|
|
224
|
+
"UP031",
|
|
225
|
+
"SLF001",
|
|
226
|
+
"ARG",
|
|
227
|
+
"N806",
|
|
228
|
+
"ANN001",
|
|
229
|
+
"ANN201",
|
|
230
|
+
"ANN202",
|
|
231
|
+
"ANN204",
|
|
232
|
+
"ANN401",
|
|
233
|
+
"S",
|
|
234
|
+
"SLF001",
|
|
235
|
+
"INP001",
|
|
236
|
+
"PLW0108",
|
|
237
|
+
"EM102",
|
|
238
|
+
"FBT001",
|
|
239
|
+
"SIM300",
|
|
240
|
+
"DTZ001",
|
|
241
|
+
]
|
|
242
|
+
"examples/*.py" = ["INP001"]
|
|
243
|
+
|
|
244
|
+
[tool.ruff.lint.pep8-naming]
|
|
245
|
+
classmethod-decorators = [
|
|
246
|
+
"pydantic.validator",
|
|
247
|
+
"declared_attr",
|
|
248
|
+
"expression",
|
|
249
|
+
"comparator",
|
|
250
|
+
]
|
|
251
|
+
|
|
252
|
+
[tool.ruff.lint.flake8-builtins]
|
|
253
|
+
ignorelist = [
|
|
254
|
+
"id",
|
|
255
|
+
"input",
|
|
256
|
+
]
|
|
257
|
+
|
|
258
|
+
[tool.ruff.lint.flake8-type-checking]
|
|
259
|
+
runtime-evaluated-base-classes = [
|
|
260
|
+
"pydantic.BaseModel",
|
|
261
|
+
"sqlalchemy.orm.DeclarativeBase",
|
|
262
|
+
]
|
|
263
|
+
|
|
264
|
+
[tool.ruff.lint.isort]
|
|
265
|
+
known-first-party = [
|
|
266
|
+
"stdl",
|
|
267
|
+
"tests",
|
|
268
|
+
]
|
|
269
|
+
|
|
270
|
+
[tool.ruff.lint.pydocstyle]
|
|
271
|
+
convention = "google"
|
|
272
|
+
|
|
273
|
+
[tool.ruff.format]
|
|
274
|
+
quote-style = "double"
|
|
275
|
+
indent-style = "space"
|
|
276
|
+
skip-magic-trailing-comma = false
|
|
277
|
+
line-ending = "lf"
|
|
278
|
+
|
|
279
|
+
[tool.uv]
|
|
280
|
+
default-groups = ["test"]
|
|
281
|
+
|
|
282
|
+
[tool.uv.build-backend]
|
|
283
|
+
module-name = "stdl"
|
|
284
|
+
module-root = ""
|
|
285
|
+
|
|
286
|
+
[dependency-groups]
|
|
287
|
+
test = [
|
|
288
|
+
"anyio>=4.0.0",
|
|
289
|
+
"pytest>=9.0.3",
|
|
290
|
+
"coverage>=7.14.1",
|
|
291
|
+
"pydantic>=2",
|
|
292
|
+
]
|
|
293
|
+
dev = [
|
|
294
|
+
{ include-group = "test" },
|
|
295
|
+
"ruff==0.16.10",
|
|
296
|
+
"pre-commit>=4.6.0",
|
|
297
|
+
"pyrefly>=1.0.0",
|
|
298
|
+
"codespell>=2.4.2",
|
|
299
|
+
"rattle-lint>=3.0.0",
|
|
300
|
+
]
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "stdl"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.8.0"
|
|
4
4
|
description = "Extended Python Standard Library"
|
|
5
5
|
authors = [{ name = "Žiga Ivanšek", email = "ziga.ivansek@gmail.com" }]
|
|
6
|
-
license =
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
7
8
|
readme = "README.md"
|
|
8
|
-
requires-python = ">=3.
|
|
9
|
+
requires-python = ">=3.11"
|
|
9
10
|
dependencies = [
|
|
10
11
|
"python-dateutil>=2.8.2",
|
|
11
12
|
"pyyaml>=6.0.2",
|
|
12
13
|
"toml>=0.10.2",
|
|
13
|
-
"typing_extensions>=4.0; python_version < '3.11'",
|
|
14
14
|
]
|
|
15
15
|
|
|
16
16
|
classifiers = [
|
|
17
|
-
"License :: OSI Approved :: MIT License",
|
|
18
17
|
"Typing :: Typed",
|
|
19
18
|
"Operating System :: OS Independent",
|
|
20
19
|
"Intended Audience :: Developers",
|
|
@@ -25,11 +24,11 @@ classifiers = [
|
|
|
25
24
|
"Programming Language :: Python",
|
|
26
25
|
"Programming Language :: Python :: 3",
|
|
27
26
|
"Programming Language :: Python :: 3 :: Only",
|
|
28
|
-
"Programming Language :: Python :: 3.10",
|
|
29
27
|
"Programming Language :: Python :: 3.11",
|
|
30
28
|
"Programming Language :: Python :: 3.12",
|
|
31
29
|
"Programming Language :: Python :: 3.13",
|
|
32
30
|
"Programming Language :: Python :: 3.14",
|
|
31
|
+
"Programming Language :: Python :: 3.15",
|
|
33
32
|
]
|
|
34
33
|
|
|
35
34
|
keywords = [
|
|
@@ -46,44 +45,37 @@ keywords = [
|
|
|
46
45
|
]
|
|
47
46
|
|
|
48
47
|
[project.optional-dependencies]
|
|
48
|
+
async = ["anyio>=4.0.0"]
|
|
49
49
|
full = ["tqdm>=4.67.1"]
|
|
50
50
|
dev = [
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
51
|
+
"anyio>=4.0.0",
|
|
52
|
+
"pytest>=9.0.3",
|
|
53
|
+
"coverage>=7.14.1",
|
|
54
|
+
"ruff==0.16.10",
|
|
55
|
+
"pre-commit>=4.6.0",
|
|
56
|
+
"pyrefly>=1.0.0",
|
|
57
|
+
"codespell>=2.4.2",
|
|
57
58
|
"pydantic>=2",
|
|
59
|
+
"rattle-lint>=3.0.0",
|
|
58
60
|
]
|
|
59
61
|
|
|
60
|
-
test = ["pytest", "coverage", "pydantic>=2"]
|
|
62
|
+
test = ["anyio>=4.0.0", "pytest>=9.0.3", "coverage>=7.14.1", "pydantic>=2"]
|
|
61
63
|
[project.urls]
|
|
62
64
|
Repository = "https://github.com/zigai/stdl"
|
|
63
65
|
Issues = "https://github.com/zigai/stdl/issues"
|
|
64
66
|
Homepage = "https://github.com/zigai/stdl"
|
|
65
67
|
|
|
66
68
|
[build-system]
|
|
67
|
-
requires = ["
|
|
68
|
-
build-backend = "
|
|
69
|
+
requires = ["uv_build>=0.11.25,<0.12.0"]
|
|
70
|
+
build-backend = "uv_build"
|
|
69
71
|
|
|
70
|
-
[tool.
|
|
71
|
-
|
|
72
|
+
[tool.uv.build-backend]
|
|
73
|
+
module-name = "stdl"
|
|
74
|
+
module-root = ""
|
|
72
75
|
|
|
73
76
|
[tool.codespell]
|
|
74
77
|
skip = '.git,uv.lock'
|
|
75
78
|
|
|
76
|
-
[tool.hatch.envs.test]
|
|
77
|
-
features = ["test"]
|
|
78
|
-
installer = "uv"
|
|
79
|
-
|
|
80
|
-
[[tool.hatch.envs.test.matrix]]
|
|
81
|
-
python = ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
82
|
-
|
|
83
|
-
[tool.hatch.envs.test.scripts]
|
|
84
|
-
test = "pytest {args}"
|
|
85
|
-
cov = "coverage run -m pytest {args}"
|
|
86
|
-
|
|
87
79
|
[tool.coverage.run]
|
|
88
80
|
source = ["stdl"]
|
|
89
81
|
branch = true
|
|
@@ -97,21 +89,49 @@ exclude_lines = [
|
|
|
97
89
|
]
|
|
98
90
|
omit = ["tests/*", "tests/**"]
|
|
99
91
|
|
|
100
|
-
[tool.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
92
|
+
[tool.pyrefly]
|
|
93
|
+
project-includes = ["stdl"]
|
|
94
|
+
project-excludes = ["tests/**"]
|
|
95
|
+
disable-project-excludes-heuristics = true
|
|
96
|
+
search-path = ["."]
|
|
97
|
+
disable-search-path-heuristics = true
|
|
98
|
+
python-version = "3.11"
|
|
99
|
+
enabled-ignores = ["type", "pyrefly"]
|
|
100
|
+
use-ignore-files = false
|
|
101
|
+
check-unannotated-defs = true
|
|
102
|
+
infer-return-types = "checked"
|
|
103
|
+
infer-with-first-use = true
|
|
104
|
+
strict-callable-subtyping = false
|
|
105
|
+
spec-compliant-overloads = false
|
|
106
|
+
|
|
107
|
+
[tool.rattle]
|
|
108
|
+
root = true
|
|
109
|
+
enable = [
|
|
110
|
+
"blank-line-after-control-block",
|
|
111
|
+
"blank-line-after-terminal-control-block",
|
|
112
|
+
"blank-line-before-branch",
|
|
113
|
+
"blank-line-before-unrelated-block",
|
|
114
|
+
"no-suite-leading-trailing-blank-lines",
|
|
115
|
+
"module-all-at-bottom",
|
|
116
|
+
"no-underscore-all-exports",
|
|
117
|
+
"forbidden-call",
|
|
118
|
+
"no-relative-imports",
|
|
119
|
+
"no-underscore-import-aliases",
|
|
120
|
+
"no-unsafe-tempfile-factories",
|
|
121
|
+
"no-annotated-self",
|
|
122
|
+
"no-exception-message-variables",
|
|
123
|
+
"no-str-exception-translation",
|
|
124
|
+
"no-underscore-class",
|
|
125
|
+
"public-method-order",
|
|
126
|
+
"no-bare-object-annotations",
|
|
127
|
+
"no-named-tuple",
|
|
128
|
+
"no-static-if-condition",
|
|
129
|
+
"sorted-attributes",
|
|
130
|
+
"use-callable-ellipsis",
|
|
131
|
+
]
|
|
132
|
+
|
|
133
|
+
[tool.rattle.options."forbidden-call"]
|
|
134
|
+
forbidden_calls = ["typing.cast"]
|
|
115
135
|
|
|
116
136
|
[tool.ruff]
|
|
117
137
|
line-length = 100
|
|
@@ -154,6 +174,7 @@ ignore = [
|
|
|
154
174
|
"PLC0415",
|
|
155
175
|
"PLR0904",
|
|
156
176
|
"PLR0913",
|
|
177
|
+
"PLR0917",
|
|
157
178
|
"PLR2004",
|
|
158
179
|
"PLR1711",
|
|
159
180
|
"TRY003",
|
|
@@ -240,3 +261,10 @@ known-first-party = ["stdl", "tests"]
|
|
|
240
261
|
|
|
241
262
|
[tool.ruff.lint.pydocstyle]
|
|
242
263
|
convention = "google"
|
|
264
|
+
|
|
265
|
+
[tool.uv]
|
|
266
|
+
default-groups = ["test"]
|
|
267
|
+
|
|
268
|
+
[dependency-groups]
|
|
269
|
+
test = ["anyio>=4.0.0", "pytest>=9.0.3", "coverage>=7.14.1", "pydantic>=2"]
|
|
270
|
+
dev = [{include-group = "test"}, "ruff==0.16.10", "pre-commit>=4.6.0", "pyrefly>=1.0.0", "codespell>=2.4.2", "rattle-lint>=3.0.0"]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from types import ModuleType
|
|
4
|
+
from typing import TYPE_CHECKING, TypeAlias
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from stdl.fs import AsyncFileHandle, Directory, File
|
|
8
|
+
|
|
9
|
+
LazyExport: TypeAlias = "ModuleType | type[AsyncFileHandle[str] | Directory | File]"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def __getattr__(name: str) -> LazyExport:
|
|
13
|
+
"""Lazily resolve public package exports."""
|
|
14
|
+
if name in {"AsyncFileHandle", "Directory", "File"}:
|
|
15
|
+
from stdl import fs
|
|
16
|
+
|
|
17
|
+
return getattr(fs, name)
|
|
18
|
+
if name in {"color", "decorators", "dt", "fs", "import_lazy", "log", "lst", "net", "st"}:
|
|
19
|
+
import importlib
|
|
20
|
+
|
|
21
|
+
return importlib.import_module(f"stdl.{name}")
|
|
22
|
+
|
|
23
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
__all__ = [
|
|
27
|
+
"AsyncFileHandle",
|
|
28
|
+
"Directory",
|
|
29
|
+
"File",
|
|
30
|
+
"color",
|
|
31
|
+
"decorators",
|
|
32
|
+
"dt",
|
|
33
|
+
"fs",
|
|
34
|
+
"import_lazy",
|
|
35
|
+
"log",
|
|
36
|
+
"lst",
|
|
37
|
+
"net",
|
|
38
|
+
"st",
|
|
39
|
+
]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from stdl import color as color
|
|
2
|
+
from stdl import decorators as decorators
|
|
3
|
+
from stdl import dt as dt
|
|
4
|
+
from stdl import fs as fs
|
|
5
|
+
from stdl import import_lazy as import_lazy
|
|
6
|
+
from stdl import log as log
|
|
7
|
+
from stdl import lst as lst
|
|
8
|
+
from stdl import net as net
|
|
9
|
+
from stdl import st as st
|
|
10
|
+
from stdl.fs import AsyncFileHandle as AsyncFileHandle
|
|
11
|
+
from stdl.fs import Directory as Directory
|
|
12
|
+
from stdl.fs import File as File
|
|
13
|
+
|
|
14
|
+
__all__ = [
|
|
15
|
+
"AsyncFileHandle",
|
|
16
|
+
"Directory",
|
|
17
|
+
"File",
|
|
18
|
+
"color",
|
|
19
|
+
"decorators",
|
|
20
|
+
"dt",
|
|
21
|
+
"fs",
|
|
22
|
+
"import_lazy",
|
|
23
|
+
"log",
|
|
24
|
+
"lst",
|
|
25
|
+
"net",
|
|
26
|
+
"st",
|
|
27
|
+
]
|