Skip to content

Sort of an finger exercise in Python - several toos for listing files filtered by name/type in a folder and writing information to stdout, a CSV file, or a sqlite database file.

License

Notifications You must be signed in to change notification settings

mikiair/MiHsPyFList

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiHsPyFList

Sort of a finger exercise in Python - several tools for listing files filtered by name/type in a folder and writing information to stdout, a CSV file or to a Sqlite database.

  • pfl - Simple file listing with just path and filename
  • pfli - File listing with additional file information on size and creation / last write dates
  • pflh - as before, plus SHA256 hash
  • pflj - File listing with fixed search pattern '*.jpg', JPG width and height are written
  • pfl3 - File listing with fixed search pattern '*.mp3', MP3 tag information is given
  • pfl4 - File listing with fixed search pattern '*.mp4', MP4 tag information is given

Usage

pfl [-h] [-r] [-x EXCLUDE] [-o | -u] [-n | -d DOTS] [pattern] [scandir] [outfile]

Positional arguments

  • pattern - only files matching this pattern will be listed
  • scandir - directory to scan for files (default=current folder)
  • outfile - CSV or database file to write results to (default=stdout)

Optional arguments

  • -h, --help - show help message and exit
  • -r, --recurse - recurse sub-folders
  • -x EXCLUDE, --exclude EXCLUDE - exclude files and/or folders matching this regular expression
  • -l, --limit - limit the scanned file size for hash value calculation to 100MB (pflh only)

File options

optional arguments apply when writing to CSV or database file (ignored otherwise)

  • -o, --overwrite - overwrite the outfile if existent
  • -u, --update - update SQLite database or append to the CSV outfile if existent
  • -n, --nodots - do not display dots for matches
  • -d DOTS, --dots DOTS - logarithmic number of matching files to display one dot for (i.e. 0=every file, 1=each 10 files, 2=each 100 files...)

Requirements

For using the tools which log media file (jpg/mp3/mp4) properties, you will have to install one or more additional Python libraries:

pip install tinytag
pip install Pillow

About

Sort of an finger exercise in Python - several toos for listing files filtered by name/type in a folder and writing information to stdout, a CSV file, or a sqlite database file.

Topics

Resources

License

Stars

Watchers

Forks

Languages