Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
225 commits
Select commit Hold shift + click to select a range
2f440e0
add: initial commit with pyoutil features.
Labbeti Jun 20, 2025
2ee2f3c
fix: build system is now specified in pyproject.
Labbeti Jun 20, 2025
4b94ea1
fix: try to fix workflow by unfreeze lock file.
Labbeti Jun 20, 2025
b780c5a
fix: remove torch imports.
Labbeti Jun 20, 2025
7edc73a
add: disk_cache system to cache function outputs on the disk.
Labbeti Jun 20, 2025
adc226a
fix: remove UnionType import since it was not existing in python 3.9.
Labbeti Jun 20, 2025
c4ecca1
mod: update lockfile.
Labbeti Jun 20, 2025
cc7527c
fix: remove duplicated import and Union in typing.
Labbeti Jun 20, 2025
eb2fa6a
fix: import from typing.
Labbeti Jun 20, 2025
b2e2be0
fix: invalid typo.
Labbeti Jun 20, 2025
a628b3d
fix: typing for older python versions.
Labbeti Jun 20, 2025
e40ceaf
mod: replace TypedDict by dataclass for disk_cache.
Labbeti Jun 20, 2025
55178c6
mod: revert dataclass change to dict to facilitate interoperbility in…
Labbeti Jun 20, 2025
f0d4ad2
fix: cache content usage with dict.
Labbeti Jun 20, 2025
0bceb88
mod: remove unused imports.
Labbeti Jun 20, 2025
e29aa71
fix: isinstance with Union in python 3.9.
Labbeti Jun 20, 2025
fed92f6
del: remove requirements to store deps in pyproject.
Labbeti Jun 20, 2025
dc9684d
mod: remove useless noqa.
Labbeti Jun 20, 2025
58af9ea
add: F403 to ignored rules.
Labbeti Jun 20, 2025
2536242
mod: merge with old pyoutil branch.
Labbeti Jun 20, 2025
e2a2a59
docs: add initial auto-generated pages.
Labbeti Jun 20, 2025
ec8ccb5
mod: update version, tags and badges.
Labbeti Jun 20, 2025
6b7d78c
add: readthedocs file.
Labbeti Jun 20, 2025
583dc12
mod: format files with ruff.
Labbeti Jun 20, 2025
5c05de7
add: ipykernel to dev deps.
Labbeti Jun 20, 2025
f033784
del: remove deprecated functions and update import names.
Labbeti Jun 20, 2025
d710002
mod: update version to 0.1.0 and add readme examples.
Labbeti Jun 20, 2025
87137d8
mod: update docs.
Labbeti Jun 20, 2025
17d64d3
mod: clean unused imports.
Labbeti Jun 20, 2025
e329454
fix: disk_cache now stores results from local function in a correct p…
Labbeti Jun 20, 2025
d6ab847
add: importlib fns tests.
Labbeti Jun 20, 2025
8b3ae5b
mod: update error msg in Version.
Labbeti Jun 20, 2025
789df6d
mod: format error msg.
Labbeti Jun 20, 2025
d72d3cb
fix: workaround to avoid error caused by pytest in Version cls.
Labbeti Jun 20, 2025
e21ff26
add: test to improve coverage.
Labbeti Jun 20, 2025
2c0f826
fix: get_default_values output for field without default values.
Labbeti Jun 21, 2025
754cd8d
add: support for text io in load_csv.
Labbeti Jun 21, 2025
84521f7
fix: checksum fns registration order.
Labbeti Jun 21, 2025
306a58a
add: unittests to improve coverage.
Labbeti Jun 21, 2025
bcd38ca
fix: avoid error check in unittest.
Labbeti Jun 21, 2025
4d1cc00
add: is_editable_package in tests.
Labbeti Jun 21, 2025
cdce605
mod: update release date for 0.1.0.
Labbeti Jun 21, 2025
6decc1c
add: setuptools to dev deps.
Labbeti Jun 21, 2025
0f439a6
del: remove deprecated license classifier.
Labbeti Jun 21, 2025
5e50d37
mod: make T_BuiltinNumber and T_BuiltinScalar covariant by default.
Labbeti Jun 22, 2025
00780b6
mod: format code with ruff.
Labbeti Jun 22, 2025
74dbe5d
add: SupportsLen.
Labbeti Jun 22, 2025
324825d
add: randstr now support a range of sizes.
Labbeti Jun 22, 2025
88f05bf
mod: format code.
Labbeti Jun 22, 2025
0e04d66
fix: typing for python 3.9.
Labbeti Jun 23, 2025
fc0a1e5
add: test support for python 3.8.
Labbeti Jun 23, 2025
365f8e2
fix: deps for python 3.8.
Labbeti Jun 23, 2025
548608e
fix: typing and fn call for python 3.8.
Labbeti Jun 23, 2025
aa1760b
fix: union_dicts fn for python 3.8.
Labbeti Jun 23, 2025
432938d
mod: update CHANGELOG.
Labbeti Jun 23, 2025
5a26cd3
add: as_builtin fn.
Labbeti Jun 24, 2025
b5ee9ed
mod: disk_cache now supports custom saving backend fns.
Labbeti Jun 24, 2025
b86e150
mod: update CHANGELOG.
Labbeti Jun 24, 2025
471452b
mod: error when passing generator to isinstance_generic.
Labbeti Jun 24, 2025
dffd5a4
mod: format files with ruff.
Labbeti Jun 24, 2025
5d8bb61
mod: change argname to avoid shadowing dataclass module.
Labbeti Jun 25, 2025
40fb3eb
add: test for union_lists.
Labbeti Jun 25, 2025
3bde1c1
add: test for randstr fn.
Labbeti Jun 25, 2025
59f56fe
fix: as_builtin unittest with Path on windows.
Labbeti Jun 25, 2025
5723b22
add: serialization functions now supports buffered inputs.
Labbeti Jun 25, 2025
3b49f5f
mod: fpath is renamed 'file' to match new arg type: buffered and open…
Labbeti Jun 25, 2025
ff94976
mod: update docs pages.
Labbeti Jun 25, 2025
e9dca33
add: script to update docs.
Labbeti Jun 25, 2025
7e68242
mod: update version for 0.2.0.
Labbeti Jun 25, 2025
0c4e502
add: Counter to as_builtin fn.
Labbeti Jun 26, 2025
f3212db
fix: typing for python 3.8.
Labbeti Jun 27, 2025
2ef6fda
fix: typing for python 3.8 again.
Labbeti Jun 27, 2025
b7f35d7
fix: now converts correctly instances.
Labbeti Jun 27, 2025
b0c0c28
mod: coverage is now only a dev requirement.
Labbeti Jun 27, 2025
c8b0bae
mod: update lockfile.
Labbeti Jun 27, 2025
8606c0b
add: test reduce_add in unittests.
Labbeti Jun 27, 2025
ea260e9
add: RuntimeError when trying to checksum a generator instance.
Labbeti Jun 27, 2025
6baa769
add: check_args_type decorator.
Labbeti Jun 27, 2025
20dc501
add: check_args_type decorator.
Labbeti Jun 27, 2025
cebaad1
mod: update CHANGELOG.
Labbeti Jun 27, 2025
b84cc14
mod: update code for python 3.8.
Labbeti Jun 27, 2025
52622c0
add: SupportsLen and SupportsDiv.
Labbeti Jun 27, 2025
bb4c3ba
mod: update docs.
Labbeti Jun 27, 2025
2b87cf3
mod: update version to 0.3.0.
Labbeti Jun 27, 2025
7a0afa7
mod: is_available_package now supports package with '-'.
Labbeti Jun 28, 2025
88b1ca1
add: docstrings in various function to facilitate usage.
Labbeti Jun 28, 2025
fffd954
mod: update docs and README.
Labbeti Jun 29, 2025
d7372f4
mod: update date for 0.3.0.
Labbeti Jun 29, 2025
8591cd9
mod: Update README.
Labbeti Jun 29, 2025
3496e28
fix: bash path in script.
Labbeti Jun 29, 2025
b163981
mod: update license field in pyproject.
Labbeti Jun 29, 2025
287434a
fix: revert license file dchange to support python 3.8.
Labbeti Jun 29, 2025
6501df8
fix: typo in pyproject.
Labbeti Jun 29, 2025
5a3209d
add/fix: add duplicate_list and fix disk_cache_decorator typing.
Labbeti Jul 6, 2025
3e9fcef
add: dumps_csv, loads_csv, save_csv and read_csv fns.
Labbeti Jul 6, 2025
84db416
add: json and pickle opthers serialization fns.
Labbeti Jul 6, 2025
38c3d50
mod: update windows image in workflow.
Labbeti Jul 6, 2025
a223de6
fix: register priority argument.
Labbeti Jul 7, 2025
23ee513
mod: update CHANGELOG.
Labbeti Jul 7, 2025
7fea2b8
mod: update unittests.
Labbeti Jul 7, 2025
ab5802b
mod: merge with main.
Labbeti Jul 8, 2025
92beaad
mod: merge with main.
Labbeti Jul 8, 2025
b978511
add: deprecated_function decorator can be used without parenthesis.
Labbeti Jul 10, 2025
3078369
mod: update CHANGELOG.
Labbeti Jul 10, 2025
418cd9a
mod: format file with ruff.
Labbeti Jul 11, 2025
89909ec
mod: cmds aliases.
Labbeti Jul 11, 2025
5db17cf
add: JSONL file format support.
Labbeti Jul 12, 2025
2135adc
mod: format with ruff.
Labbeti Jul 12, 2025
90b0905
add: and functions to convert any argparse argument to builtin value.
Labbeti Jul 13, 2025
567160d
mod: update unused imports, CHANGELOG and global imports.
Labbeti Jul 13, 2025
cd6c2de
mod: update docstring.
Labbeti Jul 13, 2025
e9e48be
mod: update typing for older python versions.
Labbeti Jul 13, 2025
c9453c3
fix: parsing JSONL for python 3.8.
Labbeti Jul 13, 2025
2568724
fix: str_to_type with any type order.
Labbeti Jul 13, 2025
61a2a9b
fix: ruff formatting and fix str comparison.
Labbeti Jul 14, 2025
53c0bc1
fix: Version isinstance checking.
Labbeti Jul 14, 2025
30ebffa
fix: Python version is now built after comparison methods.
Labbeti Jul 14, 2025
e1279a0
add: debugging info.
Labbeti Jul 14, 2025
bab7a13
add: debugging info.
Labbeti Jul 14, 2025
2075b76
add: debugging info.
Labbeti Jul 14, 2025
63395cc
mod: update cmds names.
Labbeti Jul 14, 2025
1672ce9
mod: clean code and update dbg msgs.
Labbeti Jul 14, 2025
3ff00e2
fix: try to fix version instantiation.
Labbeti Jul 14, 2025
b0c95ae
del: remove debug code.
Labbeti Jul 14, 2025
67043b3
mod: update unittests.
Labbeti Jul 14, 2025
26b7cad
add: requires_packages decorator.
Labbeti Jul 16, 2025
7f49c16
fix: remove invalid error msg.
Labbeti Jul 16, 2025
5361c04
fix unittest importlib.
Labbeti Jul 16, 2025
a3580ca
del: remove old unused checksum functions.
Labbeti Jul 16, 2025
275a133
add: StrEnum unittest.
Labbeti Jul 16, 2025
0029be7
mod: replace TypeVar by Self typing.
Labbeti Jul 16, 2025
e3be570
mod: update checksum unittest.
Labbeti Jul 16, 2025
63fbc48
del: remove unused imports.
Labbeti Jul 16, 2025
f8389d7
mod: update unittests.
Labbeti Jul 16, 2025
2cfc6f5
add: suffix to fname format in disk_cache functions.
Labbeti Jul 18, 2025
0fb25b1
mod: update docs pages.
Labbeti Jul 18, 2025
aa89518
mod: update docstrings for reduce fns.
Labbeti Jul 18, 2025
0abae8e
mod: update docstrings, unitest and value property for StrEnum.
Labbeti Jul 18, 2025
2cc102d
fix: get_argnames return value.
Labbeti Jul 18, 2025
f494e53
add: unittest for get_current_fn_name fn.
Labbeti Jul 18, 2025
b78ae0b
mod: format code.
Labbeti Jul 18, 2025
905a013
mod: update docs with examples.
Labbeti Jul 18, 2025
8a4b1a2
mod: update numbers for version 0.4.0.
Labbeti Jul 18, 2025
1500fe2
mod: update index doc page.
Labbeti Jul 18, 2025
5e4ec17
fix: re-import missing packages for language servers.
Labbeti Jul 18, 2025
28d97c8
mod: update typing overload order.
Labbeti Jul 22, 2025
d804e66
mod: update typing for Placeholder cls.
Labbeti Jul 29, 2025
1277c39
add: SupportsGetitem protocol.
Labbeti Jul 30, 2025
f060250
fix: typevar for protocol that specify method.
Labbeti Jul 31, 2025
d1d1b6c
fix: docstring in argparse fns.
Labbeti Aug 20, 2025
8ffa717
mod: update checksum with set objects.
Labbeti Aug 22, 2025
1016e4a
mod: update typing and CHANGELOG.
Labbeti Aug 22, 2025
23fc8db
add: seed option to randstr.
Labbeti Aug 22, 2025
f2b04ea
mod: update CHANGELOG.
Labbeti Aug 22, 2025
fe67a6c
fix: seed arg in overloads.
Labbeti Aug 22, 2025
4cf41d3
fix: reload_submodules now accept 0 modules as args.
Labbeti Aug 26, 2025
2d50ce5
mod: update CHANGELOG.
Labbeti Aug 26, 2025
764027e
mod: update CHANGELOG.
Labbeti Aug 26, 2025
3c6c684
mod: update version in init files for 0.4.1.
Labbeti Sep 11, 2025
308a629
Merge branch 'main' into dev
Labbeti Sep 11, 2025
4799e1c
add: ListOrTuple typing.
Labbeti Oct 3, 2025
59f64bf
add: docstrings for disk_cache.
Labbeti Oct 14, 2025
25c50d4
mod: test classic theme for doc.
Labbeti Oct 14, 2025
d53f9f4
fix: try to fix docstring.
Labbeti Oct 14, 2025
6dfec4f
add: sphinx-immaterial extension for docs.
Labbeti Oct 16, 2025
89bf904
fix: removes extras readthedocs requirement group.
Labbeti Oct 16, 2025
82a9d9a
add: sphinx-immaterial in docs requirements file.
Labbeti Oct 16, 2025
5762179
mod: update docstrings.
Labbeti Oct 16, 2025
f8159cd
mod: update docs conf.
Labbeti Oct 16, 2025
7860703
mod: update docstring to protect *args and **kwargs.
Labbeti Oct 16, 2025
19cac76
add: sphinxcontrib.napoleon to parse docstrings.
Labbeti Oct 16, 2025
c5fecf4
mod: try to fix docstring format again.
Labbeti Oct 16, 2025
ca8b87d
mod: try to fix docstring again.
Labbeti Oct 16, 2025
63ae906
fix: docstring again.
Labbeti Oct 16, 2025
ce6d6cb
fix: docstring again.
Labbeti Oct 16, 2025
ba006de
fix: python examples in docstrings for docs.
Labbeti Oct 16, 2025
e566612
mod: update docstrings.
Labbeti Oct 16, 2025
74a9532
add: unzip overload typing.
Labbeti Oct 16, 2025
adfc3d0
del: remove unused io module.
Labbeti Oct 16, 2025
97c8c18
add: github and pypi link in index doc page.
Labbeti Oct 16, 2025
9377dff
fix: protect star in docstrings.
Labbeti Oct 16, 2025
2c7f831
mod/fix: try to remove napoleon and fix unused pages.
Labbeti Oct 16, 2025
d1a3ba3
mod: update docs.
Labbeti Oct 16, 2025
9c7fad9
mod: update docs.
Labbeti Oct 16, 2025
748669a
fix: function when containing arguments with default values.
Labbeti Oct 16, 2025
41a8fb4
fix: `get_argnames` and `filter_and_call` functions when argument `fn…
Labbeti Oct 16, 2025
fa6abf3
mod: update docs.
Labbeti Oct 16, 2025
b37eae9
del: removoe unused docs deps.
Labbeti Oct 16, 2025
1680601
mod: update docs.
Labbeti Oct 16, 2025
9c3d1a2
mod: update docs.
Labbeti Oct 16, 2025
f3a3fee
mod: update version to 0.4.2.
Labbeti Oct 16, 2025
29b1d2d
Merge branch 'main' into dev
Labbeti Oct 16, 2025
26b8a87
mod: update docs.
Labbeti Oct 16, 2025
44a152b
mod: update docstrings.
Labbeti Oct 21, 2025
7872587
add: **kwargs placeholder in as_builtin and identity functions. Also …
Labbeti Oct 21, 2025
9266527
mod: update CHANGELOG.
Labbeti Oct 21, 2025
d81c3b9
add: register_as_builtin_fn fn to global imports.
Labbeti Oct 21, 2025
f74e94d
add: check_only_first in isinstance_generic.
Labbeti Nov 3, 2025
edca956
add/mod: add filter_with_patterns fn and update CHANGELOG.
Labbeti Nov 3, 2025
040a21f
del: remove unused import.
Labbeti Nov 9, 2025
13adb1c
add: include and skipfiles options for print tree function.
Labbeti Nov 9, 2025
9be7fbe
mod: update CHANGELOG.
Labbeti Nov 9, 2025
c97d855
add: experimental dataclassdict wrapper.
Labbeti Nov 11, 2025
e29d8eb
mod: format dataclassdict code.
Labbeti Nov 13, 2025
cad9cab
add: T_Index typevar is now Any by default instead of int.
Labbeti Nov 15, 2025
68404de
del: remove dataclassdict expt class.
Labbeti Nov 16, 2025
d35f1ee
add: option 'sort' to tree_iter.
Labbeti Nov 16, 2025
e5fe0d6
mod: update README and docs.
Labbeti Nov 16, 2025
02bae56
fix: remove unused import.
Labbeti Nov 17, 2025
05f6ff4
fix: kwds args name.
Labbeti Nov 21, 2025
5de8e4d
add: ThreadPoolExecutorHelper class.
Labbeti Dec 5, 2025
3ee7133
mod: format with ruff.
Labbeti Dec 5, 2025
4064eaf
mod: updaet index doc page.
Labbeti Dec 13, 2025
de12367
mod: updaet index doc page.
Labbeti Dec 13, 2025
07f4a5f
mod: update docs pages.
Labbeti Dec 13, 2025
4b0751a
add: matmul typing and reduce fn.
Labbeti Dec 13, 2025
04fc92f
mod: update matmul class and function.
Labbeti Dec 13, 2025
c366fb6
fix: update macos image from 13 to 15 in workflow.
Labbeti Dec 13, 2025
bad97c6
add: new protocols with reversed order.
Labbeti Dec 13, 2025
9cea849
mod: update print_install_info to exclude warning msg.
Labbeti Dec 13, 2025
aebb7e5
mod: update python max version and pypi classifiers.
Labbeti Dec 13, 2025
37350b5
mod: update pythonwrench main description.
Labbeti Dec 13, 2025
e27d384
mod: update version numbers to 0.4.3.
Labbeti Dec 13, 2025
abd3cec
mod: update lockfile.
Labbeti Dec 13, 2025
0f155bd
mod: update workflow to test python 3.14.
Labbeti Dec 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ jobs:
strategy:
matrix:
os: [ubuntu-24.04]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
include:
- os: windows-2022
python-version: "3.8"
- os: windows-latest
python-version: "3.13"
- os: macos-13
python-version: "3.14"
- os: macos-15
python-version: "3.8"
- os: macos-latest
python-version: "3.13"
python-version: "3.14"

steps:
# --- INSTALLATIONS ---
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

All notable changes to this project will be documented in this file.

## [0.4.3] 2025-12-13
### Added
- `as_builtin` now supports `datetime.date` instances.
- `check_only_first` argument in `isinstance_generic` function.
- `filter_with_patterns` function.
- `skipfiles`, `include` and `sort` to `tree_iter` function.
- `SupportsGetitem` protocols now has `T_Index` typevar set to `Any` instead of `int` by default.
- `SupportsGetitem2`, `SupportsGetitemLen2` and `SupportsGetitemIterLen2` protocols with generic parameters in reversed order to match `Mapping[key, value]` order.
- `ThreadPoolExecutorHelper` class.
- `SupportsMatmul` typing class.
- `reduce_matmul` function.

## [0.4.2] 2025-10-16
### Fixed
- `get_argnames` and `filter_and_call` functions when argument `fn` contains arguments with default values.
Expand Down
6 changes: 3 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ authors:
affiliation: IRIT
orcid: 'https://orcid.org/0000-0002-7219-5463'
repository-code: 'https://github.com/Labbeti/pythonwrench/'
abstract: Set of tools for Python that could be in the standard library.
abstract: Python library with tools for typing, manipulating collections, and more!
keywords:
- python
- tools
- utilities
license: MIT
version: 0.4.2
date-released: '2025-10-16'
version: 0.4.3
date-released: '2025-12-13'
93 changes: 46 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,67 @@
<img src='https://readthedocs.org/projects/pythonwrench/badge/?version=stable&style=for-the-badge' alt='Documentation Status' />
</a>

Set of tools for Python that could be in the standard library.
Python library with tools for typing, manipulating collections, and more!

</center>


## Installation

With pip:
With uv:
```bash
pip install pythonwrench
uv add pythonwrench
```

With uv:
With pip:
```bash
uv add pythonwrench
pip install pythonwrench
```

This library has been tested on all Python versions **3.8 - 3.13**, requires only `typing_extensions>=4.10.0`, and runs on **Linux, Mac and Windows** systems.
This library has been tested on all Python versions **3.8 - 3.14**, requires only `typing_extensions>=4.10.0`, and runs on **Linux, Mac and Windows** systems.

## Examples

### Typing

Check generic types with ìsinstance_generic` :

