pythonwrench 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.
Files changed (139) hide show
  1. pythonwrench-0.6.3/.github/workflows/test.yaml +69 -0
  2. pythonwrench-0.6.3/.gitignore +182 -0
  3. pythonwrench-0.6.3/.pre-commit-config.yaml +32 -0
  4. pythonwrench-0.6.3/.readthedocs.yaml +26 -0
  5. pythonwrench-0.6.3/CHANGELOG.md +195 -0
  6. pythonwrench-0.6.3/CITATION.cff +21 -0
  7. {pythonwrench-0.6.2/src/pythonwrench.egg-info → pythonwrench-0.6.3}/PKG-INFO +30 -27
  8. pythonwrench-0.6.3/docs/Makefile +20 -0
  9. pythonwrench-0.6.3/docs/conf.py +117 -0
  10. pythonwrench-0.6.3/docs/index.rst +174 -0
  11. pythonwrench-0.6.3/docs/make.bat +35 -0
  12. pythonwrench-0.6.3/docs/modules.rst +7 -0
  13. pythonwrench-0.6.3/docs/pythonwrench.abc.rst +7 -0
  14. pythonwrench-0.6.3/docs/pythonwrench.argparse.dataclass_.rst +7 -0
  15. pythonwrench-0.6.3/docs/pythonwrench.argparse.parsers.rst +7 -0
  16. pythonwrench-0.6.3/docs/pythonwrench.argparse.rst +16 -0
  17. pythonwrench-0.6.3/docs/pythonwrench.cast.rst +7 -0
  18. pythonwrench-0.6.3/docs/pythonwrench.checksum.rst +7 -0
  19. pythonwrench-0.6.3/docs/pythonwrench.collections.collections.rst +7 -0
  20. pythonwrench-0.6.3/docs/pythonwrench.collections.prop.rst +7 -0
  21. pythonwrench-0.6.3/docs/pythonwrench.collections.reducers.rst +7 -0
  22. pythonwrench-0.6.3/docs/pythonwrench.collections.rst +17 -0
  23. pythonwrench-0.6.3/docs/pythonwrench.concurrent.rst +7 -0
  24. pythonwrench-0.6.3/docs/pythonwrench.csv.rst +7 -0
  25. pythonwrench-0.6.3/docs/pythonwrench.dataclasses.rst +7 -0
  26. pythonwrench-0.6.3/docs/pythonwrench.datetime.rst +7 -0
  27. pythonwrench-0.6.3/docs/pythonwrench.difflib.rst +7 -0
  28. pythonwrench-0.6.3/docs/pythonwrench.disk_cache.rst +7 -0
  29. pythonwrench-0.6.3/docs/pythonwrench.enum.rst +7 -0
  30. pythonwrench-0.6.3/docs/pythonwrench.functools.rst +7 -0
  31. pythonwrench-0.6.3/docs/pythonwrench.hashlib.rst +7 -0
  32. pythonwrench-0.6.3/docs/pythonwrench.importlib.rst +7 -0
  33. pythonwrench-0.6.3/docs/pythonwrench.inspect.rst +7 -0
  34. pythonwrench-0.6.3/docs/pythonwrench.json.rst +7 -0
  35. pythonwrench-0.6.3/docs/pythonwrench.jsonl.rst +7 -0
  36. pythonwrench-0.6.3/docs/pythonwrench.logging.rst +7 -0
  37. pythonwrench-0.6.3/docs/pythonwrench.math.rst +7 -0
  38. pythonwrench-0.6.3/docs/pythonwrench.os.rst +7 -0
  39. pythonwrench-0.6.3/docs/pythonwrench.pickle.rst +7 -0
  40. pythonwrench-0.6.3/docs/pythonwrench.random.rst +7 -0
  41. pythonwrench-0.6.3/docs/pythonwrench.re.rst +7 -0
  42. pythonwrench-0.6.3/docs/pythonwrench.rst +50 -0
  43. pythonwrench-0.6.3/docs/pythonwrench.semver.rst +7 -0
  44. pythonwrench-0.6.3/docs/pythonwrench.serialization.csv.rst +7 -0
  45. pythonwrench-0.6.3/docs/pythonwrench.serialization.json.rst +7 -0
  46. pythonwrench-0.6.3/docs/pythonwrench.serialization.jsonl.rst +7 -0
  47. pythonwrench-0.6.3/docs/pythonwrench.serialization.pickle.rst +7 -0
  48. pythonwrench-0.6.3/docs/pythonwrench.serialization.rst +18 -0
  49. pythonwrench-0.6.3/docs/pythonwrench.time.rst +7 -0
  50. pythonwrench-0.6.3/docs/pythonwrench.typing.checks.rst +7 -0
  51. pythonwrench-0.6.3/docs/pythonwrench.typing.classes.rst +7 -0
  52. pythonwrench-0.6.3/docs/pythonwrench.typing.rst +16 -0
  53. pythonwrench-0.6.3/docs/pythonwrench.warnings.rst +7 -0
  54. pythonwrench-0.6.3/docs/update.bash +23 -0
  55. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/pyproject.toml +28 -21
  56. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/__init__.py +27 -1
  57. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/_core.py +49 -29
  58. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/abc.py +1 -0
  59. pythonwrench-0.6.3/src/pythonwrench/argparse/__init__.py +81 -0
  60. pythonwrench-0.6.3/src/pythonwrench/argparse/dataclass_.py +190 -0
  61. pythonwrench-0.6.3/src/pythonwrench/argparse/parsers.py +589 -0
  62. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/cast.py +49 -13
  63. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/checksum.py +46 -3
  64. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/collections/collections.py +92 -25
  65. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/collections/prop.py +7 -2
  66. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/collections/reducers.py +70 -23
  67. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/concurrent.py +3 -0
  68. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/dataclasses.py +8 -0
  69. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/disk_cache.py +29 -8
  70. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/entrypoints/safe_rmdir.py +2 -0
  71. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/entrypoints/tree.py +5 -4
  72. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/enum.py +6 -0
  73. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/functools.py +29 -8
  74. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/hashlib.py +35 -14
  75. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/importlib.py +11 -1
  76. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/logging.py +8 -0
  77. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/math.py +11 -1
  78. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/os.py +4 -2
  79. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/random.py +6 -2
  80. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/re.py +66 -45
  81. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/semver.py +36 -5
  82. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/serialization/_core.py +9 -3
  83. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/serialization/csv.py +20 -5
  84. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/serialization/json.py +9 -1
  85. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/serialization/jsonl.py +9 -1
  86. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/serialization/pickle.py +5 -1
  87. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/typing/checks.py +74 -6
  88. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/typing/classes.py +31 -0
  89. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/warnings.py +14 -4
  90. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_argparse.py +50 -23
  91. pythonwrench-0.6.3/tests/test_core.py +30 -0
  92. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_importlib.py +1 -2
  93. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_typing.py +10 -2
  94. pythonwrench-0.6.3/uv.lock +4376 -0
  95. pythonwrench-0.6.2/PKG-INFO +0 -239
  96. pythonwrench-0.6.2/setup.cfg +0 -4
  97. pythonwrench-0.6.2/src/pythonwrench/argparse.py +0 -563
  98. pythonwrench-0.6.2/src/pythonwrench.egg-info/SOURCES.txt +0 -79
  99. pythonwrench-0.6.2/src/pythonwrench.egg-info/dependency_links.txt +0 -1
  100. pythonwrench-0.6.2/src/pythonwrench.egg-info/entry_points.txt +0 -10
  101. pythonwrench-0.6.2/src/pythonwrench.egg-info/requires.txt +0 -18
  102. pythonwrench-0.6.2/src/pythonwrench.egg-info/top_level.txt +0 -1
  103. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/LICENSE +0 -0
  104. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/README.md +0 -0
  105. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/setup.py +0 -0
  106. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/__main__.py +0 -0
  107. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/collections/__init__.py +0 -0
  108. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/csv.py +0 -0
  109. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/datetime.py +0 -0
  110. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/difflib.py +0 -0
  111. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/entrypoints/info.py +0 -0
  112. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/inspect.py +0 -0
  113. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/json.py +0 -0
  114. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/jsonl.py +0 -0
  115. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/pickle.py +0 -0
  116. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/serialization/__init__.py +0 -0
  117. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/time.py +0 -0
  118. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/src/pythonwrench/typing/__init__.py +0 -0
  119. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_abc.py +0 -0
  120. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_cast.py +0 -0
  121. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_checksum.py +0 -0
  122. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_collections.py +0 -0
  123. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_csv.py +0 -0
  124. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_dataclasses.py +0 -0
  125. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_difflib.py +0 -0
  126. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_disk_cache.py +0 -0
  127. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_entrypoints.py +0 -0
  128. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_enum.py +0 -0
  129. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_functools.py +0 -0
  130. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_hashlib.py +0 -0
  131. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_inspect.py +0 -0
  132. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_json.py +0 -0
  133. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_jsonl.py +0 -0
  134. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_logging.py +0 -0
  135. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_math.py +0 -0
  136. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_os.py +0 -0
  137. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_random.py +0 -0
  138. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_readme.py +0 -0
  139. {pythonwrench-0.6.2 → pythonwrench-0.6.3}/tests/test_semver.py +0 -0
