Module For Iterating through OS Directories
Project description
Module Setup
git clone https://github.com/m-zayan/fdir.git
Unzip file then open it
Open terminal (Linux) or cmd (Windows command prompt)
Type python setup.py build && python setup.py install
Modes
1 - ./
Dirctories (Folders)
2 - .
Files
3 - .*
Files with specific extension (eg : .csv
or .pdf
)
4 - //
Files and Directories
Module Functions
listdir(str path,str mode)
The Function takes two arguments path
and mode (1 , 2 , 3 or 4)
return List of pathes from given path
Ex
import fdir
pathes_list = fdir.listdir(path,'./') # return path of all folders at the current directory as same as (os.listdir)
itrAll(list paths,str mode)
The Function takes two arguments list of paths
and mode (1 , 2 , 3 or 4)
return dictionary (str key,list paths)
Ex
import fdir
sub_files = fdir.itrAll(pathes_list,'./') # return paths of all folders for each path at list
itrDict(dict paths,str mode)
The Function takes two arguments dictionary of paths
and mode (1 , 2 , 3 or 4)
return dictionary (str key,dict paths)
Ex
import fdir
dict_sub_files = fdir.itrAll(sub_files,'.pdf') # return paths of all pdf files for each list of paths at dictionary
walk(str paths,str mode)
The Function takes two arguments dictionary of paths
and mode (1 , 2 , 3 or 4)
Recursively iterating through all files from initial path , Return List of all files which match mode
Ex
import fdir
pdf_files = fdir.walk(path,'.pdf') # return paths of all pdf files.
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
Built Distribution
File details
Details for the file fdir-1.0.tar.gz
.
File metadata
- Download URL: fdir-1.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
90b4ac59549db32b0eeea0625827bafe9145841d38662c38edd2a81c6e6fed9e
|
|
MD5 |
292ef54d62bd0c7c56fbd142c49eb452
|
|
BLAKE2b-256 |
a6b261a4a592f2bca17f01a704cdb8e0e1549676779b7d6e30051c4ac7652c33
|
File details
Details for the file fdir-1.0-py3.7-linux-x86_64.egg
.
File metadata
- Download URL: fdir-1.0-py3.7-linux-x86_64.egg
- Upload date:
- Size: 22.2 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
8c174473fe6b7b258a10a2cf851dbb53d21644f8ff4e923ec50786ce35f9c416
|
|
MD5 |
2a91ba690e1be687f0b0c7442e87d6e2
|
|
BLAKE2b-256 |
0c7a1edf2f61ec178586db670cc8f85f073624fc17020cc5f23791a89bb13ab4
|