```python
>>> import pythonwrench as pw
>>>
>>> # Behaves like builtin isinstance() :
>>> pw.isinstance_generic({"a": 1, "b": 2}, dict)
... True
>>> # But works with generic types !
>>> pw.isinstance_generic({"a": 1, "b": 2}, dict[str, int])
... True
>>> pw.isinstance_generic({"a": 1, "b": 2}, dict[str, str])
... False
```

... or check specific methods with protocols classes beginning with `Supports`
```python
>>> import pythonwrench as pw
>>>
>>> isinstance({"a": 1, "b": 2}, pw.SupportsIterLen)
... True
>>> isinstance({"a": 1, "b": 2}, pw.SupportsGetitemLen)
... True
```

Finally, you can also force argument type checking with `check_args_types` function :

```python
>>> import pythonwrench as pw

>>> @pw.check_args_types
>>> def f(a: int, b: str) -> str:
>>> return a * b

>>> f(1, "a") # pass check
>>> f(1, 2) # raises TypeError from decorator
```

### Collections

Provides functions to facilitate iterables processing, like `unzip` :
Expand Down Expand Up @@ -80,47 +120,6 @@ Easely converts common python structures like list of dicts to dict of lists :
... {"a.x": 1, "a.y": 2, "b.x": 3, "b.y": 4}
```

### Typing

Check generic types with ìsinstance_generic` :