@@ -0,0 +1,69 @@
1
+ # Template: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
2
+
3
+ name: Python package using Pip
4
+
5
+ on:
6
+ push:
7
+ branches: [ main, dev** ]
8
+ pull_request:
9
+ branches: [ main, dev** ]
10
+
11
+ env:
12
+ CACHE_NUMBER: 0 # increase to reset cache manually
13
+ UV_NO_SYNC: 1
14
+
15
+ # Cancel workflow if a new push occurs
16
+ concurrency:
17
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
18
+ cancel-in-progress: true
19
+
20
+ jobs:
21
+ build-and-test:
22
+ runs-on: ${{ matrix.os }}
23
+
24
+ strategy:
25
+ matrix:
26
+ os: [ubuntu-24.04]
27
+ python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
28
+ include:
29
+ - os: windows-2022
30
+ python-version: "3.8"
31
+ - os: windows-latest
32
+ python-version: "3.14"
33
+ - os: macos-15
34
+ python-version: "3.8"
35
+ - os: macos-latest
36
+ python-version: "3.14"
37
+
38
+ steps:
39
+ # --- INSTALLATIONS ---
40
+ - name: Checkout repository
41
+ uses: actions/checkout@v5
42
+
43
+ - name: Install uv and set Python ${{ matrix.python-version }}
44
+ uses: astral-sh/setup-uv@v9.0.0
45
+ with:
46
+ python-version: ${{ matrix.python-version }}
47
+ enable-cache: true
48
+ cache-dependency-glob: "pyproject.toml"
49
+
50
+ - name: Install the project
51
+ run: |
52
+ uv sync --extra tests
53
+
54
+ # --- TESTS ---
55
+ - name: Print install info
56
+ run: |
57
+ uv run pythonwrench-info
58
+
59
+ - name: Check format with Ruff
60
+ run: |
61
+ uv run ruff check
62
+
63
+ - name: Test with coverage + pytest
64
+ run: |
65
+ uv run coverage run -m pytest -v
66
+
67
+ - name: Show coverage results
68
+ run: |
69
+ uv run coverage report -m
@@ -0,0 +1,182 @@
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
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
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
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ #.idea/
169
+
170
+ # Ruff stuff:
171
+ .ruff_cache/
172
+
173
+ # PyPI configuration file
174
+ .pypirc
175
+
176
+ # Custom files/dirs
177
+ local_data
178
+ *.ows.swp*
179
+ results
180
+ scripts/cache/
181
+ .nfs0*
182
+ .vscode
@@ -0,0 +1,32 @@
1
+ # exclude: ""
2
+
3
+ repos:
4
+ # Formatting, Whitespace, etc
5
+ - repo: https://github.com/pre-commit/pre-commit-hooks
6
+ rev: v2.2.3
7
+ hooks:
8
+ - id: trailing-whitespace
9
+ - id: check-added-large-files
10
+ args: ['--maxkb=1000']
11
+ - id: check-ast
12
+ - id: check-json
13
+ - id: check-merge-conflict
14
+ - id: check-xml
15
+ - id: check-yaml
16
+ args: ['--unsafe'] # required because hyperpyyaml has specific constructor not supported by pyyaml (i.e. !apply)
17
+ - id: debug-statements
18
+ - id: end-of-file-fixer
19
+ - id: requirements-txt-fixer
20
+ - id: mixed-line-ending
21
+ args: ['--fix=no']
22
+
23
+ - repo: https://github.com/astral-sh/ruff-pre-commit
24
+ rev: v0.14.9
25
+ hooks:
26
+ - id: ruff
27
+ types_or: [python, pyi]
28
+ args: [--select, I, --fix]
29
+ - id: ruff-format
30
+ types_or: [python, pyi]
31
+ - id: ruff-check
32
+ args: [ --fix ]
@@ -0,0 +1,26 @@
1
+ # .readthedocs.yaml
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 version of Python and other tools you might need
9
+ build:
10
+ os: ubuntu-24.04
11
+ tools:
12
+ python: "3.13"
13
+
14
+ # Build documentation in the docs/ directory with Sphinx
15
+ sphinx:
16
+ configuration: docs/conf.py
17
+
18
+ # If using Sphinx, optionally build your docs in additional formats such as PDF
19
+ # formats:
20
+ # - pdf
21
+ python:
22
+ install:
23
+ - method: pip
24
+ path: .
25
+ extra_requirements:
26
+ - docs
@@ -0,0 +1,195 @@
1
+ # Change log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [0.6.3] 2026-08-06
6
+ ### Added
7
+ - Handle `Enum`, `Path`, and add `register_parser_fn` decorator for `parse_to_type`.
8
+ - `isinstance_generic` now supports parametrized `Callable`.
9
+
10
+ ### Modified
11
+ - Replace build backend `setuptools` by `hatchling`.
12
+
13
+
14
+ ## [0.6.2] 2026-07-30
15
+ ### Added
16
+ - `dataclassdict` decorator and `add_dict_method` function to create dataclass+dict classes.
17
+
18
+ ### Modified
19
+ - `add_dataclass_fields_to_parser` now supports mixed union and literals types.
20
+
21
+ ### Fixed
22
+ - Typing for `function_alias`, `deprecated_alias` and `deprecated_function` decorators.
23
+
24
+
25
+ ## [0.6.1] 2026-07-25
26
+ ### Added
27
+ - `list_parsing` argument value `"brackets"` to `add_dataclass_fields_to_parser`.
28
+ - `pre_fn` and `post_fn` args to `function_alias`, `deprecated_alias` and `deprecated_function`.
29
+ - `ModulePlacerholder` and `import_if_available`
30
+
31
+ ### Fixed
32
+ - Minor compatibilities with python 3.8.
33
+
34
+
35
+ ## [0.6.0] 2026-07-24
36
+ ### Added
37
+ - Add `_fill_all_arguments` option to `filter_and_call`.
38
+ - Add `parse_args_using_dataclass` function to parse program arguments using dataclass.
39
+
40
+ ### Modified
41
+ - Move CSV, JSON, JSONL and PICKLE functions to new `serialization` module.
42
+ - Default value for `key_mode` in `dict_list_to_list_dict` is now `"same"` to match `list_dict_to_dict_list`.
43
+
44
+ ### Fixed
45
+ - `Ticker` class in global context.
46
+ - `is_special_form` and `is_parametrized` now supports objects with custom `__contains__`, like ndarray or DataFrames.
47
+
48
+
49
+ ## [0.5.2] 2026-07-02
50
+ ### Modified
51
+ - `lazy-loader` package is now optional.
52
+
53
+ ### Fixed
54
+ - `Placeholder` and `requires_packages` in global context.
55
+ - `as_builtin` now support conversions of dataclasses attributes, without converting to dict with `dataclasses.asdict`.
56
+
57
+
58
+ ## [0.5.1] 2026-06-19
59
+ ### Added
60
+ - Argument `by` to `sorted_dict` function.
61
+ - `Ticker` class.
62
+ - `SupportsIter` alias of `Iterable`.
63
+ - `is_parameterized`, `is_collection_alias`, `is_special_form` functions.
64
+
65
+ ### Modified
66
+ - Checksum can apply to `date`, `datetime`, parametrized types, collections aliases and special forms.
67
+
68
+
69
+ ## [0.5.0] 2026-03-05
70
+ ### Modified
71
+ - Change default store mode to `"outputs_only"` in disk cache.
72
+ - Change default `fn_name` to function name instead of fully qualified name in disk cache.
73
+ - Lazily load imports if `lazy_loader` package is available.
74
+
75
+
76
+ ## [0.4.10] 2026-02-09
77
+ ### Fixed
78
+ - Disk cache custom keywords arguments for cache filename.
79
+
80
+
81
+ ## [0.4.9] 2026-02-06
82
+ ### Fixed
83
+ - `Version` now ignores buildmetadata when comparing versions.
84
+
85
+
86
+ ## [0.4.8] 2026-02-06
87
+ ### Added
88
+ - `checksum_any` now supports `Enum` instances.
89
+
90
+
91
+ ### Fixed
92
+ - Missing global typing imports.
93
+
94
+
95
+ ## [0.4.7] 2026-02-01
96
+ ### Modified
97
+ - Disk cache functions now detect saving backend when custom load/dump functions are provided.
98
+
99
+ ### Fixed
100
+ - `Callable` in `isinstance_generic` check.
101
+
102
+
103
+ ## [0.4.6] 2026-01-09
104
+ ### Added
105
+ - `cache_fname_fmt` can now be a custom callable formatter.
106
+
107
+
108
+ ## [0.4.5] 2026-01-09
109
+ ### Fixed
110
+ - Documentation build with constraint `sphinx<9.0.0`.
111
+
112
+
113
+ ## [0.4.4] 2026-01-09
114
+ ### Added
115
+ - `SizedGenerator` class wrapper.
116
+ - `executor_kwds` argument to `ThreadPoolExecutorHelper` class.
117
+ - `cache_fname_fmt` argument in `disk_cache` now supports inputs arguments values to name the cache file.
118
+
119
+
120
+ ## [0.4.3] 2025-12-13
121
+ ### Added
122
+ - `as_builtin` now supports `datetime.date` instances.
123
+ - `check_only_first` argument in `isinstance_generic` function.
124
+ - `filter_with_patterns` function.
125
+ - `skipfiles`, `include` and `sort` to `tree_iter` function.
126
+ - `SupportsGetitem` protocols now has `T_Index` typevar set to `Any` instead of `int` by default.
127
+ - `SupportsGetitem2`, `SupportsGetitemLen2` and `SupportsGetitemIterLen2` protocols with generic parameters in reversed order to match `Mapping[key, value]` order.
128
+ - `ThreadPoolExecutorHelper` class.
129
+ - `SupportsMatmul` typing class.
130
+ - `reduce_matmul` function.
131
+
132
+
133
+ ## [0.4.2] 2025-10-16
134
+ ### Fixed
135
+ - `get_argnames` and `filter_and_call` functions when argument `fn` contains arguments with default values.
136
+
137
+
138
+ ## [0.4.1] 2025-09-11
139
+ ### Added
140
+ - `SupportsGetitem` protocol.
141
+ - All `SupportGetitem`-based protocols now accept a second generic to specify idx type.
142
+ - `seed` option to `randstr` function.
143
+
144
+ ### Modified
145
+ - `checksum_any` computation with `set` and `frozenset` objects no longer require to sort elements.
146
+
147
+ ### Fixed
148
+ - Default value for `T_Index` typevar for protocol that specify `__getitem__` method.
149
+ - `reload_editable_submodules` when no editable submodule is imported.
150
+
151
+
152
+ ## [0.4.0] 2025-07-18
153
+ ### Added
154
+ - `duplicate_list` function to duplicate elements in a list.
155
+ - `loads`, `save`, `read` functions for CSV, JSON and PICKLE.
156
+ - JSONL file format support.
157
+ - `str_to_type` and `parse_to` functions to convert any argparse argument to builtin value.
158
+ - `requires_packages` decorator to avoid calling a function that requires an optional dependency.
159
+
160
+ ### Modified
161
+ - `deprecated_function` decorator can be used without parenthesis.
162
+
163
+ ### Fixed
164
+ - `disk_cache_decorator` typing.
165
+ - `priority` argument in `register` method of `_FunctionRegistry` class.
166
+ - `get_argnames` returns when function contains local variables.
167
+
168
+
169
+ ## [0.3.0] 2025-06-29
170
+ ### Added
171
+ - `check_args_type` decorator.
172
+
173
+ ### Modified
174
+ - `as_builtin` now converts `collections.Counter` instances.
175
+
176
+ ### Fixed
177
+ - `as_builtin` now converts correctly `Mapping` instances.
178
+ - `register_checksum_fn` now accepts `priority` arg.
179
+
180
+
181
+ ## [0.2.0] 2025-06-25
182
+ ### Added
183
+ - Python 3.8 support.
184
+ - `T_BuiltinNumber` and `T_BuiltinScalar` are covariant by default.
185
+ - `SupportsLen` protocol.
186
+ - `randstr` now support a range of sizes.
187
+ - `as_builtin` function to convert object to built-in equivalent recursively.
188
+
189
+ ### Modified
190
+ - `disk_cache_decorator` now supports custom saving backend fns.
191
+
192
+
193
+ ## [0.1.0] 2025-06-21
194
+ ### Added
195
+ - Initial modules from `pyoutil` module contained in [torchoutil](https://github.com/Labbeti/torchoutil) project.
@@ -0,0 +1,21 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ cff-version: 1.2.0
4
+ title: pythonwrench
5
+ message: 'If you use this software, please cite it as below.'
6
+ type: software
7
+ authors:
8
+ - given-names: Étienne
9
+ family-names: Labbé
10
+ email: labbeti.pub@gmail.com
11
+ affiliation: IRIT
12
+ orcid: 'https://orcid.org/0000-0002-7219-5463'
13
+ repository-code: 'https://github.com/Labbeti/pythonwrench/'
14
+ abstract: Python library with tools for typing, manipulating collections, and more!
15
+ keywords:
16
+ - python
17
+ - tools
18
+ - utilities
19
+ license: MIT
20
+ version: 0.6.3
21
+ date-released: '2026-08-06'
@@ -1,7 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pythonwrench
3
- Version: 0.6.2
3
+ Version: 0.6.3
4
4
  Summary: Python library with tools for typing, manipulating collections, and more!
5
+ Project-URL: Homepage, https://pypi.org/project/pythonwrench/
6
+ Project-URL: Documentation, https://pythonwrench.readthedocs.io/
7
+ Project-URL: Repository, https://github.com/Labbeti/pythonwrench.git
8
+ Project-URL: Changelog, https://github.com/Labbeti/pythonwrench/blob/main/CHANGELOG.md
9
+ Project-URL: Tracker, https://github.com/Labbeti/pythonwrench/issues
5
10
  Author-email: "Étienne Labbé (Labbeti)" <labbeti.pub@gmail.com>
6
11
  Maintainer-email: "Étienne Labbé (Labbeti)" <labbeti.pub@gmail.com>
7
12
  License: MIT License
@@ -25,15 +30,14 @@ License: MIT License
25
30
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
31
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
32
  SOFTWARE.
28
-
29
- Project-URL: Homepage, https://pypi.org/project/pythonwrench/
30
- Project-URL: Documentation, https://pythonwrench.readthedocs.io/
31
- Project-URL: Repository, https://github.com/Labbeti/pythonwrench.git
32
- Project-URL: Changelog, https://github.com/Labbeti/pythonwrench/blob/main/CHANGELOG.md
33
- Project-URL: Tracker, https://github.com/Labbeti/pythonwrench/issues
33
+ License-File: LICENSE
34
34
  Keywords: python,tools,utilities
35
35
  Classifier: Intended Audience :: Developers
36
36
  Classifier: Intended Audience :: Science/Research
37
+ Classifier: Operating System :: MacOS :: MacOS X
38
+ Classifier: Operating System :: Microsoft :: Windows
39
+ Classifier: Operating System :: OS Independent
40
+ Classifier: Operating System :: POSIX
37
41
  Classifier: Programming Language :: Python :: 3
38
42
  Classifier: Programming Language :: Python :: 3.8
39
43
  Classifier: Programming Language :: Python :: 3.9
@@ -43,30 +47,29 @@ Classifier: Programming Language :: Python :: 3.12
43
47
  Classifier: Programming Language :: Python :: 3.13
44
48
  Classifier: Programming Language :: Python :: 3.14
45
49
  Classifier: Topic :: Scientific/Engineering
46
- Classifier: Operating System :: OS Independent
47
- Classifier: Operating System :: MacOS :: MacOS X
48
- Classifier: Operating System :: Microsoft :: Windows
49
- Classifier: Operating System :: POSIX
50
50
  Requires-Python: <3.15,>=3.8
51
- Description-Content-Type: text/markdown
52
- License-File: LICENSE
53
51
  Requires-Dist: typing-extensions>=4.10.0
54
52
  Provides-Extra: dev
55
- Requires-Dist: pandas>=2.0.3; extra == "dev"
56
- Requires-Dist: coverage[toml]>=7.6.1; extra == "dev"
57
- Requires-Dist: ruff>=0.12.0; extra == "dev"
58
- Requires-Dist: sphinx<9.0.0; extra == "dev"
59
- Requires-Dist: sphinx-immaterial>=0.11.14; extra == "dev"
60
- Requires-Dist: flake8>=5.0.4; extra == "dev"
61
- Requires-Dist: ipykernel>=6.29.5; extra == "dev"
62
- Requires-Dist: ipython>=8.12.3; extra == "dev"
63
- Requires-Dist: pre-commit>=3.5.0; extra == "dev"
64
- Requires-Dist: pytest>=8.3.5; extra == "dev"
65
- Requires-Dist: setuptools>=75.3.2; extra == "dev"
66
- Requires-Dist: twine>=6.1.0; extra == "dev"
53
+ Requires-Dist: coverage[toml]>=7.6.1; extra == 'dev'
54
+ Requires-Dist: ipykernel>=6.29.5; extra == 'dev'
55
+ Requires-Dist: ipython>=8.12.3; extra == 'dev'
56
+ Requires-Dist: pandas>=2.0.3; extra == 'dev'
57
+ Requires-Dist: pre-commit>=3.5.0; extra == 'dev'
58
+ Requires-Dist: pytest>=8.3.5; extra == 'dev'
59
+ Requires-Dist: ruff~=0.14.9; extra == 'dev'
60
+ Requires-Dist: sphinx-immaterial>=0.11.14; extra == 'dev'
61
+ Requires-Dist: sphinx<9.0.0,>=7.1.2; extra == 'dev'
62
+ Requires-Dist: twine>=6.1.0; extra == 'dev'
63
+ Provides-Extra: docs
64
+ Requires-Dist: sphinx-immaterial>=0.11.14; extra == 'docs'
65
+ Requires-Dist: sphinx<9.0.0,>=7.1.2; extra == 'docs'
67
66
  Provides-Extra: lazy
68
- Requires-Dist: lazy-loader<0.5,>=0.4; extra == "lazy"
69
- Dynamic: license-file
67
+ Requires-Dist: lazy-loader<1,>=0.4; extra == 'lazy'
68
+ Provides-Extra: tests
69
+ Requires-Dist: coverage[toml]>=7.6.1; extra == 'tests'
70
+ Requires-Dist: pytest>=8.3.5; extra == 'tests'
71
+ Requires-Dist: ruff~=0.14.9; extra == 'tests'
72
+ Description-Content-Type: text/markdown
70
73
 
71
74
  # pythonwrench
72
75
 
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = .
9
+ BUILDDIR = _build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)