FileHiker 0.3.9.2__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.3.9.2/PKG-INFO +226 -0
- filehiker-0.3.9.2/README.md +212 -0
- filehiker-0.3.9.2/pyproject.toml +32 -0
- filehiker-0.3.9.2/setup.cfg +4 -0
- filehiker-0.3.9.2/src/FileHiker.egg-info/PKG-INFO +226 -0
- filehiker-0.3.9.2/src/FileHiker.egg-info/SOURCES.txt +36 -0
- filehiker-0.3.9.2/src/FileHiker.egg-info/dependency_links.txt +1 -0
- filehiker-0.3.9.2/src/FileHiker.egg-info/top_level.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/__init__.py +4 -0
- filehiker-0.3.9.2/src/filehiker/__main__.py +249 -0
- filehiker-0.3.9.2/src/filehiker/cases/20260806o1211.sorted.txt +49 -0
- filehiker-0.3.9.2/src/filehiker/cases/20260806o1213.invert.py +30 -0
- filehiker-0.3.9.2/src/filehiker/cases/20260806o1215.inverted.txt +49 -0
- filehiker-0.3.9.2/src/filehiker/cases/README.md +24 -0
- filehiker-0.3.9.2/src/filehiker/cases/^^file-to-ignore^^.txt +3 -0
- filehiker-0.3.9.2/src/filehiker/cases/^^folder-to-ignore^^/more123.txt +3 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_2/file_01_abc.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_2b.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_3/dir_31/dir_311/^^dir_3111^^/file_03_more.txt +3 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_3/dir_31/dir_311/dir_3113/file_04_bcd.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_3/dir_31/file_02_abc.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_4.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_5/dir_51/dir_511/dir_5111/file_08_k.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_5/dir_51/dir_511/dir_5111/file_10_m.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_5/dir_51/dir_511/dir_5111/file_11_n.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_5/dir_52/dir_521/dir_5212/file_08_g.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_5/dir_52/file_07_c.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_5/dir_53/dir_531/dir_5311/dir_53111/dir_531111/file_12_x.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_5/dir_53/dir_531/dir_5311/dir_53111/dir_531111/file_13_y.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_5/dir_53/dir_531/dir_5311/dir_53111/dir_531111/file_14_z.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_5/file_05_a.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_5/file_06_h.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/cases/dir_5/file_07_p.txt +1 -0
- filehiker-0.3.9.2/src/filehiker/filehiker.py +833 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: FileHiker
|
|
3
|
+
Version: 0.3.9.2
|
|
4
|
+
Summary: A file system walker β Find the right or 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 :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Topic :: Software Development
|
|
12
|
+
Requires-Python: >=3.13
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
<!-- title = 'FileHiker'; favicon = './docs/icos/20260815o0743.orangetree.v1.x0256y0256.png'; -->
|
|
16
|
+
|
|
17
|
+
<img src="./docs/icos/20260815o0743.orangetree.v1.x0256y0256.png" align="right" width="160" height="160" alt="Logo 20220206Β°0933">
|
|
18
|
+
|
|
19
|
+
<div markdown="1" class="lmp-breadcrumbs">
|
|
20
|
+
<span class="CurrentChapter">[Projects](./../../../blogdev/trunk/projects.md)</span> β
|
|
21
|
+
<span class="CurrentPage">[FileHikerDev](./README.md)</span> β
|
|
22
|
+
[Changes](./docs/changelog.md)
|
|
23
|
+
[Issues](./docs/issues.md)
|
|
24
|
+
[Notes](./docs/notes.md)
|
|
25
|
+
[References](./docs/references.md)
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
# FileHikerDev <span class="lmp-title-type">Project</span> <sup>v0.3.9.2</sup>
|
|
29
|
+
|
|
30
|
+
<div markdown="1" class="lmp-box-page-sections">
|
|
31
|
+
Below:
|
|
32
|
+
[1. Summary](#id20260725o1011)
|
|
33
|
+
[2. Installation](#id20260725o1013)
|
|
34
|
+
[3. UI](#id20260813o0911)
|
|
35
|
+
[4. API](#id20260725o1015)
|
|
36
|
+
[5. Usage](#id20260813o0913)
|
|
37
|
+
[6. Folder Structure](#id20250816o0849)
|
|
38
|
+
[7. Flowchart](#id20260725o1017)
|
|
39
|
+
[8. Credits](#id20260816o0831)
|
|
40
|
+
[9. Fineprint](#id20260725o1019)
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
## 1. Summary <sup><a href="#id20260725o1011" id="id20260725o1011">π</a></sup>
|
|
44
|
+
|
|
45
|
+
FileHiker is a Python package to find a filesystem item's neighbour
|
|
46
|
+
relative to a given target path inside a given 'base folder'. It finds
|
|
47
|
+
either the next or the previous neighbour, depending on a direction flag.
|
|
48
|
+
If the target does not exist, it tries to find a sensible 'neighbour' anyway.
|
|
49
|
+
|
|
50
|
+
Synopsis:
|
|
51
|
+
- Slogan : **Directory crawler** Python package. It finds any file system itemΒ΄s
|
|
52
|
+
neighbour, one by one, walking either forward or backward
|
|
53
|
+
- Particularities:
|
|
54
|
+
- Walks **forward and backward** equally and symmetrically
|
|
55
|
+
- Suited for **huge file system hierarchies** due to itΒ΄s memory saving
|
|
56
|
+
behaviour using internally only one single-level directory listing at a time
|
|
57
|
+
- License : BSD 3-Clause
|
|
58
|
+
- Copyright : Β© 2025 β 2026 Norbert C. Maier
|
|
59
|
+
- System: Written and tested with Python 3.13 on Windows. Should work
|
|
60
|
+
on Linux/Mac as well, what is yet to be tested
|
|
61
|
+
- Still missing features : Symlink handling
|
|
62
|
+
- Status : Applicable
|
|
63
|
+
|
|
64
|
+
## 2. Installation <sup><a href="#id20260725o1013" id="id20260725o1013">π</a></sup>
|
|
65
|
+
|
|
66
|
+
Install the package in your Python either via `pip` or as development installation
|
|
67
|
+
|
|
68
|
+
### 2.2. User Installation <sup><a href="#id20260725o1513" id="id20260725o1513">π</a></sup>
|
|
69
|
+
|
|
70
|
+
Since the package is is not (yet) on [pypi.org](https://pypi.org/), the user installation
|
|
71
|
+
via *pip* is not yet available, only the development installation is possible (see below).
|
|
72
|
+
If available, it looks like follows:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
> python.exe -m pip install filehiker
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
or
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
> pip.exe install filehiker
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 2.1. Development Installation <sup><a href="#id20260725o1511" id="id20260725o1511">π</a></sup>
|
|
85
|
+
|
|
86
|
+
How to do so?
|
|
87
|
+
1. Somehow get the `filehikerdev` project folder on your local drive
|
|
88
|
+
1. In the console change directory to the projectΒ΄s root folder `filehikerdev`
|
|
89
|
+
1. Issue one of the following commands β DonΒ΄t miss the trailing dot for 'current folder'!
|
|
90
|
+
- `filehikerdev> pip.exe install -e .`
|
|
91
|
+
- `filehikerdev> python.exe -m pip install -e .`
|
|
92
|
+
|
|
93
|
+
<a href="./docs/imgs/20260814o0721.console--pip-exe--install--filehiker.png"><img src="./docs/imgs/20260814o0721.console--pip-exe--install--filehiker.png" class="lmp-img-centered" width="653" height="278" data-dims="x1452y0619" alt="Screenshot 20260814Β°0721"></a>
|
|
94
|
+
<br>Install local FileHiker development version. Note the trailing dot in the first line! ([txt](./docs/imgs/20260814o0721.console--pip-exe--install--filehiker.png.txt))
|
|
95
|
+
|
|
96
|
+
## 3. UI (User Interface) <sup><a href="#id20260813o0911" id="id20260813o0911">π</a></sup>
|
|
97
|
+
|
|
98
|
+
After installation, FileHiker can immediately do some things from the console, as follows
|
|
99
|
+
|
|
100
|
+
- Perform some selftest:
|
|
101
|
+
```
|
|
102
|
+
> python.exe -m filehiker
|
|
103
|
+
```
|
|
104
|
+
- Perform some selftest β¦ :
|
|
105
|
+
```
|
|
106
|
+
> python.exe -m filehiker selftest
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Restriction, mentioned just for sake of completeness. `python.exe -m filehiker` must
|
|
110
|
+
**not** be called from the folder, where the `filehiker.py` resides. When done so,
|
|
111
|
+
nothing happens. This is due to the Python package handling, which makes it difficult
|
|
112
|
+
to catch that case. The effort implementing this case is not worth the gain.
|
|
113
|
+
As a user, you will never see this folder anyway, but as a developer you will work in it.
|
|
114
|
+
|
|
115
|
+
## 4. API (Application Programmers Interface) <sup><a href="#id20260725o1015" id="id20260725o1015">π</a></sup>
|
|
116
|
+
|
|
117
|
+
- Constructor **`filehiker.FileHiker(basepath, direction, ignorewcs, verbose)`** where
|
|
118
|
+
- `basepath` β Optional string to tell to which folder the scanning is confined. Default is `''`
|
|
119
|
+
(empty), which shall translate to the folder from where `python.exe` was called
|
|
120
|
+
- `direction` β Optional boolean telling whether to go forward or backward. Default is `True`, means forward
|
|
121
|
+
- `ignorewcs` β Optional list with wildcard patterns for files and folder to ignore.
|
|
122
|
+
Default is a list with patterns like `.git`, `__*__`, etc. See the list in the
|
|
123
|
+
source [filehiker.py](./src/filehiker/filehiker.py) at about line 50
|
|
124
|
+
- `verbose` - Flag to tell whether to print some output or not. Default is `False`
|
|
125
|
+
- Method **`find_neighbour(target)`** where target is a string with a path pointing to the current
|
|
126
|
+
item, from which itΒ΄s neighbour is wanted. Returns a string with the found neighbour.
|
|
127
|
+
- Method **`get_BasePath()`** β Returns the current base path
|
|
128
|
+
- Method **`get_Direction()`** β Returns the current direction flag
|
|
129
|
+
- Method **`get_Verbose()`** β Returns the current verbose flag
|
|
130
|
+
- Method **`get_IgnoreList()`** β Returns the current ignore list
|
|
131
|
+
- Static method **`normaleis()`** β Takes a path and returns it normalized, means with slashes and a trailing slash for directories
|
|
132
|
+
- Method **`set_BasePath(basepath)`** β Takes a string with the new base path to be set
|
|
133
|
+
- Method **`set_Direction(direction)`** β Takes a boolean with the new direction to be set
|
|
134
|
+
- Method **`set_Verbose(verbose)`** β Takes a boolean with the new verbose flag to be set
|
|
135
|
+
- Method **`set_IgnoreList(ignorelist)`** β Takes a list with the new ignore patterns to be set
|
|
136
|
+
|
|
137
|
+
## 5. Usage <sup><a href="#id20260813o0913" id="id20260813o0913">π</a></sup>
|
|
138
|
+
|
|
139
|
+
Here some exsample code how to use it
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
# β¦
|
|
143
|
+
```
|
|
144
|
+
<span class="lmp-font-todo">Todo: Provide some example code</span>
|
|
145
|
+
|
|
146
|
+
## 6. Package Folder Structure <sup><a href="#id20250816o0849" id="id20250816o0849">π</a></sup>
|
|
147
|
+
|
|
148
|
+
The FileHiker package uses the **'*Src-Layout*' folder structure**, one of three common package layout options.
|
|
149
|
+
Find more about package folder structures in the ZanaFacils Notes file, subchapter
|
|
150
|
+
[About Python Package Layouts](./../zanafacilsdev/zanafacils/docs/notes.md#id20260631o0723).
|
|
151
|
+
|
|
152
|
+
<pre style="font-size: 1.1em; line-height: 1.18em !important;">
|
|
153
|
+
<b>filehikerdev</b>
|
|
154
|
+
βββ docs
|
|
155
|
+
β βββ β¦
|
|
156
|
+
βββ <b>src</b>
|
|
157
|
+
β βββ <b>filehiker</b>
|
|
158
|
+
β βββ <b>__init__.py</b>
|
|
159
|
+
β βββ <b>filehiker.py</b>
|
|
160
|
+
β βββ <em>subpkg</em>
|
|
161
|
+
β βββ <em>__init__.py</em>
|
|
162
|
+
β βββ <em>module2.py</em>
|
|
163
|
+
βββ README.md
|
|
164
|
+
βββ <b>pyproject.toml</b>
|
|
165
|
+
</pre>
|
|
166
|
+
|
|
167
|
+
This is the folder structure of the **development installation**.
|
|
168
|
+
With a (not yet available) user installation, only the package folder will be seen.
|
|
169
|
+
|
|
170
|
+
<!-- img class="lmp-reference-icon" src="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><circle cx='24' cy='24' r='24' fill='LightSlateGray'/></svg>" width="32" height="32" alt=" Icon gray disk" -->
|
|
171
|
+
|
|
172
|
+
<img class="lmp-reference-icon" src="./docs/icos/20250816o0849.py-pkgs--org.v1.x0064y0064.png" width="48" height="48" alt=" Icon 20250816Β°0849">
|
|
173
|
+
Thorough information on Python packages folder structures is found on
|
|
174
|
+
[Py-Pkgs.org](https://py-pkgs.org/)
|
|
175
|
+
<sup>[ref β]</sup>
|
|
176
|
+
chapter
|
|
177
|
+
[4. Package structure and distribution](https://py-pkgs.org/04-package-structure.html)
|
|
178
|
+
<sup>[ref 20250816Β°0848]</sup>
|
|
179
|
+
|
|
180
|
+
<img class="lmp-reference-icon" src="./docs/icos/20250514o0821.mistral-ai.v2.x0064y0064.png" width="48" height="48" alt=" Icon 20250514Β°0821">
|
|
181
|
+
Mistral quest
|
|
182
|
+
[Python package documentation placement](https://chat.mistral.ai/chat/db251f65-bdb0-4cfe-b58a-3ddef93513b2)
|
|
183
|
+
β Reasoning about where to place which documentation
|
|
184
|
+
<sup>[ref 20260726Β°0842 π‘]</sup>
|
|
185
|
+
|
|
186
|
+
## 7. Flowchart <sup><a href="#id20260725o1017" id="id20260725o1017">π</a></sup>
|
|
187
|
+
|
|
188
|
+
<a href="./docs/imgs/diagram_filehiker.20260725o0951.uxf.svg"><img src="./docs/imgs/diagram_filehiker.20260725o0951.uxf.svg" style="border:2px solid LightGray; border-radius:0.7rem;" width="400" alt="Diagram 20260725Β°0951"></a>
|
|
189
|
+
|
|
190
|
+
## 8. Credits <sup><a href="#20260816o0831" id="id20260816o0831">π</a></sup>
|
|
191
|
+
|
|
192
|
+
<img class="lmp-reference-icon" src="./docs/icos/20260815o0743.orangetree.v1.x0256y0256.png" width="48" height="48" alt=" Icon 20260815Β°0743">
|
|
193
|
+
The Orange Tree logo comes from
|
|
194
|
+
[openclipart.org/detail/323926/orange-tree](https://openclipart.org/detail/323926/orange-tree)
|
|
195
|
+
as a Public Domain dedication.
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
#### 8. Fineprint <sup><a href="#id20260725o1019" id="id20260725o1019">π</a></sup>
|
|
203
|
+
|
|
204
|
+
<pre>
|
|
205
|
+
project 20250406Β°0711 FileHiker
|
|
206
|
+
objtype : Python package
|
|
207
|
+
url :
|
|
208
|
+
title : Filehiker
|
|
209
|
+
summary : Find filesystem itemΒ΄s neighbour left or right
|
|
210
|
+
status : Applicable
|
|
211
|
+
tags :
|
|
212
|
+
note :
|
|
213
|
+
β¬
|
|
214
|
+
</pre>
|
|
215
|
+
|
|
216
|
+
<pre>
|
|
217
|
+
repo 20260818Β°1414 FileHikerDev
|
|
218
|
+
objtype : Git repository
|
|
219
|
+
canonical : https://gitlab.com/normai/filehikerdev
|
|
220
|
+
title : FileHikerDev
|
|
221
|
+
tags :
|
|
222
|
+
note :
|
|
223
|
+
β¬
|
|
224
|
+
</pre>
|
|
225
|
+
|
|
226
|
+
<sup>Page 20250406Β°0721 β¬Ξ©</sup>
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
<!-- title = 'FileHiker'; favicon = './docs/icos/20260815o0743.orangetree.v1.x0256y0256.png'; -->
|
|
2
|
+
|
|
3
|
+
<img src="./docs/icos/20260815o0743.orangetree.v1.x0256y0256.png" align="right" width="160" height="160" alt="Logo 20220206Β°0933">
|
|
4
|
+
|
|
5
|
+
<div markdown="1" class="lmp-breadcrumbs">
|
|
6
|
+
<span class="CurrentChapter">[Projects](./../../../blogdev/trunk/projects.md)</span> β
|
|
7
|
+
<span class="CurrentPage">[FileHikerDev](./README.md)</span> β
|
|
8
|
+
[Changes](./docs/changelog.md)
|
|
9
|
+
[Issues](./docs/issues.md)
|
|
10
|
+
[Notes](./docs/notes.md)
|
|
11
|
+
[References](./docs/references.md)
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
# FileHikerDev <span class="lmp-title-type">Project</span> <sup>v0.3.9.2</sup>
|
|
15
|
+
|
|
16
|
+
<div markdown="1" class="lmp-box-page-sections">
|
|
17
|
+
Below:
|
|
18
|
+
[1. Summary](#id20260725o1011)
|
|
19
|
+
[2. Installation](#id20260725o1013)
|
|
20
|
+
[3. UI](#id20260813o0911)
|
|
21
|
+
[4. API](#id20260725o1015)
|
|
22
|
+
[5. Usage](#id20260813o0913)
|
|
23
|
+
[6. Folder Structure](#id20250816o0849)
|
|
24
|
+
[7. Flowchart](#id20260725o1017)
|
|
25
|
+
[8. Credits](#id20260816o0831)
|
|
26
|
+
[9. Fineprint](#id20260725o1019)
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
## 1. Summary <sup><a href="#id20260725o1011" id="id20260725o1011">π</a></sup>
|
|
30
|
+
|
|
31
|
+
FileHiker is a Python package to find a filesystem item's neighbour
|
|
32
|
+
relative to a given target path inside a given 'base folder'. It finds
|
|
33
|
+
either the next or the previous neighbour, depending on a direction flag.
|
|
34
|
+
If the target does not exist, it tries to find a sensible 'neighbour' anyway.
|
|
35
|
+
|
|
36
|
+
Synopsis:
|
|
37
|
+
- Slogan : **Directory crawler** Python package. It finds any file system itemΒ΄s
|
|
38
|
+
neighbour, one by one, walking either forward or backward
|
|
39
|
+
- Particularities:
|
|
40
|
+
- Walks **forward and backward** equally and symmetrically
|
|
41
|
+
- Suited for **huge file system hierarchies** due to itΒ΄s memory saving
|
|
42
|
+
behaviour using internally only one single-level directory listing at a time
|
|
43
|
+
- License : BSD 3-Clause
|
|
44
|
+
- Copyright : Β© 2025 β 2026 Norbert C. Maier
|
|
45
|
+
- System: Written and tested with Python 3.13 on Windows. Should work
|
|
46
|
+
on Linux/Mac as well, what is yet to be tested
|
|
47
|
+
- Still missing features : Symlink handling
|
|
48
|
+
- Status : Applicable
|
|
49
|
+
|
|
50
|
+
## 2. Installation <sup><a href="#id20260725o1013" id="id20260725o1013">π</a></sup>
|
|
51
|
+
|
|
52
|
+
Install the package in your Python either via `pip` or as development installation
|
|
53
|
+
|
|
54
|
+
### 2.2. User Installation <sup><a href="#id20260725o1513" id="id20260725o1513">π</a></sup>
|
|
55
|
+
|
|
56
|
+
Since the package is is not (yet) on [pypi.org](https://pypi.org/), the user installation
|
|
57
|
+
via *pip* is not yet available, only the development installation is possible (see below).
|
|
58
|
+
If available, it looks like follows:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
> python.exe -m pip install filehiker
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
or
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
> pip.exe install filehiker
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 2.1. Development Installation <sup><a href="#id20260725o1511" id="id20260725o1511">π</a></sup>
|
|
71
|
+
|
|
72
|
+
How to do so?
|
|
73
|
+
1. Somehow get the `filehikerdev` project folder on your local drive
|
|
74
|
+
1. In the console change directory to the projectΒ΄s root folder `filehikerdev`
|
|
75
|
+
1. Issue one of the following commands β DonΒ΄t miss the trailing dot for 'current folder'!
|
|
76
|
+
- `filehikerdev> pip.exe install -e .`
|
|
77
|
+
- `filehikerdev> python.exe -m pip install -e .`
|
|
78
|
+
|
|
79
|
+
<a href="./docs/imgs/20260814o0721.console--pip-exe--install--filehiker.png"><img src="./docs/imgs/20260814o0721.console--pip-exe--install--filehiker.png" class="lmp-img-centered" width="653" height="278" data-dims="x1452y0619" alt="Screenshot 20260814Β°0721"></a>
|
|
80
|
+
<br>Install local FileHiker development version. Note the trailing dot in the first line! ([txt](./docs/imgs/20260814o0721.console--pip-exe--install--filehiker.png.txt))
|
|
81
|
+
|
|
82
|
+
## 3. UI (User Interface) <sup><a href="#id20260813o0911" id="id20260813o0911">π</a></sup>
|
|
83
|
+
|
|
84
|
+
After installation, FileHiker can immediately do some things from the console, as follows
|
|
85
|
+
|
|
86
|
+
- Perform some selftest:
|
|
87
|
+
```
|
|
88
|
+
> python.exe -m filehiker
|
|
89
|
+
```
|
|
90
|
+
- Perform some selftest β¦ :
|
|
91
|
+
```
|
|
92
|
+
> python.exe -m filehiker selftest
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Restriction, mentioned just for sake of completeness. `python.exe -m filehiker` must
|
|
96
|
+
**not** be called from the folder, where the `filehiker.py` resides. When done so,
|
|
97
|
+
nothing happens. This is due to the Python package handling, which makes it difficult
|
|
98
|
+
to catch that case. The effort implementing this case is not worth the gain.
|
|
99
|
+
As a user, you will never see this folder anyway, but as a developer you will work in it.
|
|
100
|
+
|
|
101
|
+
## 4. API (Application Programmers Interface) <sup><a href="#id20260725o1015" id="id20260725o1015">π</a></sup>
|
|
102
|
+
|
|
103
|
+
- Constructor **`filehiker.FileHiker(basepath, direction, ignorewcs, verbose)`** where
|
|
104
|
+
- `basepath` β Optional string to tell to which folder the scanning is confined. Default is `''`
|
|
105
|
+
(empty), which shall translate to the folder from where `python.exe` was called
|
|
106
|
+
- `direction` β Optional boolean telling whether to go forward or backward. Default is `True`, means forward
|
|
107
|
+
- `ignorewcs` β Optional list with wildcard patterns for files and folder to ignore.
|
|
108
|
+
Default is a list with patterns like `.git`, `__*__`, etc. See the list in the
|
|
109
|
+
source [filehiker.py](./src/filehiker/filehiker.py) at about line 50
|
|
110
|
+
- `verbose` - Flag to tell whether to print some output or not. Default is `False`
|
|
111
|
+
- Method **`find_neighbour(target)`** where target is a string with a path pointing to the current
|
|
112
|
+
item, from which itΒ΄s neighbour is wanted. Returns a string with the found neighbour.
|
|
113
|
+
- Method **`get_BasePath()`** β Returns the current base path
|
|
114
|
+
- Method **`get_Direction()`** β Returns the current direction flag
|
|
115
|
+
- Method **`get_Verbose()`** β Returns the current verbose flag
|
|
116
|
+
- Method **`get_IgnoreList()`** β Returns the current ignore list
|
|
117
|
+
- Static method **`normaleis()`** β Takes a path and returns it normalized, means with slashes and a trailing slash for directories
|
|
118
|
+
- Method **`set_BasePath(basepath)`** β Takes a string with the new base path to be set
|
|
119
|
+
- Method **`set_Direction(direction)`** β Takes a boolean with the new direction to be set
|
|
120
|
+
- Method **`set_Verbose(verbose)`** β Takes a boolean with the new verbose flag to be set
|
|
121
|
+
- Method **`set_IgnoreList(ignorelist)`** β Takes a list with the new ignore patterns to be set
|
|
122
|
+
|
|
123
|
+
## 5. Usage <sup><a href="#id20260813o0913" id="id20260813o0913">π</a></sup>
|
|
124
|
+
|
|
125
|
+
Here some exsample code how to use it
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
# β¦
|
|
129
|
+
```
|
|
130
|
+
<span class="lmp-font-todo">Todo: Provide some example code</span>
|
|
131
|
+
|
|
132
|
+
## 6. Package Folder Structure <sup><a href="#id20250816o0849" id="id20250816o0849">π</a></sup>
|
|
133
|
+
|
|
134
|
+
The FileHiker package uses the **'*Src-Layout*' folder structure**, one of three common package layout options.
|
|
135
|
+
Find more about package folder structures in the ZanaFacils Notes file, subchapter
|
|
136
|
+
[About Python Package Layouts](./../zanafacilsdev/zanafacils/docs/notes.md#id20260631o0723).
|
|
137
|
+
|
|
138
|
+
<pre style="font-size: 1.1em; line-height: 1.18em !important;">
|
|
139
|
+
<b>filehikerdev</b>
|
|
140
|
+
βββ docs
|
|
141
|
+
β βββ β¦
|
|
142
|
+
βββ <b>src</b>
|
|
143
|
+
β βββ <b>filehiker</b>
|
|
144
|
+
β βββ <b>__init__.py</b>
|
|
145
|
+
β βββ <b>filehiker.py</b>
|
|
146
|
+
β βββ <em>subpkg</em>
|
|
147
|
+
β βββ <em>__init__.py</em>
|
|
148
|
+
β βββ <em>module2.py</em>
|
|
149
|
+
βββ README.md
|
|
150
|
+
βββ <b>pyproject.toml</b>
|
|
151
|
+
</pre>
|
|
152
|
+
|
|
153
|
+
This is the folder structure of the **development installation**.
|
|
154
|
+
With a (not yet available) user installation, only the package folder will be seen.
|
|
155
|
+
|
|
156
|
+
<!-- img class="lmp-reference-icon" src="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><circle cx='24' cy='24' r='24' fill='LightSlateGray'/></svg>" width="32" height="32" alt=" Icon gray disk" -->
|
|
157
|
+
|
|
158
|
+
<img class="lmp-reference-icon" src="./docs/icos/20250816o0849.py-pkgs--org.v1.x0064y0064.png" width="48" height="48" alt=" Icon 20250816Β°0849">
|
|
159
|
+
Thorough information on Python packages folder structures is found on
|
|
160
|
+
[Py-Pkgs.org](https://py-pkgs.org/)
|
|
161
|
+
<sup>[ref β]</sup>
|
|
162
|
+
chapter
|
|
163
|
+
[4. Package structure and distribution](https://py-pkgs.org/04-package-structure.html)
|
|
164
|
+
<sup>[ref 20250816Β°0848]</sup>
|
|
165
|
+
|
|
166
|
+
<img class="lmp-reference-icon" src="./docs/icos/20250514o0821.mistral-ai.v2.x0064y0064.png" width="48" height="48" alt=" Icon 20250514Β°0821">
|
|
167
|
+
Mistral quest
|
|
168
|
+
[Python package documentation placement](https://chat.mistral.ai/chat/db251f65-bdb0-4cfe-b58a-3ddef93513b2)
|
|
169
|
+
β Reasoning about where to place which documentation
|
|
170
|
+
<sup>[ref 20260726Β°0842 π‘]</sup>
|
|
171
|
+
|
|
172
|
+
## 7. Flowchart <sup><a href="#id20260725o1017" id="id20260725o1017">π</a></sup>
|
|
173
|
+
|
|
174
|
+
<a href="./docs/imgs/diagram_filehiker.20260725o0951.uxf.svg"><img src="./docs/imgs/diagram_filehiker.20260725o0951.uxf.svg" style="border:2px solid LightGray; border-radius:0.7rem;" width="400" alt="Diagram 20260725Β°0951"></a>
|
|
175
|
+
|
|
176
|
+
## 8. Credits <sup><a href="#20260816o0831" id="id20260816o0831">π</a></sup>
|
|
177
|
+
|
|
178
|
+
<img class="lmp-reference-icon" src="./docs/icos/20260815o0743.orangetree.v1.x0256y0256.png" width="48" height="48" alt=" Icon 20260815Β°0743">
|
|
179
|
+
The Orange Tree logo comes from
|
|
180
|
+
[openclipart.org/detail/323926/orange-tree](https://openclipart.org/detail/323926/orange-tree)
|
|
181
|
+
as a Public Domain dedication.
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
#### 8. Fineprint <sup><a href="#id20260725o1019" id="id20260725o1019">π</a></sup>
|
|
189
|
+
|
|
190
|
+
<pre>
|
|
191
|
+
project 20250406Β°0711 FileHiker
|
|
192
|
+
objtype : Python package
|
|
193
|
+
url :
|
|
194
|
+
title : Filehiker
|
|
195
|
+
summary : Find filesystem itemΒ΄s neighbour left or right
|
|
196
|
+
status : Applicable
|
|
197
|
+
tags :
|
|
198
|
+
note :
|
|
199
|
+
β¬
|
|
200
|
+
</pre>
|
|
201
|
+
|
|
202
|
+
<pre>
|
|
203
|
+
repo 20260818Β°1414 FileHikerDev
|
|
204
|
+
objtype : Git repository
|
|
205
|
+
canonical : https://gitlab.com/normai/filehikerdev
|
|
206
|
+
title : FileHikerDev
|
|
207
|
+
tags :
|
|
208
|
+
note :
|
|
209
|
+
β¬
|
|
210
|
+
</pre>
|
|
211
|
+
|
|
212
|
+
<sup>Page 20250406Β°0721 β¬Ξ©</sup>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
authors = [{name = "Norbert C. Maier"}]
|
|
7
|
+
classifiers = [
|
|
8
|
+
"Development Status :: 3 - Alpha",
|
|
9
|
+
"Intended Audience :: Developers",
|
|
10
|
+
"Topic :: Software Development",
|
|
11
|
+
]
|
|
12
|
+
dependencies = []
|
|
13
|
+
description = "A file system walker β Find the right or left neighbour of a path inside a specified base folder"
|
|
14
|
+
keywords = ["directory crawler", "directory walker", "file system crawler", "file system walker"]
|
|
15
|
+
license = "BSD-3-Clause"
|
|
16
|
+
name = "FileHiker"
|
|
17
|
+
readme = "README.md"
|
|
18
|
+
requires-python = ">= 3.13"
|
|
19
|
+
version = "0.3.9.2"
|
|
20
|
+
|
|
21
|
+
[project.urls]
|
|
22
|
+
Homepage = "https://gitlab.com/normai/filehiker"
|
|
23
|
+
|
|
24
|
+
[tool.setuptools]
|
|
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
|
+
package-dir = {"" = "src"} # Ensure this points to the correct location
|
|
28
|
+
|
|
29
|
+
[tool.setuptools.package-data]
|
|
30
|
+
filehiker = ["cases/**/*"] # Include all files in 'cases' and its subdirectories (ref 20260817Β°0736)
|
|
31
|
+
|
|
32
|
+
# [file 20250406Β΄0713 project.toml]
|