```python
>>> import pythonwrench as pw
>>>
>>> # Behaves like builtin isinstance() :
>>> pw.isinstance_generic({"a": 1, "b": 2}, dict)
... True
>>> # But works with generic types !
>>> pw.isinstance_generic({"a": 1, "b": 2}, dict[str, int])
... True
>>> pw.isinstance_generic({"a": 1, "b": 2}, dict[str, str])
... False
```

... or check specific methods with protocols classes beginning with `Supports`
```python
>>> import pythonwrench as pw
>>>
>>> # Combines Iterable and Sized !
>>> isinstance({"a": 1, "b": 2}, pw.SupportsGetitemLen)
... True
>>> isinstance({"a": 1, "b": 2}, pw.SupportsIterLen)
... True
```

Finally, you can also force argument type checking with `check_args_types` function :

```python
>>> import pythonwrench as pw

>>> @pw.check_args_types
>>> def f(a: int, b: str) -> str:
>>> return a * b

>>> f(1, "a") # pass check
>>> f(1, 2) # raises TypeError from decorator
```

### Disk caching (memoize)

```python
Expand Down
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@
# ("PyPI", "https://pypi.org/project/pythonwrench/"),
# ],
# }
html_theme_options = {}
html_theme_options = {
"repo_url": "https://github.com/Labbeti/pythonwrench",
"site_url": "https://pypi.org/project/pythonwrench",
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
8 changes: 4 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pythonwrench's documentation
========================================

Set of tools for Python that could be in the standard library.
Python library with tools for typing, manipulating collections, and more!

See the API doc here:

Expand Down Expand Up @@ -98,9 +98,8 @@ Check generic types with ìsinstance_generic` :

