A script to manage and tag files using symlinks
pip install linky-db==1.5.0
linky
An databaseless file tagger using symlinks.
This allows for a file to have multiple tags without agonizing about folder structure.
If videos are your thing here you go.
This requires at least python 3.6 and pip.
Before files can be tagged, a directory first has to be initialized for use with linky
.
pip install linky-db
Navigate to directory for initialization
Can be your folder with videos, music, books, etc.
cd my_link_root
Write a configuration file
You can modify it later of course.
See categories.schema.yaml for a description thereof and
categories.yaml for an example
mkdir .linky
echo "
Tags:
default: Untagged
extensible: True
exclusive_default: True
tags:
- Action
- Fantasy
- Romance
- Sci-Fi
- Zombie
" > .linky/categories.yaml
linky init .
A .base directory will be created and everything previously in the directory, will be moved into the base directory. It will contain all the data. The directory containing .base and all other data is called the linked root.
See How and the docs for more information.
You can now start:
linky help
, linky help add
, linky help ...
linky tag -t Category/Tag file_in_your_root
linky add fileOrDir_outside_your_root
linky move old/path/old_name new/path/new_name
linky
!Programs often use databases to keep meta information about files. These databases:
All of which make migrations from program to program difficult. Now, of course this program will suffer from that particular problem (migration) too, however it will be possible to manually maintain the folder structure and links mentioned below.
Consider this existing directory. Lines prefixed by #
are comments about the item below them!
# The linked root
.
### Base folder that contains the data
├── .base
####### Configuration folder
│ ├── .linky
│ │ └── categories.yaml
│ ├── Last Christmas (2019)
│ │ ├── Last.Christmas.2019.4k.HEVC.YIFY.mkv
│ │ └── subs
│ │ ├── cmn.srt
│ │ ├── de.srt
│ │ ├── eng.srt
│ │ └── nl.srt
│ └── The Hurt Locker (2008)
│ └── The.Hurt.Locker.2008.1080p.BRrip.mkv
### A category (or tag group) folder in the linked root
├── Actors
####### A tag folder
│ ├── Anthony Mackie
│ │ └── The Hurt Locker (2008)
│ │ └── The.Hurt.Locker.2008.1080p.BRrip.mkv -> ../../../.base/The Hurt Locker (2008)/The.Hurt.Locker.2008.1080p.BRrip.mkv
####### Another tag folder
│ ├── Emilia Clarke
│ │ └── Last Christmas (2019)
│ │ ├── Last.Christmas.2019.4k.HEVC.YIFY.mkv -> ../../../.base/Last Christmas (2019)/Last.Christmas.2019.4k.HEVC.YIFY.mkv
│ │ └── subs
│ │ ├── cmn.srt -> ../../../../.base/Last Christmas (2019)/subs/cmn.srt
│ │ ├── de.srt -> ../../../../.base/Last Christmas (2019)/subs/de.srt
│ │ ├── eng.srt -> ../../../../.base/Last Christmas (2019)/subs/eng.srt
│ │ └── nl.srt -> ../../../../.base/Last Christmas (2019)/subs/nl.srt
│ ├── Emma Thompson
│ │ └── Last Christmas (2019)
│ │ ├── Last.Christmas.2019.4k.HEVC.YIFY.mkv -> ../../../.base/Last Christmas (2019)/Last.Christmas.2019.4k.HEVC.YIFY.mkv
│ │ └── subs
│ │ ├── cmn.srt -> ../../../../.base/Last Christmas (2019)/subs/cmn.srt
│ │ ├── de.srt -> ../../../../.base/Last Christmas (2019)/subs/de.srt
│ │ ├── eng.srt -> ../../../../.base/Last Christmas (2019)/subs/eng.srt
│ │ └── nl.srt -> ../../../../.base/Last Christmas (2019)/subs/nl.srt
│ ├── Guy Pearce
│ │ └── The Hurt Locker (2008)
│ │ └── The.Hurt.Locker.2008.1080p.BRrip.mkv -> ../../../.base/The Hurt Locker (2008)/The.Hurt.Locker.2008.1080p.BRrip.mkv
│ ├── Jeremy Renner
│ │ └── The Hurt Locker (2008)
│ │ └── The.Hurt.Locker.2008.1080p.BRrip.mkv -> ../../../.base/The Hurt Locker (2008)/The.Hurt.Locker.2008.1080p.BRrip.mkv
│ └── Madison Ingoldsby
│ └── Last Christmas (2019)
│ ├── Last.Christmas.2019.4k.HEVC.YIFY.mkv -> ../../../.base/Last Christmas (2019)/Last.Christmas.2019.4k.HEVC.YIFY.mkv
│ └── subs
│ ├── cmn.srt -> ../../../../.base/Last Christmas (2019)/subs/cmn.srt
│ ├── de.srt -> ../../../../.base/Last Christmas (2019)/subs/de.srt
│ ├── eng.srt -> ../../../../.base/Last Christmas (2019)/subs/eng.srt
│ └── nl.srt -> ../../../../.base/Last Christmas (2019)/subs/nl.srt
└── Watched
├── Unwatched
│ └── Last Christmas (2019)
│ ├── Last.Christmas.2019.4k.HEVC.YIFY.mkv -> ../../../.base/Last Christmas (2019)/Last.Christmas.2019.4k.HEVC.YIFY.mkv
│ └── subs
│ ├── cmn.srt -> ../../../../.base/Last Christmas (2019)/subs/cmn.srt
│ ├── de.srt -> ../../../../.base/Last Christmas (2019)/subs/de.srt
│ ├── eng.srt -> ../../../../.base/Last Christmas (2019)/subs/eng.srt
│ └── nl.srt -> ../../../../.base/Last Christmas (2019)/subs/nl.srt
└── Watched
└── The Hurt Locker (2008)
└── The.Hurt.Locker.2008.1080p.BRrip.mkv -> ../../../.base/The Hurt Locker (2008)/The.Hurt.Locker.2008.1080p.BRrip.mkv
linky works by keeping all files in a common, hidden folder called .base
.
All siblings of in the folder tree will link their files to the base folder.
It is thus possible to have a file in multiple categories like
Watched, Rating, Size, Actors etc.
For more information on the nomenclature and inner workings.
See HACKING.md
The following are semantic filesystems that fulfill very similar functions. Most use separate database files, which is why I don't use them, but they might very well be useful to you!
First and formost to all the open source devs who made this possible.
pip
for the package hostinggitlab
for the code hosting and CI