stdl 0.6.2__tar.gz → 0.6.3__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.6.3/.editorconfig +11 -0
- stdl-0.6.3/.github/workflows/lint.yml +17 -0
- stdl-0.6.3/.github/workflows/publish.yml +20 -0
- stdl-0.6.3/.github/workflows/tests.yml +26 -0
- stdl-0.6.3/.gitignore +134 -0
- stdl-0.6.3/.pre-commit-config.yaml +15 -0
- stdl-0.6.3/.python-version +1 -0
- stdl-0.6.3/.readthedocs.yml +31 -0
- stdl-0.6.3/CONTRIBUTING.md +81 -0
- stdl-0.6.3/Justfile +41 -0
- stdl-0.6.3/PKG-INFO +138 -0
- stdl-0.6.3/README.md +76 -0
- stdl-0.6.2/README.md → stdl-0.6.3/docs/index.md +1 -1
- stdl-0.6.3/docs/reference/color.md +1 -0
- stdl-0.6.3/docs/reference/decorators.md +1 -0
- stdl-0.6.3/docs/reference/dt.md +1 -0
- stdl-0.6.3/docs/reference/fs.md +1 -0
- stdl-0.6.3/docs/reference/import_lazy.md +1 -0
- stdl-0.6.3/docs/reference/log.md +1 -0
- stdl-0.6.3/docs/reference/net.md +1 -0
- stdl-0.6.3/docs/reference/st.md +1 -0
- stdl-0.6.3/docs/requirements.txt +4 -0
- stdl-0.6.3/mkdocs.yml +99 -0
- stdl-0.6.3/pyproject.toml +200 -0
- stdl-0.6.3/stdl/__init__.py +1 -0
- {stdl-0.6.2 → stdl-0.6.3}/stdl/color.py +1 -2
- {stdl-0.6.2 → stdl-0.6.3}/stdl/decorators.py +4 -3
- {stdl-0.6.2 → stdl-0.6.3}/stdl/dt.py +22 -29
- {stdl-0.6.2 → stdl-0.6.3}/stdl/fs.py +58 -68
- stdl-0.6.3/stdl/import_lazy.py +122 -0
- {stdl-0.6.2 → stdl-0.6.3}/stdl/log.py +4 -3
- {stdl-0.6.2 → stdl-0.6.3}/stdl/lst.py +4 -5
- {stdl-0.6.2 → stdl-0.6.3}/stdl/st.py +8 -18
- stdl-0.6.3/uv.lock +853 -0
- stdl-0.6.2/PKG-INFO +0 -74
- stdl-0.6.2/pyproject.toml +0 -94
- stdl-0.6.2/setup.cfg +0 -4
- stdl-0.6.2/setup.py +0 -3
- stdl-0.6.2/stdl/__init__.py +0 -1
- stdl-0.6.2/stdl.egg-info/PKG-INFO +0 -74
- stdl-0.6.2/stdl.egg-info/SOURCES.txt +0 -24
- stdl-0.6.2/stdl.egg-info/dependency_links.txt +0 -1
- stdl-0.6.2/stdl.egg-info/requires.txt +0 -16
- stdl-0.6.2/stdl.egg-info/top_level.txt +0 -1
- {stdl-0.6.2 → stdl-0.6.3}/LICENSE +0 -0
- {stdl-0.6.2 → stdl-0.6.3}/stdl/net.py +0 -0
- {stdl-0.6.2 → stdl-0.6.3}/tests/test_color.py +0 -0
- {stdl-0.6.2 → stdl-0.6.3}/tests/test_decorators.py +0 -0
- {stdl-0.6.2 → stdl-0.6.3}/tests/test_dt.py +0 -0
- {stdl-0.6.2 → stdl-0.6.3}/tests/test_fs.py +0 -0
- {stdl-0.6.2 → stdl-0.6.3}/tests/test_lst.py +0 -0
- {stdl-0.6.2 → stdl-0.6.3}/tests/test_st.py +0 -0
stdl-0.6.3/.editorconfig
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: Lint
|
|
2
|
+
on: [push, pull_request]
|
|
3
|
+
jobs:
|
|
4
|
+
lint:
|
|
5
|
+
runs-on: ubuntu-latest
|
|
6
|
+
steps:
|
|
7
|
+
- uses: actions/checkout@v4
|
|
8
|
+
- name: Install uv
|
|
9
|
+
uses: astral-sh/setup-uv@v3
|
|
10
|
+
- name: Set up Python
|
|
11
|
+
run: uv python install 3.12
|
|
12
|
+
- name: Install dependencies
|
|
13
|
+
run: uv sync --extra dev
|
|
14
|
+
- name: Run ruff
|
|
15
|
+
run: uv run ruff check .
|
|
16
|
+
- name: Run black
|
|
17
|
+
run: uv run black --check .
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: Upload Python Package
|
|
2
|
+
on:
|
|
3
|
+
release:
|
|
4
|
+
types: [published]
|
|
5
|
+
jobs:
|
|
6
|
+
deploy:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@v4
|
|
10
|
+
- name: Install uv
|
|
11
|
+
uses: astral-sh/setup-uv@v3
|
|
12
|
+
- name: Set up Python
|
|
13
|
+
run: uv python install 3.12
|
|
14
|
+
- name: Build and publish
|
|
15
|
+
env:
|
|
16
|
+
TWINE_USERNAME: __token__
|
|
17
|
+
TWINE_PASSWORD: ${{ secrets.TOKEN }}
|
|
18
|
+
run: |
|
|
19
|
+
uv build
|
|
20
|
+
uv run --with twine twine upload dist/*
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
on: [push, pull_request]
|
|
3
|
+
jobs:
|
|
4
|
+
tests:
|
|
5
|
+
runs-on: ubuntu-latest
|
|
6
|
+
strategy:
|
|
7
|
+
fail-fast: false
|
|
8
|
+
matrix:
|
|
9
|
+
python-version: [
|
|
10
|
+
"3.10",
|
|
11
|
+
"3.11",
|
|
12
|
+
"3.12",
|
|
13
|
+
"3.13"
|
|
14
|
+
]
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- name: Install uv
|
|
18
|
+
uses: astral-sh/setup-uv@v3
|
|
19
|
+
|
|
20
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
21
|
+
run: uv python install ${{ matrix.python-version }}
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: uv sync --extra test --python ${{ matrix.python-version }}
|
|
24
|
+
|
|
25
|
+
- name: Run pytest
|
|
26
|
+
run: uv run --python ${{ matrix.python-version }} pytest -v
|
stdl-0.6.3/.gitignore
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
pip-wheel-metadata/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py,cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
target/
|
|
76
|
+
|
|
77
|
+
# Jupyter Notebook
|
|
78
|
+
.ipynb_checkpoints
|
|
79
|
+
|
|
80
|
+
# IPython
|
|
81
|
+
profile_default/
|
|
82
|
+
ipython_config.py
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# pipenv
|
|
86
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
87
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
88
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
89
|
+
# install all needed dependencies.
|
|
90
|
+
#Pipfile.lock
|
|
91
|
+
|
|
92
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
93
|
+
__pypackages__/
|
|
94
|
+
|
|
95
|
+
# Celery stuff
|
|
96
|
+
celerybeat-schedule
|
|
97
|
+
celerybeat.pid
|
|
98
|
+
|
|
99
|
+
# SageMath parsed files
|
|
100
|
+
*.sage.py
|
|
101
|
+
|
|
102
|
+
# Environments
|
|
103
|
+
.env
|
|
104
|
+
.venv
|
|
105
|
+
env/
|
|
106
|
+
venv/
|
|
107
|
+
ENV/
|
|
108
|
+
env.bak/
|
|
109
|
+
venv.bak/
|
|
110
|
+
|
|
111
|
+
# Spyder project settings
|
|
112
|
+
.spyderproject
|
|
113
|
+
.spyproject
|
|
114
|
+
|
|
115
|
+
# Rope project settings
|
|
116
|
+
.ropeproject
|
|
117
|
+
|
|
118
|
+
# mkdocs documentation
|
|
119
|
+
/site
|
|
120
|
+
|
|
121
|
+
# mypy
|
|
122
|
+
.mypy_cache/
|
|
123
|
+
.dmypy.json
|
|
124
|
+
dmypy.json
|
|
125
|
+
|
|
126
|
+
# Pyre type checker
|
|
127
|
+
.pyre/
|
|
128
|
+
|
|
129
|
+
# IDEs
|
|
130
|
+
.vscode
|
|
131
|
+
.idea
|
|
132
|
+
|
|
133
|
+
*example*.py
|
|
134
|
+
*ruff_cache*
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v5.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: trailing-whitespace
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: check-toml
|
|
9
|
+
|
|
10
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
11
|
+
rev: v0.8.4
|
|
12
|
+
hooks:
|
|
13
|
+
- id: ruff
|
|
14
|
+
args: [--fix, --exit-non-zero-on-fix]
|
|
15
|
+
- id: ruff-format
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# .readthedocs.yml
|
|
2
|
+
# Read the Docs configuration file
|
|
3
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
4
|
+
|
|
5
|
+
# Required
|
|
6
|
+
version: 2
|
|
7
|
+
|
|
8
|
+
# Set the OS, Python version and other tools you might need
|
|
9
|
+
|
|
10
|
+
build:
|
|
11
|
+
os: ubuntu-22.04
|
|
12
|
+
tools:
|
|
13
|
+
python: "3.10"
|
|
14
|
+
|
|
15
|
+
# Build documentation in the docs/ directory with Sphinx
|
|
16
|
+
# sphinx:
|
|
17
|
+
# configuration: docs/conf.py
|
|
18
|
+
|
|
19
|
+
# Python environment
|
|
20
|
+
python:
|
|
21
|
+
install:
|
|
22
|
+
# these are needed, because they are not part of standard setup
|
|
23
|
+
- requirements: docs/requirements.txt
|
|
24
|
+
|
|
25
|
+
# Build documentation with MkDocs
|
|
26
|
+
mkdocs:
|
|
27
|
+
configuration: mkdocs.yml
|
|
28
|
+
fail_on_warning: false
|
|
29
|
+
|
|
30
|
+
# Optionally build your docs in additional formats such as PDF and ePub
|
|
31
|
+
formats: all
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Development
|
|
2
|
+
|
|
3
|
+
## Environment
|
|
4
|
+
|
|
5
|
+
For local development, you need Python 3.10 or later installed.
|
|
6
|
+
We use [uv](https://docs.astral.sh/uv/) for project management, [Hatch](https://hatch.pypa.io/latest/) for environment management, and [just](https://github.com/casey/just) as our command runner.
|
|
7
|
+
|
|
8
|
+
## Dependencies
|
|
9
|
+
|
|
10
|
+
To install this package and its development dependencies, run:
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
just dev
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
or
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
uv sync --extra dev
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Code checking
|
|
23
|
+
|
|
24
|
+
To execute all code checking tools together, run:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
just check
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Linting
|
|
31
|
+
|
|
32
|
+
We utilize [ruff](https://docs.astral.sh/ruff/) for linting, which analyzes code for potential issues and enforces consistent style. Refer to `pyproject.toml` for configuration details.
|
|
33
|
+
|
|
34
|
+
To run linting:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
just lint
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Formatting
|
|
41
|
+
|
|
42
|
+
[ruff](https://docs.astral.sh/ruff/) is also used for code formatting. Refer to `pyproject.toml` for configuration details.
|
|
43
|
+
|
|
44
|
+
To run formatting:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
just format
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Testing
|
|
51
|
+
|
|
52
|
+
We use [pytest](https://docs.pytest.org/en/stable/) for testing. You have two options for running tests:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
# Run tests on your current Python version
|
|
56
|
+
uv run --extra test pytest -v
|
|
57
|
+
|
|
58
|
+
# Run tests across all supported Python versions
|
|
59
|
+
just test
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Pre-commit Hooks
|
|
63
|
+
|
|
64
|
+
We use [pre-commit](https://pre-commit.com/) to run quality checks automatically:
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
# Install pre-commit hooks
|
|
68
|
+
uv tool install pre-commit
|
|
69
|
+
pre-commit install
|
|
70
|
+
|
|
71
|
+
# Run hooks manually on all files
|
|
72
|
+
pre-commit run --all-files
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Documentation
|
|
76
|
+
|
|
77
|
+
We follow the [Google docstring format](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html) for code documentation. All user-facing classes and functions must be documented with docstrings and type hints.
|
|
78
|
+
|
|
79
|
+
## Release Process
|
|
80
|
+
|
|
81
|
+
New versions are automatically published to [PyPI](https://pypi.org/project/stdl/) when a GitHub release is created.
|
stdl-0.6.3/Justfile
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@_:
|
|
2
|
+
just --list
|
|
3
|
+
|
|
4
|
+
_require-uv:
|
|
5
|
+
@uv --version > /dev/null || (echo "Please install uv: https://docs.astral.sh/uv/" && exit 1)
|
|
6
|
+
|
|
7
|
+
_require-hatch:
|
|
8
|
+
@hatch --version > /dev/null || (echo "Please install hatch: uv tool install hatch" && exit 1)
|
|
9
|
+
|
|
10
|
+
# check code style and potential issues
|
|
11
|
+
lint:
|
|
12
|
+
ruff check
|
|
13
|
+
|
|
14
|
+
# fix automatically fixable linting issues
|
|
15
|
+
fix:
|
|
16
|
+
ruff check --fix
|
|
17
|
+
|
|
18
|
+
# format code
|
|
19
|
+
format:
|
|
20
|
+
ruff format
|
|
21
|
+
|
|
22
|
+
# run tests across all supported Python versions
|
|
23
|
+
test: _require-hatch
|
|
24
|
+
hatch run test:test
|
|
25
|
+
|
|
26
|
+
# run all quality checks
|
|
27
|
+
check: format lint test
|
|
28
|
+
|
|
29
|
+
# build the package
|
|
30
|
+
build: _require-uv
|
|
31
|
+
uv build
|
|
32
|
+
|
|
33
|
+
# setup development environment
|
|
34
|
+
dev: _require-uv
|
|
35
|
+
uv sync --extra dev
|
|
36
|
+
uv run pre-commit install
|
|
37
|
+
|
|
38
|
+
# clean build artifacts and caches
|
|
39
|
+
clean:
|
|
40
|
+
rm -rf .venv .pytest_cache .mypy_cache .ruff_cache
|
|
41
|
+
find . -type d -name "__pycache__" -exec rm -r {} +
|
stdl-0.6.3/PKG-INFO
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: stdl
|
|
3
|
+
Version: 0.6.3
|
|
4
|
+
Summary: Extended Python Standard Library
|
|
5
|
+
Project-URL: Repository, https://github.com/zigai/stdl
|
|
6
|
+
Project-URL: Documentation, https://stdl.readthedocs.io
|
|
7
|
+
Project-URL: Issues, https://github.com/zigai/stdl/issues
|
|
8
|
+
Project-URL: Homepage, https://github.com/zigai/stdl
|
|
9
|
+
Author-email: Žiga Ivanšek <ziga.ivansek@gmail.com>
|
|
10
|
+
License: MIT License
|
|
11
|
+
|
|
12
|
+
Copyright (c) 2022 Žiga Ivanšek
|
|
13
|
+
|
|
14
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
in the Software without restriction, including without limitation the rights
|
|
17
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
furnished to do so, subject to the following conditions:
|
|
20
|
+
|
|
21
|
+
The above copyright notice and this permission notice shall be included in all
|
|
22
|
+
copies or substantial portions of the Software.
|
|
23
|
+
|
|
24
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
30
|
+
SOFTWARE.
|
|
31
|
+
License-File: LICENSE
|
|
32
|
+
Keywords: ANSI colors,color formats,filesystem,lazy import,list utils,logging configuration,python lazy import,python utilites,standard library,stdl,string utils,terminal links,terminal output
|
|
33
|
+
Classifier: Intended Audience :: Developers
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Operating System :: OS Independent
|
|
36
|
+
Classifier: Programming Language :: Python
|
|
37
|
+
Classifier: Programming Language :: Python :: 3
|
|
38
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
43
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
44
|
+
Classifier: Typing :: Typed
|
|
45
|
+
Requires-Python: >=3.10
|
|
46
|
+
Requires-Dist: python-dateutil>=2.8.2
|
|
47
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
48
|
+
Requires-Dist: toml>=0.10.2
|
|
49
|
+
Requires-Dist: tqdm>=4.67.1
|
|
50
|
+
Provides-Extra: dev
|
|
51
|
+
Requires-Dist: black; extra == 'dev'
|
|
52
|
+
Requires-Dist: mkdocs; extra == 'dev'
|
|
53
|
+
Requires-Dist: mkdocs-autorefs; extra == 'dev'
|
|
54
|
+
Requires-Dist: mkdocs-material; extra == 'dev'
|
|
55
|
+
Requires-Dist: mkdocstrings[python]; extra == 'dev'
|
|
56
|
+
Requires-Dist: pre-commit; extra == 'dev'
|
|
57
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
58
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
59
|
+
Provides-Extra: test
|
|
60
|
+
Requires-Dist: pytest; extra == 'test'
|
|
61
|
+
Description-Content-Type: text/markdown
|
|
62
|
+
|
|
63
|
+
# stdl
|
|
64
|
+
|
|
65
|
+
[](https://github.com/zigai/stdl/actions/workflows/tests.yml)
|
|
66
|
+
[](https://stdl.readthedocs.io/en/latest/?badge=latest)
|
|
67
|
+
[](https://badge.fury.io/py/stdl)
|
|
68
|
+

|
|
69
|
+
[](https://pepy.tech/project/stdl)
|
|
70
|
+
[](https://github.com/zigai/stdl/blob/master/LICENSE)
|
|
71
|
+
|
|
72
|
+
`stdl` is a collection of Python utilities that complement the standard library.
|
|
73
|
+
|
|
74
|
+
## Features
|
|
75
|
+
|
|
76
|
+
- File and directory operations
|
|
77
|
+
- String manipulation
|
|
78
|
+
- ANSI color support for terminal output
|
|
79
|
+
- Date and time formatting
|
|
80
|
+
- List utils
|
|
81
|
+
- Lazy imports
|
|
82
|
+
- Logging configuration for `logging` and `loguru`
|
|
83
|
+
- [See docs](https://stdl.readthedocs.io/en/latest/?badge=latest)
|
|
84
|
+
|
|
85
|
+
## Installation
|
|
86
|
+
|
|
87
|
+
### Using pip
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
pip install stdl
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Using uv
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
uv add stdl
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### From source
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
pip install git+https://github.com/zigai/stdl.git
|
|
103
|
+
# or
|
|
104
|
+
uv add git+https://github.com/zigai/stdl.git
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Examples
|
|
108
|
+
|
|
109
|
+
### Lazy imports
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
from typing import TYPE_CHECKING
|
|
113
|
+
from stdl.import_lazy import import_lazy
|
|
114
|
+
|
|
115
|
+
if TYPE_CHECKING:
|
|
116
|
+
from os.path import abspath, join
|
|
117
|
+
import numpy as np
|
|
118
|
+
import torch
|
|
119
|
+
else:
|
|
120
|
+
import_lazy("os.path", ["join", "abspath"], verbose=True)
|
|
121
|
+
import_lazy("numpy", alias="np", verbose=True)
|
|
122
|
+
import_lazy("torch", verbose=True)
|
|
123
|
+
|
|
124
|
+
print(np.zeros(4))
|
|
125
|
+
# importing "numpy" took 0.060s
|
|
126
|
+
# [0. 0. 0. 0.]
|
|
127
|
+
print(torch)
|
|
128
|
+
# <LazyImport: torch>
|
|
129
|
+
print(torch.randn(8))
|
|
130
|
+
# importing "torch" took 1.118s
|
|
131
|
+
# tensor([0., 0., 0., 0., 0., 0., 0., 0.])
|
|
132
|
+
print(torch)
|
|
133
|
+
# <module 'torch' from .../torch/__init__.py'
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## License
|
|
137
|
+
|
|
138
|
+
[MIT License](https://github.com/zigai/stdl/blob/master/LICENSE)
|
stdl-0.6.3/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# stdl
|
|
2
|
+
|
|
3
|
+
[](https://github.com/zigai/stdl/actions/workflows/tests.yml)
|
|
4
|
+
[](https://stdl.readthedocs.io/en/latest/?badge=latest)
|
|
5
|
+
[](https://badge.fury.io/py/stdl)
|
|
6
|
+

|
|
7
|
+
[](https://pepy.tech/project/stdl)
|
|
8
|
+
[](https://github.com/zigai/stdl/blob/master/LICENSE)
|
|
9
|
+
|
|
10
|
+
`stdl` is a collection of Python utilities that complement the standard library.
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- File and directory operations
|
|
15
|
+
- String manipulation
|
|
16
|
+
- ANSI color support for terminal output
|
|
17
|
+
- Date and time formatting
|
|
18
|
+
- List utils
|
|
19
|
+
- Lazy imports
|
|
20
|
+
- Logging configuration for `logging` and `loguru`
|
|
21
|
+
- [See docs](https://stdl.readthedocs.io/en/latest/?badge=latest)
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
### Using pip
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
pip install stdl
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Using uv
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
uv add stdl
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### From source
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
pip install git+https://github.com/zigai/stdl.git
|
|
41
|
+
# or
|
|
42
|
+
uv add git+https://github.com/zigai/stdl.git
|
|
43
|
+
```
|
|
44
|
+
|
|
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
|
+
## License
|
|
75
|
+
|
|
76
|
+
[MIT License](https://github.com/zigai/stdl/blob/master/LICENSE)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://pepy.tech/project/stdl)
|
|
7
7
|
[](https://github.com/zigai/stdl/blob/master/LICENSE)
|
|
8
8
|
|
|
9
|
-
`stdl` is a collection of Python utilities that complement the standard library.
|
|
9
|
+
`stdl` is a collection of Python utilities that complement the standard library. It provides common functions and tools that developers frequently need, with minimal external dependencies.
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
- File and directory operations
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
::: stdl.color
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
::: stdl.decorators
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
::: stdl.dt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
::: stdl.fs
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
::: stdl.import_lazy
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
::: stdl.log
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
::: stdl.net
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
::: stdl.st
|