https://github.com/zigai/stdl
Extended Python standard library
https://github.com/zigai/stdl
ansi-escape-codes filesystem lazy-imports list-utils python python3 standard-library string-utils utilities
Last synced: 8 days ago
JSON representation
Extended Python standard library
- Host: GitHub
- URL: https://github.com/zigai/stdl
- Owner: zigai
- License: mit
- Created: 2022-03-31T13:36:44.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2026-01-29T21:19:12.000Z (9 days ago)
- Last Synced: 2026-01-30T10:09:22.598Z (8 days ago)
- Topics: ansi-escape-codes, filesystem, lazy-imports, list-utils, python, python3, standard-library, string-utils, utilities
- Language: Python
- Homepage: https://stdl.readthedocs.io
- Size: 404 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# stdl
[](https://github.com/zigai/stdl/actions/workflows/test.yml)
[](https://stdl.readthedocs.io/en/latest/?badge=latest)
[](https://badge.fury.io/py/stdl)

[](https://pepy.tech/project/stdl)
[](https://github.com/zigai/stdl/blob/master/LICENSE)
`stdl` is a collection of Python utilities that complement the standard library.
## Features
- File and directory operations
- String manipulation
- ANSI color support for terminal output
- Date and time formatting
- List utils
- Lazy imports
- Logging configuration for `logging` and `loguru`
- [See docs](https://stdl.readthedocs.io/en/latest/?badge=latest)
## Installation
### Using pip
```sh
pip install stdl
```
### Using uv
```sh
uv add stdl
```
### From source
```sh
pip install git+https://github.com/zigai/stdl.git
# or
uv add git+https://github.com/zigai/stdl.git
```
## Examples
### Lazy imports
```python
from typing import TYPE_CHECKING
from stdl.import_lazy import import_lazy
if TYPE_CHECKING:
from os.path import abspath, join
import numpy as np
import torch
else:
import_lazy("os.path", ["join", "abspath"], verbose=True)
import_lazy("numpy", alias="np", verbose=True)
import_lazy("torch", verbose=True)
print(np.zeros(4))
# importing "numpy" took 0.060s
# [0. 0. 0. 0.]
print(torch)
#
print(torch.randn(8))
# importing "torch" took 1.118s
# tensor([0., 0., 0., 0., 0., 0., 0., 0.])
print(torch)
#