guess-filename.py/README.org

3.9 KiB

guessfilename.py

This Python script tries to come up with a new file name for each file from command line argument.

It does this with several methods: first, the current file name is analyzed and any ISO date/timestamp and filetags are re-used. Secondly, if the parsing of the file name did not lead to any new file name, the content of the file is analyzed. Following file types are supported by now:

  • PDF files

The script accepts an arbitrary number of files (see your shell for possible length limitations).

Why

I do scan almost all paper mail. Many of those documents are sent to me regularily. Such documents are bills or insurance informations, for example.

Being too lazy to name those files manually with high chances of getting many variants for the same document type, I came up with a method to derive file names from either the old file name (cues I enter without knowing the exact target file name) or the file content.

Analyzing the content enables this script to recognize bills via customer numbers or phone numbers, amounts to pay, and so on.

Usage

./guessfilename/__init__.py --help
Usage:
    guessfilename [<options>] <list of files>

This little Python script tries to rename files according to pre-defined rules.

It does this with several methods: first, the current file name is analyzed and
any ISO date/timestamp and filetags are re-used. Secondly, if the parsing of the
file name did not lead to any new file name, the content of the file is analyzed.

You have to adapt the rules in the Python script to meet your requirements.
The default rule-set follows the filename convention described on
http://karl-voit.at/managing-digital-photographs/


:copyright: (c) by Karl Voit
:license: GPL v3 or any later version
:URL: https://github.com/novoid/guess-filename.py
:bugreports: via github or <tools@Karl-Voit.at>


Options:
  -h, --help     show this help message and exit
  -d, --dryrun   enable dryrun mode: just simulate what would happen, do not
                 modify files
  -v, --verbose  enable verbose mode
  -q, --quiet    enable quiet mode
  --version      display version and exit

Related tools and workflows

This tool is part of a tool-set which I use to manage my digital files such as photographs. My work-flows are described in this blog posting you might like to read.

In short:

For tagging, please refer to filetags and its documentation.

See date2name for easily adding ISO time-stamps or date-stamps to files.

For easily naming and tagging files within file browsers that allow integration of external tools, see appendfilename (once more) and filetags.

Moving to the archive folders is done using move2archive.

Having tagged photographs gives you many advantages. For example, I automatically choose my desktop background image according to the current season.

Files containing an ISO time/date-stamp gets indexed by the filename-module of Memacs.

Contribute!

I am looking for your ideas!

If you want to contribute to this cool project, please fork and contribute!