# tag (function) ∞

tag(log, filepath, tags=False, rating=False, wherefrom=False)[source]

Key Arguments

• log – logger

• filepath – the path to the file needing tagged

• tags – comma or space-separated string, or list of tags. Use False to leave file tags as they are. Use “” or [] to remove tags. Default False.

• rating – a rating to add to the file. Use 0 to remove rating or False to leave file rating as it is. Default False.

• wherefrom – add a URL to indicate where the file come from. Use False to leave file location as it is. Use “” to remove location. Default False.

Return

• None

Usage

To add any combination of tags, rating and a source URL to a file on macOS, use the following:

from fundamentals.files.tag import tag
tag(
log=log,
filepath="/path/to/my.file",
tags="test,tags, fundamentals",
rating=3,
wherefrom="http://www.thespacedoctor.co.uk"
)