FileHiker 0.3.9.2__tar.gz → 0.4.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.
- filehiker-0.4.3/PKG-INFO +250 -0
- filehiker-0.4.3/README.md +234 -0
- filehiker-0.4.3/license.txt +28 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/pyproject.toml +5 -4
- filehiker-0.4.3/src/FileHiker.egg-info/PKG-INFO +250 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/FileHiker.egg-info/SOURCES.txt +4 -3
- filehiker-0.4.3/src/filehiker/__init__.py +33 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/__main__.py +73 -65
- filehiker-0.4.3/src/filehiker/cases/20260806o1211.sorted.txt +48 -0
- filehiker-0.4.3/src/filehiker/cases/20260806o1215.inverted.txt +47 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/filehiker.py +221 -70
- filehiker-0.3.9.2/PKG-INFO +0 -226
- filehiker-0.3.9.2/README.md +0 -212
- filehiker-0.3.9.2/src/FileHiker.egg-info/PKG-INFO +0 -226
- filehiker-0.3.9.2/src/filehiker/__init__.py +0 -4
- filehiker-0.3.9.2/src/filehiker/cases/20260806o1211.sorted.txt +0 -49
- filehiker-0.3.9.2/src/filehiker/cases/20260806o1215.inverted.txt +0 -49
- {filehiker-0.3.9.2 → filehiker-0.4.3}/setup.cfg +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/FileHiker.egg-info/dependency_links.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/FileHiker.egg-info/top_level.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/20260806o1213.invert.py +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/README.md +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/^^file-to-ignore^^.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/^^folder-to-ignore^^/more123.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/dir_2/file_01_abc.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/dir_2b.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/dir_3/dir_31/dir_311/^^dir_3111^^/file_03_more.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/dir_3/dir_31/dir_311/dir_3113/file_04_bcd.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/dir_3/dir_31/file_02_abc.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/dir_4.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/dir_5/dir_51/dir_511/dir_5111/file_08_k.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/dir_5/dir_51/dir_511/dir_5111/file_10_m.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/dir_5/dir_51/dir_511/dir_5111/file_11_n.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/dir_5/dir_52/dir_521/dir_5212/file_08_g.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/dir_5/dir_52/file_07_c.txt +0 -0
- {filehiker-0.3.9.2/src/filehiker/cases/dir_5/dir_53/dir_531/dir_5311/dir_53111/dir_531111 → filehiker-0.4.3/src/filehiker/cases/dir_5/dir_53/dir_531/dir_5311/dir_53111}/file_12_x.txt +0 -0
- {filehiker-0.3.9.2/src/filehiker/cases/dir_5/dir_53/dir_531/dir_5311/dir_53111/dir_531111 → filehiker-0.4.3/src/filehiker/cases/dir_5/dir_53/dir_531/dir_5311/dir_53111}/file_13_y.txt +0 -0
- {filehiker-0.3.9.2/src/filehiker/cases/dir_5/dir_53/dir_531/dir_5311/dir_53111/dir_531111 → filehiker-0.4.3/src/filehiker/cases/dir_5/dir_53/dir_531/dir_5311/dir_53111}/file_14_z.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/dir_5/file_05_a.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/dir_5/file_06_h.txt +0 -0
- {filehiker-0.3.9.2 → filehiker-0.4.3}/src/filehiker/cases/dir_5/file_07_p.txt +0 -0
filehiker-0.4.3/PKG-INFO
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: FileHiker
|
|
3
|
+
Version: 0.4.3
|
|
4
|
+
Summary: File system walker — Find the right or the left neighbour of a path inside a specified base folder
|
|
5
|
+
Author: Norbert C. Maier
|
|
6
|
+
License-Expression: BSD-3-Clause
|
|
7
|
+
Project-URL: Homepage, https://gitlab.com/normai/filehiker
|
|
8
|
+
Keywords: directory crawler,directory walker,file system crawler,file system walker
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Topic :: Software Development
|
|
12
|
+
Requires-Python: >=3.13
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: license.txt
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
<!-- title = 'FileHiker'; favicon = './assets/icos/20260819o0731.tree-view-logo-one.v3.svg'; -->
|
|
18
|
+
|
|
19
|
+
<!-- svg xmlns="http://www.w3.org/2000/svg" style="float: right;" width="180" height="180" viewBox="-0.5 -0.5 330 330">
|
|
20
|
+
<title>File System Hierarchy</title><defs><linearGradient id="a" x1="143.595" x2="143.595" y1="193.811" y2="253.552" gradientTransform="scale(1.38933 .71977)" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color:#ffcd28;stop-opacity:1"/><stop offset="100%" style="stop-color:orange;stop-opacity:1"/></linearGradient><linearGradient id="b" x1="71.617" x2="71.617" y1="388.317" y2="448.058" gradientTransform="scale(1.38933 .71977)" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color:#e6d0de;stop-opacity:1"/><stop offset="100%" style="stop-color:#d5739d;stop-opacity:1"/></linearGradient></defs><g transform="rotate(-4.9 159.078 -128.265)"><rect width="85" height="40" x="1" y="1" fill="#1ba1e2" stroke="#006eaf" stroke-width="3" pointer-events="all" rx="2.8" ry="2.8"/><rect width="80" height="40" x="101" y="71" fill="#fa6800" stroke="#c73500" stroke-width="3" pointer-events="all" rx="2.8" ry="2.8"/><path fill="none" stroke="#6c8ebf" stroke-miterlimit="10" stroke-width="6" d="M43.5 43 41 301h58M41 91h58" pointer-events="stroke"/><rect width="80" height="40" x="201" y="141" fill="url(#a)" stroke="#d79b00" stroke-width="3" pointer-events="all" rx="2.8" ry="2.8" style="fill:url(#a)"/><rect width="80" height="40" x="101" y="281" fill="url(#b)" stroke="#996185" stroke-width="3" pointer-events="all" rx="2.8" ry="2.8" style="fill:url(#b)"/><path fill="none" stroke="#6c8ebf" stroke-miterlimit="10" stroke-width="6" d="M141 113v48h58" pointer-events="stroke"/><rect width="80" height="40" x="201" y="211" fill="#60a917" stroke="#2d7600" stroke-width="3" pointer-events="all" rx="2.8" ry="2.8"/><path fill="none" stroke="#6c8ebf" stroke-miterlimit="10" stroke-width="6" d="M141 163v68h58" pointer-events="stroke"/></g>
|
|
21
|
+
</svg -->
|
|
22
|
+
|
|
23
|
+
<img src="./assets/icos/20260819o0731.tree-view-logo-one.v3.svg.png" style="float: right;" width="128" height="128" alt="Icon 20260819°0731">
|
|
24
|
+
|
|
25
|
+
<!-- PyPi.org renders the Markdown links literally, means wrong (see v0.3.9.2). Now let´s try HTML. -->
|
|
26
|
+
<div markdown="1" class="lmp-breadcrumbs">
|
|
27
|
+
<span class="CurrentPage">FileHikerDev</span> →
|
|
28
|
+
<a href="./~changelog.md">Changelog</a>
|
|
29
|
+
<a href="./~issues.md">Issues</a>
|
|
30
|
+
<a href="./~notes.md">Notes</a>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
# FileHikerDev <span class="lmp-title-type">Project</span> <sup>v0.4.3</sup>
|
|
34
|
+
|
|
35
|
+
<!-- PyPi.org renders the Markdown links literally, means wrong (see v0.3.9.2). So skip them for now -->
|
|
36
|
+
<!-- div markdown="1" class="lmp-box-page-sections">
|
|
37
|
+
Below:
|
|
38
|
+
[1. Summary](#id20260725o1011)
|
|
39
|
+
[2. Installation](#id20260725o1013)
|
|
40
|
+
[3. UI](#id20260813o0911)
|
|
41
|
+
[4. API](#id20260725o1015)
|
|
42
|
+
[5. Usage](#id20260813o0913)
|
|
43
|
+
[6. Folder Structure](#id20250816o0849)
|
|
44
|
+
[7. Credits](#id20260816o0831)
|
|
45
|
+
[8. Fineprint](#id20260725o1019)
|
|
46
|
+
</div -->
|
|
47
|
+
|
|
48
|
+
## 1. Summary <sup><a href="#id20260725o1011" id="id20260725o1011">🔗</a></sup>
|
|
49
|
+
|
|
50
|
+
| | |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
| **Slogan** | **Directory crawler** Python package to find any file system item´s neighbour, one by one, walking either forward or backward |
|
|
53
|
+
| **Description** | FileHiker is a Python package to find the right or left neighbour for any filesystem item inside a given 'base folder'. It finds either the next or the previous neighbour, depending on a direction flag. If the given target does not exist, it tries to find a sensible neighbour anyway. |
|
|
54
|
+
| **Particularities** | • It walks **forward and backward** equally and symmetrically • It is suited for **huge file system hierarchies** due to it´s memory saving behaviour inspecting only one directory single-level at a time |
|
|
55
|
+
| **License** | BSD 3-Clause, see [license.txt](./license.txt) |
|
|
56
|
+
| **Copyright** | © 2025 – 2026 Norbert C. Maier |
|
|
57
|
+
| **System** | Written and tested with Python 3.13 on Windows. Should also work on Linux/Mac, just this is yet to be tested |
|
|
58
|
+
| **Dependencies** | None |
|
|
59
|
+
| **Canonical location** | [gitlab.com/normai/filehikerdev](https://gitlab.com/normai/filehikerdev) |
|
|
60
|
+
| **Documentation** | [normai.gitlab.io/filehikerdev](https://normai.gitlab.io/filehikerdev)
|
|
61
|
+
| **Distribution** | [pypi.org/project/filehiker](https://pypi.org/project/filehiker/)
|
|
62
|
+
| **Motivation** | I wanted walk a drive file by file to build a database of the files. It takes about 20 hours for 2 million files, including some little payload per file, like calculating the file hash. |
|
|
63
|
+
| **Missing features** | Symlink handling |
|
|
64
|
+
| **Development Status** | Applicable |
|
|
65
|
+
|
|
66
|
+
## 2. Installation <sup><a href="#id20260725o1013" id="id20260725o1013">🔗</a></sup>
|
|
67
|
+
|
|
68
|
+
Install the package in your Python via `pip` (1) either as user installation from PyPi.org
|
|
69
|
+
or (2) as editable development installation if you have the sources on your machine
|
|
70
|
+
|
|
71
|
+
### 2.1 User Installation <sup><a href="#id20260725o1513" id="id20260725o1513">🔗</a></sup>
|
|
72
|
+
|
|
73
|
+
Use one of the following commandline prompts (the `.exe` is Windows specific):
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
> pip.exe install filehiker
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
> pip.exe install -U filehiker
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
> python.exe -m pip install filehiker
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
> python.exe -m pip install -U filehiker
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 2.2 Development Installation <sup><a href="#id20260725o1511" id="id20260725o1511">🔗</a></sup>
|
|
92
|
+
|
|
93
|
+
How to do so?
|
|
94
|
+
1. Get the `filehikerdev` project folder on your local drive, possibly by cloning it from GitLab
|
|
95
|
+
1. In the console change directory to the project´s root folder `filehikerdev`
|
|
96
|
+
1. Issue one of the following commands — Don´t miss the trailing dot for 'current folder'!
|
|
97
|
+
- `filehikerdev> pip.exe install -e .`
|
|
98
|
+
- `filehikerdev> python.exe -m pip install -e .`
|
|
99
|
+
1. You should see a console like in the following screenshot
|
|
100
|
+
|
|
101
|
+
<a href="./assets/imgs/20260814o0721.console--pip-exe--install--filehiker.png"><img src="./assets/imgs/20260814o0721.console--pip-exe--install--filehiker.png" class="lmp-img-centered" width="653" height="278" data-dims="x1452y0619" alt="Screenshot 20260814°0721"></a>
|
|
102
|
+
<br>Install FileHiker editable development version. Note the trailing dot in the first line!
|
|
103
|
+
([txt](./assets/imgs/20260814o0721.console--pip-exe--install--filehiker.png.txt))
|
|
104
|
+
|
|
105
|
+
## 3. UI (User Interface) <sup><a href="#id20260813o0911" id="id20260813o0911">🔗</a></sup>
|
|
106
|
+
|
|
107
|
+
Though FileHiker is a library to be used from other Python code, it
|
|
108
|
+
provides a bit interactivity from the console anyway:
|
|
109
|
+
|
|
110
|
+
- Output help screen:
|
|
111
|
+
```
|
|
112
|
+
> python.exe -m filehiker
|
|
113
|
+
```
|
|
114
|
+
- Output some status info:
|
|
115
|
+
```
|
|
116
|
+
> python.exe -m filehiker i
|
|
117
|
+
```
|
|
118
|
+
- Perform a selftest on the built-in test-folder:
|
|
119
|
+
```
|
|
120
|
+
> python.exe -m filehiker s
|
|
121
|
+
```
|
|
122
|
+
- Perform a selftest on your CWD, current working dir, from where ever you started python.exe:
|
|
123
|
+
```
|
|
124
|
+
> python.exe -m filehiker t
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
By the way. There is a curious restriction, mentioned just for sake of completeness.
|
|
128
|
+
Command `python.exe -m filehiker` must **not** be issued from the folder, where the
|
|
129
|
+
`filehiker.py` resides. If you do so, just nothing happens, which is due to Python´s
|
|
130
|
+
package handling. The case is difficult to catch from the code. The effort implementing
|
|
131
|
+
the case is not worth the gain. As a user, you will never see this folder anyway, and
|
|
132
|
+
as a developer you can easily just avoid it.
|
|
133
|
+
|
|
134
|
+
## 4. API (Application Programmers Interface) <sup><a href="#id20260725o1015" id="id20260725o1015">🔗</a></sup>
|
|
135
|
+
|
|
136
|
+
See documentation at …
|
|
137
|
+
|
|
138
|
+
<!--
|
|
139
|
+
- Constructor **`filehiker.FileHiker(basepath, direction, ignorewcs, verbose)`** where
|
|
140
|
+
- `basepath` — Optional string to tell to which folder the scanning is confined. Default is `''`
|
|
141
|
+
(empty), which shall translate to the folder from where `python.exe` was called
|
|
142
|
+
- `direction` — Optional boolean, telling whether to go forward or backward. Default is `True`,
|
|
143
|
+
means forward to the right, `False` means backward to the left
|
|
144
|
+
- `ignorewcs` — Optional list with wildcard patterns for files and folders to ignore.
|
|
145
|
+
Default is a list with patterns like `.git`, `__*__`, etc. See the list in the
|
|
146
|
+
source [filehiker.py](./src/filehiker/filehiker.py) at about line 50
|
|
147
|
+
- `verbose` - Flag to tell whether to print some output or not. Default is `False`
|
|
148
|
+
- Method **`find_neighbour(target)`** where target is a string with a path pointing to the current
|
|
149
|
+
item, from which it´s neighbour is wanted. Returns a string with the found neighbour.
|
|
150
|
+
- Method **`get_BasePath()`** — Returns the current base path
|
|
151
|
+
- Method **`get_Direction()`** — Returns the current direction flag
|
|
152
|
+
- Method **`get_Verbose()`** — Returns the current verbose flag
|
|
153
|
+
- Method **`get_IgnoreList()`** — Returns the current ignore list
|
|
154
|
+
- Static method **`normaleis()`** — Takes a path and returns it normalized, means with slashes and one trailing slash for directories
|
|
155
|
+
- Method **`set_BasePath(basepath)`** — Takes a string with the new base path to be set
|
|
156
|
+
- Method **`set_Direction(direction)`** — Takes a boolean with the new direction to be set
|
|
157
|
+
- Method **`set_Verbose(verbose)`** — Takes a boolean with the new verbose flag to be set
|
|
158
|
+
- Method **`set_IgnoreList(ignorelist)`** — Takes a list with the new ignore patterns to be set
|
|
159
|
+
-->
|
|
160
|
+
|
|
161
|
+
## 5. Usage <sup><a href="#id20260813o0913" id="id20260813o0913">🔗</a></sup>
|
|
162
|
+
|
|
163
|
+
Here is a minimalistic example how to use FileHiker:
|
|
164
|
+
|
|
165
|
+
<pre>
|
|
166
|
+
import filehiker
|
|
167
|
+
fhk = filehiker.FileHiker() # Since no base folder is defined, the CWD is used as such
|
|
168
|
+
offset = '' # No offset means the target is the base folder itself
|
|
169
|
+
neighbour = fhk.find_neighbour(offset) # The right neighbour of the base folder is it´s first entry
|
|
170
|
+
print(f'Right neighbour = {neighbour}' # Shows the found first entry in the base folder
|
|
171
|
+
</pre>
|
|
172
|
+
|
|
173
|
+
## 6. Development Folder Structure <sup><a href="#id20250816o0849" id="id20250816o0849">🔗</a></sup>
|
|
174
|
+
|
|
175
|
+
The FileHiker package uses the **'*Src-Layout*' folder structure**, one of three common package layout options.
|
|
176
|
+
<del>Find more about package folder structures in the ZanaFacils Notes file, subchapter
|
|
177
|
+
[About Python Package Layouts](./../zanafacilsdev/zanafacils/docs/notes.md#id20260631o0723).</del>
|
|
178
|
+
|
|
179
|
+
<pre style="font-size: 1.1em; line-height: 1.18em !important;">
|
|
180
|
+
<b>filehikerdev</b>
|
|
181
|
+
├── docs
|
|
182
|
+
│ └── …
|
|
183
|
+
├── <b>src</b>
|
|
184
|
+
│ └── <b>filehiker</b>
|
|
185
|
+
│ ├── <b>__init__.py</b>
|
|
186
|
+
│ ├── <b>filehiker.py</b>
|
|
187
|
+
│ └── <em>possible subpkgs</em>
|
|
188
|
+
│ ├── <em>__init__.py</em>
|
|
189
|
+
│ └── <em>module2.py</em>
|
|
190
|
+
├── README.md
|
|
191
|
+
└── <b>pyproject.toml</b>
|
|
192
|
+
</pre>
|
|
193
|
+
|
|
194
|
+
<img class="lmp-reference-icon" src="./assets/icos/20250816o0849.py-pkgs--org.v1.x0064y0064.png" width="48" height="48" alt=" Icon 20250816°0849">
|
|
195
|
+
Detailled information on Python packages is found on site 'Python Packages'
|
|
196
|
+
- Frontpage [Py-Pkgs.org](https://py-pkgs.org/)
|
|
197
|
+
<sup>[ref 20260817°1034]</sup>
|
|
198
|
+
- Chapter [4. Package structure and distribution](https://py-pkgs.org/04-package-structure.html)
|
|
199
|
+
<sup>[ref 20250816°0848]</sup>
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
<img class="lmp-reference-icon" src="./assets/icos/20250514o0821.mistral-ai.v2.x0064y0064.png" width="48" height="48" alt=" Icon 20250514°0821">
|
|
204
|
+
Mistral quest
|
|
205
|
+
[Python package documentation placement](https://chat.mistral.ai/chat/db251f65-bdb0-4cfe-b58a-3ddef93513b2)
|
|
206
|
+
— Reasoning about where to place which documentation
|
|
207
|
+
<sup>[ref 20260726°0842 📡]</sup>
|
|
208
|
+
|
|
209
|
+
## 7. Credits <sup><a href="#20260816o0831" id="id20260816o0831">🔗</a></sup>
|
|
210
|
+
|
|
211
|
+
<img class="lmp-reference-icon" src="./assets/icos/20260819o0731.tree-view-logo-one.v3.svg" width="64" height="64" alt=" Icon 20260819°0731">
|
|
212
|
+
The 'File System Hierarchy One' logo is made by Norbert with DrawIO, Inkscape and
|
|
213
|
+
[jakearchibald.github.io/svgomg](https://jakearchibald.github.io/svgomg/) under the
|
|
214
|
+
[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) license
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
<img class="lmp-reference-icon" src="./assets/icos/20210508o1044.choosealicense.v2.x0064y0064.png" width="48" height="48" alt=" Icon 20210508°1044">
|
|
219
|
+
The license text was taken from
|
|
220
|
+
[choosealicense.com/licenses/bsd-3-clause/](https://choosealicense.com/licenses/bsd-3-clause/)
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
#### 8. Fineprint <sup><a href="#id20260725o1019" id="id20260725o1019">🔗</a></sup>
|
|
227
|
+
|
|
228
|
+
<pre class="lmp-font-small">
|
|
229
|
+
project 20250406°0711 FileHiker
|
|
230
|
+
objtype : Python package
|
|
231
|
+
url :
|
|
232
|
+
title : Filehiker
|
|
233
|
+
summary : Find filesystem item´s neighbour left or right
|
|
234
|
+
status : Applicable
|
|
235
|
+
tags :
|
|
236
|
+
note :
|
|
237
|
+
⬞
|
|
238
|
+
</pre>
|
|
239
|
+
|
|
240
|
+
<pre class="lmp-font-small">
|
|
241
|
+
repo 20260818°1414 FileHikerDev
|
|
242
|
+
objtype : Git repository
|
|
243
|
+
canonical : https://gitlab.com/normai/filehikerdev
|
|
244
|
+
title : FileHikerDev
|
|
245
|
+
tags :
|
|
246
|
+
note :
|
|
247
|
+
⬞
|
|
248
|
+
</pre>
|
|
249
|
+
|
|
250
|
+
<sup>Page 20250406°0721 ⬞Ω</sup>
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
<!-- title = 'FileHiker'; favicon = './assets/icos/20260819o0731.tree-view-logo-one.v3.svg'; -->
|
|
2
|
+
|
|
3
|
+
<!-- svg xmlns="http://www.w3.org/2000/svg" style="float: right;" width="180" height="180" viewBox="-0.5 -0.5 330 330">
|
|
4
|
+
<title>File System Hierarchy</title><defs><linearGradient id="a" x1="143.595" x2="143.595" y1="193.811" y2="253.552" gradientTransform="scale(1.38933 .71977)" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color:#ffcd28;stop-opacity:1"/><stop offset="100%" style="stop-color:orange;stop-opacity:1"/></linearGradient><linearGradient id="b" x1="71.617" x2="71.617" y1="388.317" y2="448.058" gradientTransform="scale(1.38933 .71977)" gradientUnits="userSpaceOnUse"><stop offset="0%" style="stop-color:#e6d0de;stop-opacity:1"/><stop offset="100%" style="stop-color:#d5739d;stop-opacity:1"/></linearGradient></defs><g transform="rotate(-4.9 159.078 -128.265)"><rect width="85" height="40" x="1" y="1" fill="#1ba1e2" stroke="#006eaf" stroke-width="3" pointer-events="all" rx="2.8" ry="2.8"/><rect width="80" height="40" x="101" y="71" fill="#fa6800" stroke="#c73500" stroke-width="3" pointer-events="all" rx="2.8" ry="2.8"/><path fill="none" stroke="#6c8ebf" stroke-miterlimit="10" stroke-width="6" d="M43.5 43 41 301h58M41 91h58" pointer-events="stroke"/><rect width="80" height="40" x="201" y="141" fill="url(#a)" stroke="#d79b00" stroke-width="3" pointer-events="all" rx="2.8" ry="2.8" style="fill:url(#a)"/><rect width="80" height="40" x="101" y="281" fill="url(#b)" stroke="#996185" stroke-width="3" pointer-events="all" rx="2.8" ry="2.8" style="fill:url(#b)"/><path fill="none" stroke="#6c8ebf" stroke-miterlimit="10" stroke-width="6" d="M141 113v48h58" pointer-events="stroke"/><rect width="80" height="40" x="201" y="211" fill="#60a917" stroke="#2d7600" stroke-width="3" pointer-events="all" rx="2.8" ry="2.8"/><path fill="none" stroke="#6c8ebf" stroke-miterlimit="10" stroke-width="6" d="M141 163v68h58" pointer-events="stroke"/></g>
|
|
5
|
+
</svg -->
|
|
6
|
+
|
|
7
|
+
<img src="./assets/icos/20260819o0731.tree-view-logo-one.v3.svg.png" style="float: right;" width="128" height="128" alt="Icon 20260819°0731">
|
|
8
|
+
|
|
9
|
+
<!-- PyPi.org renders the Markdown links literally, means wrong (see v0.3.9.2). Now let´s try HTML. -->
|
|
10
|
+
<div markdown="1" class="lmp-breadcrumbs">
|
|
11
|
+
<span class="CurrentPage">FileHikerDev</span> →
|
|
12
|
+
<a href="./~changelog.md">Changelog</a>
|
|
13
|
+
<a href="./~issues.md">Issues</a>
|
|
14
|
+
<a href="./~notes.md">Notes</a>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
# FileHikerDev <span class="lmp-title-type">Project</span> <sup>v0.4.3</sup>
|
|
18
|
+
|
|
19
|
+
<!-- PyPi.org renders the Markdown links literally, means wrong (see v0.3.9.2). So skip them for now -->
|
|
20
|
+
<!-- div markdown="1" class="lmp-box-page-sections">
|
|
21
|
+
Below:
|
|
22
|
+
[1. Summary](#id20260725o1011)
|
|
23
|
+
[2. Installation](#id20260725o1013)
|
|
24
|
+
[3. UI](#id20260813o0911)
|
|
25
|
+
[4. API](#id20260725o1015)
|
|
26
|
+
[5. Usage](#id20260813o0913)
|
|
27
|
+
[6. Folder Structure](#id20250816o0849)
|
|
28
|
+
[7. Credits](#id20260816o0831)
|
|
29
|
+
[8. Fineprint](#id20260725o1019)
|
|
30
|
+
</div -->
|
|
31
|
+
|
|
32
|
+
## 1. Summary <sup><a href="#id20260725o1011" id="id20260725o1011">🔗</a></sup>
|
|
33
|
+
|
|
34
|
+
| | |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| **Slogan** | **Directory crawler** Python package to find any file system item´s neighbour, one by one, walking either forward or backward |
|
|
37
|
+
| **Description** | FileHiker is a Python package to find the right or left neighbour for any filesystem item inside a given 'base folder'. It finds either the next or the previous neighbour, depending on a direction flag. If the given target does not exist, it tries to find a sensible neighbour anyway. |
|
|
38
|
+
| **Particularities** | • It walks **forward and backward** equally and symmetrically • It is suited for **huge file system hierarchies** due to it´s memory saving behaviour inspecting only one directory single-level at a time |
|
|
39
|
+
| **License** | BSD 3-Clause, see [license.txt](./license.txt) |
|
|
40
|
+
| **Copyright** | © 2025 – 2026 Norbert C. Maier |
|
|
41
|
+
| **System** | Written and tested with Python 3.13 on Windows. Should also work on Linux/Mac, just this is yet to be tested |
|
|
42
|
+
| **Dependencies** | None |
|
|
43
|
+
| **Canonical location** | [gitlab.com/normai/filehikerdev](https://gitlab.com/normai/filehikerdev) |
|
|
44
|
+
| **Documentation** | [normai.gitlab.io/filehikerdev](https://normai.gitlab.io/filehikerdev)
|
|
45
|
+
| **Distribution** | [pypi.org/project/filehiker](https://pypi.org/project/filehiker/)
|
|
46
|
+
| **Motivation** | I wanted walk a drive file by file to build a database of the files. It takes about 20 hours for 2 million files, including some little payload per file, like calculating the file hash. |
|
|
47
|
+
| **Missing features** | Symlink handling |
|
|
48
|
+
| **Development Status** | Applicable |
|
|
49
|
+
|
|
50
|
+
## 2. Installation <sup><a href="#id20260725o1013" id="id20260725o1013">🔗</a></sup>
|
|
51
|
+
|
|
52
|
+
Install the package in your Python via `pip` (1) either as user installation from PyPi.org
|
|
53
|
+
or (2) as editable development installation if you have the sources on your machine
|
|
54
|
+
|
|
55
|
+
### 2.1 User Installation <sup><a href="#id20260725o1513" id="id20260725o1513">🔗</a></sup>
|
|
56
|
+
|
|
57
|
+
Use one of the following commandline prompts (the `.exe` is Windows specific):
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
> pip.exe install filehiker
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
> pip.exe install -U filehiker
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
> python.exe -m pip install filehiker
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
> python.exe -m pip install -U filehiker
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 2.2 Development Installation <sup><a href="#id20260725o1511" id="id20260725o1511">🔗</a></sup>
|
|
76
|
+
|
|
77
|
+
How to do so?
|
|
78
|
+
1. Get the `filehikerdev` project folder on your local drive, possibly by cloning it from GitLab
|
|
79
|
+
1. In the console change directory to the project´s root folder `filehikerdev`
|
|
80
|
+
1. Issue one of the following commands — Don´t miss the trailing dot for 'current folder'!
|
|
81
|
+
- `filehikerdev> pip.exe install -e .`
|
|
82
|
+
- `filehikerdev> python.exe -m pip install -e .`
|
|
83
|
+
1. You should see a console like in the following screenshot
|
|
84
|
+
|
|
85
|
+
<a href="./assets/imgs/20260814o0721.console--pip-exe--install--filehiker.png"><img src="./assets/imgs/20260814o0721.console--pip-exe--install--filehiker.png" class="lmp-img-centered" width="653" height="278" data-dims="x1452y0619" alt="Screenshot 20260814°0721"></a>
|
|
86
|
+
<br>Install FileHiker editable development version. Note the trailing dot in the first line!
|
|
87
|
+
([txt](./assets/imgs/20260814o0721.console--pip-exe--install--filehiker.png.txt))
|
|
88
|
+
|
|
89
|
+
## 3. UI (User Interface) <sup><a href="#id20260813o0911" id="id20260813o0911">🔗</a></sup>
|
|
90
|
+
|
|
91
|
+
Though FileHiker is a library to be used from other Python code, it
|
|
92
|
+
provides a bit interactivity from the console anyway:
|
|
93
|
+
|
|
94
|
+
- Output help screen:
|
|
95
|
+
```
|
|
96
|
+
> python.exe -m filehiker
|
|
97
|
+
```
|
|
98
|
+
- Output some status info:
|
|
99
|
+
```
|
|
100
|
+
> python.exe -m filehiker i
|
|
101
|
+
```
|
|
102
|
+
- Perform a selftest on the built-in test-folder:
|
|
103
|
+
```
|
|
104
|
+
> python.exe -m filehiker s
|
|
105
|
+
```
|
|
106
|
+
- Perform a selftest on your CWD, current working dir, from where ever you started python.exe:
|
|
107
|
+
```
|
|
108
|
+
> python.exe -m filehiker t
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
By the way. There is a curious restriction, mentioned just for sake of completeness.
|
|
112
|
+
Command `python.exe -m filehiker` must **not** be issued from the folder, where the
|
|
113
|
+
`filehiker.py` resides. If you do so, just nothing happens, which is due to Python´s
|
|
114
|
+
package handling. The case is difficult to catch from the code. The effort implementing
|
|
115
|
+
the case is not worth the gain. As a user, you will never see this folder anyway, and
|
|
116
|
+
as a developer you can easily just avoid it.
|
|
117
|
+
|
|
118
|
+
## 4. API (Application Programmers Interface) <sup><a href="#id20260725o1015" id="id20260725o1015">🔗</a></sup>
|
|
119
|
+
|
|
120
|
+
See documentation at …
|
|
121
|
+
|
|
122
|
+
<!--
|
|
123
|
+
- Constructor **`filehiker.FileHiker(basepath, direction, ignorewcs, verbose)`** where
|
|
124
|
+
- `basepath` — Optional string to tell to which folder the scanning is confined. Default is `''`
|
|
125
|
+
(empty), which shall translate to the folder from where `python.exe` was called
|
|
126
|
+
- `direction` — Optional boolean, telling whether to go forward or backward. Default is `True`,
|
|
127
|
+
means forward to the right, `False` means backward to the left
|
|
128
|
+
- `ignorewcs` — Optional list with wildcard patterns for files and folders to ignore.
|
|
129
|
+
Default is a list with patterns like `.git`, `__*__`, etc. See the list in the
|
|
130
|
+
source [filehiker.py](./src/filehiker/filehiker.py) at about line 50
|
|
131
|
+
- `verbose` - Flag to tell whether to print some output or not. Default is `False`
|
|
132
|
+
- Method **`find_neighbour(target)`** where target is a string with a path pointing to the current
|
|
133
|
+
item, from which it´s neighbour is wanted. Returns a string with the found neighbour.
|
|
134
|
+
- Method **`get_BasePath()`** — Returns the current base path
|
|
135
|
+
- Method **`get_Direction()`** — Returns the current direction flag
|
|
136
|
+
- Method **`get_Verbose()`** — Returns the current verbose flag
|
|
137
|
+
- Method **`get_IgnoreList()`** — Returns the current ignore list
|
|
138
|
+
- Static method **`normaleis()`** — Takes a path and returns it normalized, means with slashes and one trailing slash for directories
|
|
139
|
+
- Method **`set_BasePath(basepath)`** — Takes a string with the new base path to be set
|
|
140
|
+
- Method **`set_Direction(direction)`** — Takes a boolean with the new direction to be set
|
|
141
|
+
- Method **`set_Verbose(verbose)`** — Takes a boolean with the new verbose flag to be set
|
|
142
|
+
- Method **`set_IgnoreList(ignorelist)`** — Takes a list with the new ignore patterns to be set
|
|
143
|
+
-->
|
|
144
|
+
|
|
145
|
+
## 5. Usage <sup><a href="#id20260813o0913" id="id20260813o0913">🔗</a></sup>
|
|
146
|
+
|
|
147
|
+
Here is a minimalistic example how to use FileHiker:
|
|
148
|
+
|
|
149
|
+
<pre>
|
|
150
|
+
import filehiker
|
|
151
|
+
fhk = filehiker.FileHiker() # Since no base folder is defined, the CWD is used as such
|
|
152
|
+
offset = '' # No offset means the target is the base folder itself
|
|
153
|
+
neighbour = fhk.find_neighbour(offset) # The right neighbour of the base folder is it´s first entry
|
|
154
|
+
print(f'Right neighbour = {neighbour}' # Shows the found first entry in the base folder
|
|
155
|
+
</pre>
|
|
156
|
+
|
|
157
|
+
## 6. Development Folder Structure <sup><a href="#id20250816o0849" id="id20250816o0849">🔗</a></sup>
|
|
158
|
+
|
|
159
|
+
The FileHiker package uses the **'*Src-Layout*' folder structure**, one of three common package layout options.
|
|
160
|
+
<del>Find more about package folder structures in the ZanaFacils Notes file, subchapter
|
|
161
|
+
[About Python Package Layouts](./../zanafacilsdev/zanafacils/docs/notes.md#id20260631o0723).</del>
|
|
162
|
+
|
|
163
|
+
<pre style="font-size: 1.1em; line-height: 1.18em !important;">
|
|
164
|
+
<b>filehikerdev</b>
|
|
165
|
+
├── docs
|
|
166
|
+
│ └── …
|
|
167
|
+
├── <b>src</b>
|
|
168
|
+
│ └── <b>filehiker</b>
|
|
169
|
+
│ ├── <b>__init__.py</b>
|
|
170
|
+
│ ├── <b>filehiker.py</b>
|
|
171
|
+
│ └── <em>possible subpkgs</em>
|
|
172
|
+
│ ├── <em>__init__.py</em>
|
|
173
|
+
│ └── <em>module2.py</em>
|
|
174
|
+
├── README.md
|
|
175
|
+
└── <b>pyproject.toml</b>
|
|
176
|
+
</pre>
|
|
177
|
+
|
|
178
|
+
<img class="lmp-reference-icon" src="./assets/icos/20250816o0849.py-pkgs--org.v1.x0064y0064.png" width="48" height="48" alt=" Icon 20250816°0849">
|
|
179
|
+
Detailled information on Python packages is found on site 'Python Packages'
|
|
180
|
+
- Frontpage [Py-Pkgs.org](https://py-pkgs.org/)
|
|
181
|
+
<sup>[ref 20260817°1034]</sup>
|
|
182
|
+
- Chapter [4. Package structure and distribution](https://py-pkgs.org/04-package-structure.html)
|
|
183
|
+
<sup>[ref 20250816°0848]</sup>
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
<img class="lmp-reference-icon" src="./assets/icos/20250514o0821.mistral-ai.v2.x0064y0064.png" width="48" height="48" alt=" Icon 20250514°0821">
|
|
188
|
+
Mistral quest
|
|
189
|
+
[Python package documentation placement](https://chat.mistral.ai/chat/db251f65-bdb0-4cfe-b58a-3ddef93513b2)
|
|
190
|
+
— Reasoning about where to place which documentation
|
|
191
|
+
<sup>[ref 20260726°0842 📡]</sup>
|
|
192
|
+
|
|
193
|
+
## 7. Credits <sup><a href="#20260816o0831" id="id20260816o0831">🔗</a></sup>
|
|
194
|
+
|
|
195
|
+
<img class="lmp-reference-icon" src="./assets/icos/20260819o0731.tree-view-logo-one.v3.svg" width="64" height="64" alt=" Icon 20260819°0731">
|
|
196
|
+
The 'File System Hierarchy One' logo is made by Norbert with DrawIO, Inkscape and
|
|
197
|
+
[jakearchibald.github.io/svgomg](https://jakearchibald.github.io/svgomg/) under the
|
|
198
|
+
[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) license
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
<img class="lmp-reference-icon" src="./assets/icos/20210508o1044.choosealicense.v2.x0064y0064.png" width="48" height="48" alt=" Icon 20210508°1044">
|
|
203
|
+
The license text was taken from
|
|
204
|
+
[choosealicense.com/licenses/bsd-3-clause/](https://choosealicense.com/licenses/bsd-3-clause/)
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
#### 8. Fineprint <sup><a href="#id20260725o1019" id="id20260725o1019">🔗</a></sup>
|
|
211
|
+
|
|
212
|
+
<pre class="lmp-font-small">
|
|
213
|
+
project 20250406°0711 FileHiker
|
|
214
|
+
objtype : Python package
|
|
215
|
+
url :
|
|
216
|
+
title : Filehiker
|
|
217
|
+
summary : Find filesystem item´s neighbour left or right
|
|
218
|
+
status : Applicable
|
|
219
|
+
tags :
|
|
220
|
+
note :
|
|
221
|
+
⬞
|
|
222
|
+
</pre>
|
|
223
|
+
|
|
224
|
+
<pre class="lmp-font-small">
|
|
225
|
+
repo 20260818°1414 FileHikerDev
|
|
226
|
+
objtype : Git repository
|
|
227
|
+
canonical : https://gitlab.com/normai/filehikerdev
|
|
228
|
+
title : FileHikerDev
|
|
229
|
+
tags :
|
|
230
|
+
note :
|
|
231
|
+
⬞
|
|
232
|
+
</pre>
|
|
233
|
+
|
|
234
|
+
<sup>Page 20250406°0721 ⬞Ω</sup>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright © 2025 - 2026, Norbert C. Maier
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -5,28 +5,29 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
[project]
|
|
6
6
|
authors = [{name = "Norbert C. Maier"}]
|
|
7
7
|
classifiers = [
|
|
8
|
-
"Development Status ::
|
|
8
|
+
"Development Status :: 4 - Beta",
|
|
9
9
|
"Intended Audience :: Developers",
|
|
10
10
|
"Topic :: Software Development",
|
|
11
11
|
]
|
|
12
12
|
dependencies = []
|
|
13
|
-
description = "
|
|
13
|
+
description = "File system walker — Find the right or the left neighbour of a path inside a specified base folder"
|
|
14
14
|
keywords = ["directory crawler", "directory walker", "file system crawler", "file system walker"]
|
|
15
15
|
license = "BSD-3-Clause"
|
|
16
16
|
name = "FileHiker"
|
|
17
17
|
readme = "README.md"
|
|
18
18
|
requires-python = ">= 3.13"
|
|
19
|
-
version = "0.3
|
|
19
|
+
version = "0.4.3"
|
|
20
20
|
|
|
21
21
|
[project.urls]
|
|
22
22
|
Homepage = "https://gitlab.com/normai/filehiker"
|
|
23
23
|
|
|
24
24
|
[tool.setuptools]
|
|
25
25
|
# Use either packages or package discovery
|
|
26
|
-
# ##packages = ["filehiker"] # Explicit list — Seems to have problems if project and package folder names are different
|
|
27
26
|
package-dir = {"" = "src"} # Ensure this points to the correct location
|
|
28
27
|
|
|
29
28
|
[tool.setuptools.package-data]
|
|
30
29
|
filehiker = ["cases/**/*"] # Include all files in 'cases' and its subdirectories (ref 20260817°0736)
|
|
31
30
|
|
|
31
|
+
# See e.g. https://packaging.python.org/en/latest/specifications/core-metadata/
|
|
32
|
+
# See e.g. https://pypi.org/classifiers/
|
|
32
33
|
# [file 20250406´0713 project.toml]
|