Travel any path and find some files.
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file path_traveler-0.0.4.tar.gz.
File metadata
- Download URL: path_traveler-0.0.4.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
925d88061193317df30ca10f9b4a58bbb13ac0acd16e11d0f6f6f993d562f746
|
|
| MD5 |
3b1e20f4077edad4160a86e01b716046
|
|
| BLAKE2b-256 |
d8b3655561031eebc08919d3d613274fdc60692f4654d29f964a05806555b140
|
File details
Details for the file path_traveler-0.0.4-py2.py3-none-any.whl.
File metadata
- Download URL: path_traveler-0.0.4-py2.py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df8c27658b4322d1fc32de9803a50af24bdcf5490817260728ebbc2e9e4bc305
|
|
| MD5 |
a736c8eecc4887413073b43fe806c83c
|
|
| BLAKE2b-256 |
c5146a15be6c9980d527c9648ae6046444a6ee7c1cb7a680ae79495e23af05e6
|