Threaded directory iteration via os.scandir() with progress indicator and resume function.
Project description
IterFilesystem
Threaded directory iteration via os.scandir() with progress indicator and resume function.
Requirement:
Python 3.6 or newer.
Pipenv. Packages and virtual environment manager.
Please: try, fork and contribute! ;)
Example
Use example CLI, e.g.:
~$ git clone https://github.com/jedie/IterFilesystem.git ~$ cd IterFilesystem ~/IterFilesystem$ pipenv install ~/IterFilesystem$ pipenv shell (IterFilesystem) ~/IterFilesystem$ print_fs_stats --help usage: print_fs_stats.py [-h] [-v] [--path PATH] [--skip_dirs [SKIP_DIRS [SKIP_DIRS ...]]] [--skip_filenames [SKIP_FILENAMES [SKIP_FILENAMES ...]]] [--force_restart] [--complete_cleanup] Scan filesystem and print some information optional arguments: -h, --help show this help message and exit -v, --version show program's version number and exit --path PATH The file path that should be scanned e.g.: "~/foobar/" default is "~" --skip_dirs [SKIP_DIRS [SKIP_DIRS ...]] Directory names to exclude from scan. --skip_filenames [SKIP_FILENAMES [SKIP_FILENAMES ...]] File names to ignore. --force_restart Don't use resume data: Delete persist queue data before start. --complete_cleanup Delete persist queue after complete scan.
example output looks like this:
(IterFilesystem) ~/IterFilesystem$ $ print_fs_stats --path ~/IterFilesystem --skip_dirs .tox .pytest_cache Read/process: '/home/foobar/IterFilesystem'... Skip directories: * .tox * .pytest_cache [INFO: 61 2019-09-15 12:37:17,973] Save persist queue to: /home/foobar/IterFilesystem/persisted_queue_4Aubn [INFO: 37 2019-09-15 12:37:18,252] Skip dir: '.idea' [INFO: 37 2019-09-15 12:37:18,252] Skip dir: '.tox' [INFO: 37 2019-09-15 12:37:18,270] Skip dir: '.pytest_cache' Read filesystem with 83 items in 0.3sec. *** all items processed ***: 100%|████████████████████████████████████| 83/83 [00:00<00:00, 85.25it/s] total filesystem items: 83 Finish in.............: 1.0sec. File count.....: 73 with 10991860 Bytes Directory count: 10 Other count....: 0
History
dev - compare v0.0.1…master
TBC
15.09.2019 - v0.0.1
first Release on PyPi
Links
Donating
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
iterfilesystem-0.0.1.tar.gz
(11.2 kB
view hashes)
Built Distributions
iterfilesystem-0.0.1-py3.6.egg
(11.3 kB
view hashes)
Close
Hashes for iterfilesystem-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04f139fd9eaa40119feb4552c87bbfabb3bb8905985a47f4e300f5602532cdf2 |
|
MD5 | 0729c68e8c5cc14d5b2823efde4d1081 |
|
BLAKE2b-256 | 92188c62bd1d2a6ed646c0c99a14386acad0e2e05f844d2f46fbf97653dae3e1 |