Travel any path and find some files
path-traveler is a simple package to walk and travel from any root path directory into all of its children directories and files coming in the journey and perform search operation to list down all available path(s) of the file(s).
Use in python code
Following are some of the sample examples to show the use of the path-traveler package. This package has a function named travelling which takes optional input 2 arguments. root_path is the first argument used to set the root directory path and find is the second argument used to search any file in the root directory and all of its children directories. The default is None which searches all files from root_path. Let's take a look.
>>> from path_traveler import travelling
>>> root_path = './sample'
>>> find = 'spec.json'
>>> journey = travelling(root_path=root_path, find=find)
>>> journey._fields
('root_path', 'cwd', 'absolute_paths', 'relative_paths', 'travel')
>>> root_path = journey.root_path
>>> current_working_directory = journey.cwd
>>> absolute_paths = journey.absolute_paths
>>> relative_paths = journey.relative_paths
>>> traveller = journey.travel
Use in command line interface (CLI)
path_traveler --help
Usage: path-traveler [OPTIONS]
Options:
-P, --root_path TEXT Any path from which you want to start
travelling. If None is given then the root
directory of this module will act as root
path. The default is None.
-F, --find TEXT Find any file name which you want to
identify no matter whether is it present in
any of the subdirectories. If None is given
all find will be searching. The default is
None.
-A, --show_absolute_paths BOOLEAN
Print absolute paths [default: (False)]
-R, --show_relative_paths BOOLEAN
Print relative paths [default: (False)]
-E, --show_examples BOOLEAN Print predefined examples [default:
(False)]
--help Show this message and exit.
For more information please visit GitHub
License
MIT License
Release files for path-traveler 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| path_traveler-0.0.7.tar.gz | 9.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| path_traveler-0.0.7-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 18.3 kB
Release files / path_traveler-0.0.7.tar.gz
| Download URL | path_traveler-0.0.7.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d03febadfd4fcb5de96188253f8e1c640ec15411ce9f97a22c44bcc23bc6091f
|
|
BLAKE2b-256 checksum How to use checksums |
bcdb6b3d11a6c4d0753029681fe67f1f840b828353858578db6e9db3426cb8aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / path_traveler-0.0.7-py2.py3-none-any.whl
| Download URL | path_traveler-0.0.7-py2.py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
a7774ede468372ab38b7fb8fb610d049e26dc7c19f0d58b0c2f25a362cf2d9e7
|
|
BLAKE2b-256 checksum How to use checksums |
12498a8ad67a4693f339a45e124083f2bfa7ecc7651d3cf5f3773ac51dd5aad6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|