fileutils-dir 0.2.0__py3-none-any.whl → 0.3.5__py3-none-any.whl

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.
fileutils/files.py CHANGED
@@ -16,15 +16,29 @@ FILE_TYPES = {
16
16
  }
17
17
 
18
18
  def in_dir(
19
- path: str | Path = ".",
20
- *,
21
- ext: Iterable[str] | None = None,
22
- dtype: Iterable[str] | None = None,
19
+ path=".",
20
+ *args,
21
+ ext=None,
22
+ dtype=None,
23
23
  ) -> list[str]:
24
-
24
+ """
25
+ Positional Arguments are not accepted except path.
26
+ Please specify extention (ext="") or data type (dtype="")
27
+ dtype options: image, text, pdf, doc, sheet, presentation, code, data, audio, video, archive
28
+ """
29
+ if args:
30
+ raise TypeError(
31
+ "in_dir() accepts only one positional argument (path).\n"
32
+ "Use keyword arguments for filters or leave empty:\n"
33
+ " in_dir(path, ext='filetype')\n"
34
+ " in_dir(path, dtype='data_type')"
35
+ )
36
+ if isinstance(ext, str):
37
+ ext = [ext]
38
+ if isinstance(dtype, str):
39
+ dtype = [dtype]
25
40
  ext = ext or []
26
41
  dtype = dtype or []
27
-
28
42
  normalized_extensions = {
29
43
  e.lower() if e.startswith(".") else f".{e.lower()}"
30
44
  for e in ext
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fileutils-dir
3
- Version: 0.2.0
3
+ Version: 0.3.5
4
4
  Summary: Small utilities for listing files in directories
5
5
  Author: Jatavallabhula Sarat Anirudh
6
6
  License-Expression: MIT
@@ -0,0 +1,6 @@
1
+ fileutils/__init__.py,sha256=3u-pHKVodcCPECMcj95lrkk8nr7tl6_HRqiQOw6YbBM,78
2
+ fileutils/files.py,sha256=Kl0JEq2eaBf9kxp_wLBDB86d4wWSNAjDEokhDzExeak,2176
3
+ fileutils_dir-0.3.5.dist-info/METADATA,sha256=kWFpHtpkKl9oHzhWAbruJBGkpTBXbwhHzWPO3YkfzCw,1899
4
+ fileutils_dir-0.3.5.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
5
+ fileutils_dir-0.3.5.dist-info/top_level.txt,sha256=kZPCAZpYo7OkmwY_R2a4ifuMINdW5AZd2JaNHDSXQYQ,10
6
+ fileutils_dir-0.3.5.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- fileutils/__init__.py,sha256=3u-pHKVodcCPECMcj95lrkk8nr7tl6_HRqiQOw6YbBM,78
2
- fileutils/files.py,sha256=yi3BJ2LjMjZj2HrsYdg8DcbVnC_YLpeNU36zFuQeRlI,1608
3
- fileutils_dir-0.2.0.dist-info/METADATA,sha256=gXU9cdAsHvui4688zANbbIhETbGln9w2U0aqyC87mvc,1899
4
- fileutils_dir-0.2.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
5
- fileutils_dir-0.2.0.dist-info/top_level.txt,sha256=kZPCAZpYo7OkmwY_R2a4ifuMINdW5AZd2JaNHDSXQYQ,10
6
- fileutils_dir-0.2.0.dist-info/RECORD,,