kaparoo-python 0.1.12__tar.gz → 0.2.1__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.
- {kaparoo_python-0.1.12 → kaparoo_python-0.2.1}/LICENSE +20 -20
- kaparoo_python-0.2.1/PKG-INFO +91 -0
- kaparoo_python-0.2.1/README.md +70 -0
- kaparoo_python-0.1.12/kaparoo/data/files/base.py → kaparoo_python-0.2.1/kaparoo/data/sequence.py +39 -45
- {kaparoo_python-0.1.12 → kaparoo_python-0.2.1}/kaparoo/data/utils.py +46 -49
- {kaparoo_python-0.1.12 → kaparoo_python-0.2.1}/kaparoo/filesystem/__init__.py +73 -56
- kaparoo_python-0.2.1/kaparoo/filesystem/directory.py +226 -0
- {kaparoo_python-0.1.12 → kaparoo_python-0.2.1}/kaparoo/filesystem/exceptions.py +17 -15
- {kaparoo_python-0.1.12 → kaparoo_python-0.2.1}/kaparoo/filesystem/existence.py +392 -392
- kaparoo_python-0.2.1/kaparoo/filesystem/search/__init__.py +85 -0
- kaparoo_python-0.2.1/kaparoo/filesystem/search/classes.py +208 -0
- kaparoo_python-0.2.1/kaparoo/filesystem/search/deprecated.py +289 -0
- kaparoo_python-0.2.1/kaparoo/filesystem/search/filters/__init__.py +73 -0
- kaparoo_python-0.2.1/kaparoo/filesystem/search/filters/base.py +92 -0
- kaparoo_python-0.2.1/kaparoo/filesystem/search/filters/logical.py +138 -0
- kaparoo_python-0.2.1/kaparoo/filesystem/search/filters/multi_pattern.py +154 -0
- kaparoo_python-0.2.1/kaparoo/filesystem/search/filters/pattern.py +210 -0
- kaparoo_python-0.2.1/kaparoo/filesystem/search/filters/types.py +47 -0
- kaparoo_python-0.2.1/kaparoo/filesystem/search/filters/utils.py +51 -0
- kaparoo_python-0.2.1/kaparoo/filesystem/search/wrappers.py +318 -0
- kaparoo_python-0.2.1/kaparoo/filesystem/types.py +9 -0
- kaparoo_python-0.2.1/kaparoo/filesystem/utils.py +208 -0
- kaparoo_python-0.2.1/kaparoo/utils/__init__.py +21 -0
- {kaparoo_python-0.1.12 → kaparoo_python-0.2.1}/kaparoo/utils/optional.py +129 -151
- kaparoo_python-0.2.1/kaparoo/utils/timer.py +374 -0
- kaparoo_python-0.2.1/pyproject.toml +266 -0
- kaparoo_python-0.1.12/.gitignore +0 -207
- kaparoo_python-0.1.12/PKG-INFO +0 -69
- kaparoo_python-0.1.12/README.md +0 -23
- kaparoo_python-0.1.12/kaparoo/__about__.py +0 -1
- kaparoo_python-0.1.12/kaparoo/data/files/__init__.py +0 -0
- kaparoo_python-0.1.12/kaparoo/filesystem/directory.py +0 -419
- kaparoo_python-0.1.12/kaparoo/filesystem/types.py +0 -8
- kaparoo_python-0.1.12/kaparoo/filesystem/utils.py +0 -139
- kaparoo_python-0.1.12/kaparoo/utils/__init__.py +0 -0
- kaparoo_python-0.1.12/kaparoo/utils/types.py +0 -9
- kaparoo_python-0.1.12/pyproject.toml +0 -129
- {kaparoo_python-0.1.12 → kaparoo_python-0.2.1}/kaparoo/__init__.py +0 -0
- {kaparoo_python-0.1.12 → kaparoo_python-0.2.1}/kaparoo/data/__init__.py +0 -0
- {kaparoo_python-0.1.12 → kaparoo_python-0.2.1}/kaparoo/py.typed +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 Jaewoo Park
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Jaewoo Park
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kaparoo-python
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Personally common and useful Python features
|
|
5
|
+
Keywords: filesystem,pathlib,paths,utilities
|
|
6
|
+
Author: Jaewoo Park
|
|
7
|
+
Author-email: Jaewoo Park <kaparoo2001@gmail.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
16
|
+
Classifier: Typing :: Typed
|
|
17
|
+
Requires-Python: >=3.14
|
|
18
|
+
Project-URL: GitHub, https://www.github.com/kaparoo/kaparoo-python
|
|
19
|
+
Project-URL: Issues, https://www.github.com/kaparoo/kaparoo-python/issues
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# kaparoo-python
|
|
23
|
+
|
|
24
|
+
[](https://pypi.org/project/kaparoo-python/)
|
|
25
|
+
[](https://pypi.org/project/kaparoo-python/)
|
|
26
|
+
[](https://www.python.org/)
|
|
27
|
+
[](./LICENSE)
|
|
28
|
+
[](https://github.com/astral-sh/uv)
|
|
29
|
+
[](https://github.com/astral-sh/ruff)
|
|
30
|
+
[](https://github.com/astral-sh/ty)
|
|
31
|
+
[](https://github.com/copier-org/copier)
|
|
32
|
+
|
|
33
|
+
*Personally common and useful Python features.*
|
|
34
|
+
|
|
35
|
+
## 📦 Installation
|
|
36
|
+
|
|
37
|
+
Requires Python 3.14+.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# With uv (recommended)
|
|
41
|
+
uv add kaparoo-python
|
|
42
|
+
|
|
43
|
+
# With pip
|
|
44
|
+
pip install kaparoo-python
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 🧩 Modules
|
|
48
|
+
|
|
49
|
+
### `kaparoo.filesystem`
|
|
50
|
+
|
|
51
|
+
`pathlib`-based filesystem helpers.
|
|
52
|
+
|
|
53
|
+
- **`existence`** — existence checks (`*_exists`) and `ensure_*` validators.
|
|
54
|
+
- **`directory`** — `make_dir(s)`, `dir_empty(s)` (with `_unsafe` variants).
|
|
55
|
+
- **`utils`** — `stringify_path(s)`, `wrap_path(s)`.
|
|
56
|
+
- **`exceptions`** — `DirectoryNotFoundError`, `NotAFileError`.
|
|
57
|
+
- **`types`** — `StrPath`, `StrPaths`.
|
|
58
|
+
|
|
59
|
+
### `kaparoo.filesystem.search`
|
|
60
|
+
|
|
61
|
+
Filesystem traversal with composable filters.
|
|
62
|
+
|
|
63
|
+
- **Entry points** — `search_paths`, `search_files`, `search_dirs`.
|
|
64
|
+
- **Pattern filters** — `Equals`, `StartsWith`, `EndsWith`, `Contains`,
|
|
65
|
+
`Regex`, `Glob`.
|
|
66
|
+
- **Multi-pattern filters** — `EqualsAny`, `StartsWithAny`, `EndsWithAny`,
|
|
67
|
+
`ContainsAny`.
|
|
68
|
+
- **Logical filters** — `And`, `Or`, `Not`.
|
|
69
|
+
- **Serialization** — `Filter.to_dict()` / `Filter.from_dict()` round-trip
|
|
70
|
+
via a `"kind"` discriminator; `Filter.parse()` accepts a `Filter` or a
|
|
71
|
+
`FilterDict`; `register_filter(kind)` extends the dispatcher with
|
|
72
|
+
custom subclasses. `FilterDict` family lives at
|
|
73
|
+
`kaparoo.filesystem.search.filters.types`.
|
|
74
|
+
- **Deprecated** — `get_paths`, `get_files`, `get_dirs` (use `search_*`).
|
|
75
|
+
|
|
76
|
+
### `kaparoo.utils`
|
|
77
|
+
|
|
78
|
+
- **`timer`** — `Timer` and `LapTimer` context-manager / decorator timers.
|
|
79
|
+
- **`optional`** — `replace_if_none`, `factory_if_none`, `unwrap_or_*`.
|
|
80
|
+
|
|
81
|
+
## 📋 TODO
|
|
82
|
+
|
|
83
|
+
See [TODO.md](./TODO.md) for tracked open items.
|
|
84
|
+
|
|
85
|
+
## 📜 Changelog
|
|
86
|
+
|
|
87
|
+
See [CHANGELOG.md](./CHANGELOG.md) for the version history.
|
|
88
|
+
|
|
89
|
+
## ⚖️ License
|
|
90
|
+
|
|
91
|
+
This project is distributed under the terms of the [MIT](./LICENSE) license.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# kaparoo-python
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/kaparoo-python/)
|
|
4
|
+
[](https://pypi.org/project/kaparoo-python/)
|
|
5
|
+
[](https://www.python.org/)
|
|
6
|
+
[](./LICENSE)
|
|
7
|
+
[](https://github.com/astral-sh/uv)
|
|
8
|
+
[](https://github.com/astral-sh/ruff)
|
|
9
|
+
[](https://github.com/astral-sh/ty)
|
|
10
|
+
[](https://github.com/copier-org/copier)
|
|
11
|
+
|
|
12
|
+
*Personally common and useful Python features.*
|
|
13
|
+
|
|
14
|
+
## 📦 Installation
|
|
15
|
+
|
|
16
|
+
Requires Python 3.14+.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# With uv (recommended)
|
|
20
|
+
uv add kaparoo-python
|
|
21
|
+
|
|
22
|
+
# With pip
|
|
23
|
+
pip install kaparoo-python
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 🧩 Modules
|
|
27
|
+
|
|
28
|
+
### `kaparoo.filesystem`
|
|
29
|
+
|
|
30
|
+
`pathlib`-based filesystem helpers.
|
|
31
|
+
|
|
32
|
+
- **`existence`** — existence checks (`*_exists`) and `ensure_*` validators.
|
|
33
|
+
- **`directory`** — `make_dir(s)`, `dir_empty(s)` (with `_unsafe` variants).
|
|
34
|
+
- **`utils`** — `stringify_path(s)`, `wrap_path(s)`.
|
|
35
|
+
- **`exceptions`** — `DirectoryNotFoundError`, `NotAFileError`.
|
|
36
|
+
- **`types`** — `StrPath`, `StrPaths`.
|
|
37
|
+
|
|
38
|
+
### `kaparoo.filesystem.search`
|
|
39
|
+
|
|
40
|
+
Filesystem traversal with composable filters.
|
|
41
|
+
|
|
42
|
+
- **Entry points** — `search_paths`, `search_files`, `search_dirs`.
|
|
43
|
+
- **Pattern filters** — `Equals`, `StartsWith`, `EndsWith`, `Contains`,
|
|
44
|
+
`Regex`, `Glob`.
|
|
45
|
+
- **Multi-pattern filters** — `EqualsAny`, `StartsWithAny`, `EndsWithAny`,
|
|
46
|
+
`ContainsAny`.
|
|
47
|
+
- **Logical filters** — `And`, `Or`, `Not`.
|
|
48
|
+
- **Serialization** — `Filter.to_dict()` / `Filter.from_dict()` round-trip
|
|
49
|
+
via a `"kind"` discriminator; `Filter.parse()` accepts a `Filter` or a
|
|
50
|
+
`FilterDict`; `register_filter(kind)` extends the dispatcher with
|
|
51
|
+
custom subclasses. `FilterDict` family lives at
|
|
52
|
+
`kaparoo.filesystem.search.filters.types`.
|
|
53
|
+
- **Deprecated** — `get_paths`, `get_files`, `get_dirs` (use `search_*`).
|
|
54
|
+
|
|
55
|
+
### `kaparoo.utils`
|
|
56
|
+
|
|
57
|
+
- **`timer`** — `Timer` and `LapTimer` context-manager / decorator timers.
|
|
58
|
+
- **`optional`** — `replace_if_none`, `factory_if_none`, `unwrap_or_*`.
|
|
59
|
+
|
|
60
|
+
## 📋 TODO
|
|
61
|
+
|
|
62
|
+
See [TODO.md](./TODO.md) for tracked open items.
|
|
63
|
+
|
|
64
|
+
## 📜 Changelog
|
|
65
|
+
|
|
66
|
+
See [CHANGELOG.md](./CHANGELOG.md) for the version history.
|
|
67
|
+
|
|
68
|
+
## ⚖️ License
|
|
69
|
+
|
|
70
|
+
This project is distributed under the terms of the [MIT](./LICENSE) license.
|
kaparoo_python-0.1.12/kaparoo/data/files/base.py → kaparoo_python-0.2.1/kaparoo/data/sequence.py
RENAMED
|
@@ -1,45 +1,39 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
__all__ = ("DataSequence",)
|
|
4
|
-
|
|
5
|
-
from abc import abstractmethod
|
|
6
|
-
from collections.abc import Sequence
|
|
7
|
-
from typing import TYPE_CHECKING, overload
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@abstractmethod
|
|
19
|
-
def
|
|
20
|
-
raise NotImplementedError
|
|
21
|
-
|
|
22
|
-
@
|
|
23
|
-
def
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
@abstractmethod
|
|
41
|
-
def by_index(self: Self, index: int) -> T_co:
|
|
42
|
-
raise NotImplementedError
|
|
43
|
-
|
|
44
|
-
def by_indices(self: Self, indices: Sequence[int]) -> Sequence[T_co]:
|
|
45
|
-
return [self.by_index(index) for index in indices]
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
__all__ = ("DataSequence",)
|
|
4
|
+
|
|
5
|
+
from abc import abstractmethod
|
|
6
|
+
from collections.abc import Sequence
|
|
7
|
+
from typing import TYPE_CHECKING, overload
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from kaparoo.filesystem.types import StrPath
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class DataSequence[T](Sequence[T]):
|
|
14
|
+
@abstractmethod
|
|
15
|
+
def __init__(self, path: StrPath) -> None:
|
|
16
|
+
raise NotImplementedError
|
|
17
|
+
|
|
18
|
+
@abstractmethod
|
|
19
|
+
def __len__(self) -> int:
|
|
20
|
+
raise NotImplementedError
|
|
21
|
+
|
|
22
|
+
@overload
|
|
23
|
+
def __getitem__(self, index: int, /) -> T: ...
|
|
24
|
+
|
|
25
|
+
@overload
|
|
26
|
+
def __getitem__(self, index: slice, /) -> Sequence[T]: ...
|
|
27
|
+
|
|
28
|
+
def __getitem__(self, index: int | slice, /) -> T | Sequence[T]:
|
|
29
|
+
if isinstance(index, slice):
|
|
30
|
+
start, stop, step = index.indices(len(self))
|
|
31
|
+
return self.by_indices(range(start, stop, step))
|
|
32
|
+
return self.by_index(index)
|
|
33
|
+
|
|
34
|
+
@abstractmethod
|
|
35
|
+
def by_index(self, index: int) -> T:
|
|
36
|
+
raise NotImplementedError
|
|
37
|
+
|
|
38
|
+
def by_indices(self, indices: Sequence[int]) -> Sequence[T]:
|
|
39
|
+
return [self.by_index(index) for index in indices]
|
|
@@ -1,49 +1,46 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
__all__ = ("generate_batches",)
|
|
4
|
-
|
|
5
|
-
from typing import TYPE_CHECKING
|
|
6
|
-
|
|
7
|
-
from kaparoo.utils.optional import replace_if_none
|
|
8
|
-
|
|
9
|
-
if TYPE_CHECKING:
|
|
10
|
-
from collections.abc import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
die_if_not_positive("
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
tail
|
|
47
|
-
|
|
48
|
-
if not drop_last and head < stop:
|
|
49
|
-
yield sequence[head:tail:skip]
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
__all__ = ("generate_batches",)
|
|
4
|
+
|
|
5
|
+
from typing import TYPE_CHECKING
|
|
6
|
+
|
|
7
|
+
from kaparoo.utils.optional import replace_if_none
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from collections.abc import Iterator, Sequence
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def generate_batches[T](
|
|
14
|
+
sequence: Sequence[T],
|
|
15
|
+
size: int,
|
|
16
|
+
step: int = 1,
|
|
17
|
+
skip: int = 1,
|
|
18
|
+
start: int = 0,
|
|
19
|
+
stop: int | None = None,
|
|
20
|
+
*,
|
|
21
|
+
drop_last: bool = True,
|
|
22
|
+
) -> Iterator[Sequence[T]]:
|
|
23
|
+
def die_if_not_positive(name: str, value: int) -> None:
|
|
24
|
+
if value <= 0:
|
|
25
|
+
msg = f"{name} must be positive (got {value})"
|
|
26
|
+
raise ValueError(msg)
|
|
27
|
+
|
|
28
|
+
die_if_not_positive("size", size)
|
|
29
|
+
die_if_not_positive("step", step)
|
|
30
|
+
die_if_not_positive("skip", skip)
|
|
31
|
+
|
|
32
|
+
stop = replace_if_none(stop, len_ := len(sequence))
|
|
33
|
+
if not (start < stop <= len_ and start >= 0):
|
|
34
|
+
msg = f"invalid range [{start}, {stop}) for sequence of length {len_}"
|
|
35
|
+
raise ValueError(msg)
|
|
36
|
+
|
|
37
|
+
head = start
|
|
38
|
+
tail = head + (size - 1) * skip + 1
|
|
39
|
+
|
|
40
|
+
while tail <= stop:
|
|
41
|
+
yield sequence[head:tail:skip]
|
|
42
|
+
head += step
|
|
43
|
+
tail += step
|
|
44
|
+
|
|
45
|
+
if not drop_last and head < stop:
|
|
46
|
+
yield sequence[head:tail:skip]
|
|
@@ -1,56 +1,73 @@
|
|
|
1
|
-
__all__ = (
|
|
2
|
-
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"ensure_file_exists",
|
|
13
|
-
"ensure_files_exist",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"file_exists",
|
|
17
|
-
"files_exist",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
1
|
+
__all__ = (
|
|
2
|
+
"DirectoryNotFoundError",
|
|
3
|
+
"NotAFileError",
|
|
4
|
+
"dir_empty",
|
|
5
|
+
"dir_empty_unsafe",
|
|
6
|
+
"dir_exists",
|
|
7
|
+
"dirs_empty",
|
|
8
|
+
"dirs_empty_unsafe",
|
|
9
|
+
"dirs_exist",
|
|
10
|
+
"ensure_dir_exists",
|
|
11
|
+
"ensure_dirs_exist",
|
|
12
|
+
"ensure_file_exists",
|
|
13
|
+
"ensure_files_exist",
|
|
14
|
+
"ensure_path_exists",
|
|
15
|
+
"ensure_paths_exist",
|
|
16
|
+
"file_exists",
|
|
17
|
+
"files_exist",
|
|
18
|
+
"get_dirs",
|
|
19
|
+
"get_files",
|
|
20
|
+
"get_paths",
|
|
21
|
+
"make_dir",
|
|
22
|
+
"make_dirs",
|
|
23
|
+
"path_exists",
|
|
24
|
+
"paths_exist",
|
|
25
|
+
"search_dirs",
|
|
26
|
+
"search_files",
|
|
27
|
+
"search_paths",
|
|
28
|
+
"stringify_path",
|
|
29
|
+
"stringify_paths",
|
|
30
|
+
"wrap_path",
|
|
31
|
+
"wrap_paths",
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
from kaparoo.filesystem.directory import (
|
|
35
|
+
dir_empty,
|
|
36
|
+
dir_empty_unsafe,
|
|
37
|
+
dirs_empty,
|
|
38
|
+
dirs_empty_unsafe,
|
|
39
|
+
make_dir,
|
|
40
|
+
make_dirs,
|
|
41
|
+
)
|
|
42
|
+
from kaparoo.filesystem.exceptions import (
|
|
43
|
+
DirectoryNotFoundError,
|
|
44
|
+
NotAFileError,
|
|
45
|
+
)
|
|
46
|
+
from kaparoo.filesystem.existence import (
|
|
47
|
+
dir_exists,
|
|
48
|
+
dirs_exist,
|
|
49
|
+
ensure_dir_exists,
|
|
50
|
+
ensure_dirs_exist,
|
|
51
|
+
ensure_file_exists,
|
|
52
|
+
ensure_files_exist,
|
|
53
|
+
ensure_path_exists,
|
|
54
|
+
ensure_paths_exist,
|
|
55
|
+
file_exists,
|
|
56
|
+
files_exist,
|
|
57
|
+
path_exists,
|
|
58
|
+
paths_exist,
|
|
59
|
+
)
|
|
60
|
+
from kaparoo.filesystem.search import (
|
|
61
|
+
get_dirs,
|
|
62
|
+
get_files,
|
|
63
|
+
get_paths,
|
|
64
|
+
search_dirs,
|
|
65
|
+
search_files,
|
|
66
|
+
search_paths,
|
|
67
|
+
)
|
|
68
|
+
from kaparoo.filesystem.utils import (
|
|
69
|
+
stringify_path,
|
|
70
|
+
stringify_paths,
|
|
71
|
+
wrap_path,
|
|
72
|
+
wrap_paths,
|
|
73
|
+
)
|