import pythonwrench as pw

# Combines Iterable and Sized !
isinstance({"a": 1, "b": 2}, pw.SupportsGetitemLen) # True
isinstance({"a": 1, "b": 2}, pw.SupportsIterLen) # True
isinstance({"a": 1, "b": 2}, pw.SupportsGetitemLen) # True

Finally, you can also force argument type checking with `check_args_types` function :

Expand Down Expand Up @@ -171,4 +170,5 @@ Contact
============================

Maintainer:
- [Étienne Labbé](https://labbeti.github.io/) "Labbeti": labbeti.pub@gmail.com

- `Étienne Labbé<https://labbeti.github.io/>`_ "Labbeti": labbeti.pub@gmail.com
7 changes: 7 additions & 0 deletions docs/pythonwrench.concurrent.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pythonwrench.concurrent module
==============================

.. automodule:: pythonwrench.concurrent
:members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions docs/pythonwrench.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Submodules
pythonwrench.argparse
pythonwrench.cast
pythonwrench.checksum
pythonwrench.concurrent
pythonwrench.csv
pythonwrench.dataclasses
pythonwrench.datetime
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name = "pythonwrench"
authors = [
{name = "Étienne Labbé (Labbeti)", email = "labbeti.pub@gmail.com"},
]
description = "Set of tools for Python that could be in the standard library."
description = "Python library with tools for typing, manipulating collections, and more!"
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.8,<3.15"
keywords = ["python", "tools", "utilities"]
license = {file = "LICENSE"}
# license-files = ["LICENSE"] # unsupported by python 3.8, but will be required in 2026
Expand All @@ -19,8 +19,12 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering",
"Operating System :: OS Independent",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
]
maintainers = [
{name = "Étienne Labbé (Labbeti)", email = "labbeti.pub@gmail.com"},
Expand Down
7 changes: 4 additions & 3 deletions src/pythonwrench/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Set of tools for Python that could be in the standard library."""
"""Python library with tools for typing, manipulating collections, and more!"""

__name__ = "pythonwrench"
__author__ = "Étienne Labbé (Labbeti)"
__author_email__ = "labbeti.pub@gmail.com"
__license__ = "MIT"
__maintainer__ = "Étienne Labbé (Labbeti)"
__status__ = "Development"
__version__ = "0.4.2"
__version__ = "0.4.3"


# Re-import for language servers
Expand Down Expand Up @@ -52,7 +52,7 @@
str_to_optional_str,
str_to_type,
)
from .cast import as_builtin
from .cast import as_builtin, register_as_builtin_fn
from .checksum import checksum_any, register_checksum_fn
from .collections import (
all_eq,
Expand Down Expand Up @@ -151,6 +151,7 @@
PatternLike,
PatternListLike,
compile_patterns,
filter_with_patterns,
find_patterns,
get_key_fn,
match_patterns,
Expand Down
Loading