File organization made easy. HyperTag let's humans intuitively express how they think about their files using tags.
Objective Function: Minimize the time between a thought and access to all your relevant files.
Available on PyPI
$ pip install hypertag
HyperTag offers a slick CLI but more importantly it creates a directory called HyperTagFS
which is a file system based representation of your files and tags using symbolic links and directories.
Directory Import: Import your existing directory hierarchies using $ hypertag import path/to/directory
. HyperTag converts it automatically into a tag hierarchy using metatagging.
Semantic Search (Experimental): Search through all your text documents (yes, even PDF's) content. This function is powered by the awesome Sentence Transformers library. Currently only English is supported.
HyperTag Daemon (Experimental): Monitors HyperTagFS
for user changes. Currently supports file and directory (tag) deletions + directory (name as query) creation with automatic query result population. Also spawns the DaemonService which speeds up semantic search significantly.
Fuzzy Matching Queries: HyperTag uses fuzzy matching to minimize friction in the unlikely case of a typo.
File Type Groups: HyperTag automatically creates folders containing common files (e.g. Images: jpg, png, etc., Documents: txt, pdf, etc., Source Code: py, js, etc.), which can be found in HyperTagFS
.
HyperTag Graph: Quickly get an overview of your HyperTag Graph! HyperTag visualizes the metatag graph on every change and saves it at HyperTagFS/hypertag-graph.pdf
.
Import files with tags inferred from the existing directory hierarchy
$ hypertag import path/to/directory
Manually tag files
$ hypertag tag humans/*.txt with human "Homo Sapiens"
Manually remove tag/s from file/s
$ hypertag untag humans/*.txt with human "Homo Sapiens"
Metatag tag/s to create tag hierarchies
$ hypertag metatag human with animal
Merge all associations (files & tags) of tag A into tag B
$ hypertag merge human into "Homo Sapiens"
Print file names of the resulting set matching the query. Queries are composed of tags and operands. Tags are fuzzy matched for convenience. Nesting is currently not supported, queries are evaluated from left to right
Print paths: $ hypertag query human --path
Print fuzzy matched tag: $ hypertag query man --verbose
Disable fuzzy matching: $ hypertag query human --fuzzy=0
Default operand is AND (intersection):
$ hypertag query human "Homo Sapiens"
is equivalent to $ hypertag query human and "Homo Sapiens"
OR (union):
$ hypertag query human or "Homo Sapiens"
MINUS (difference):
$ hypertag query human minus "Homo Sapiens"
Only indexed files can be searched.
To parse even unparseable PDF's, install tesseract: # pacman -S tesseract tesseract-data-eng
$ hypertag index
Print file names sorted by matching score. Performance benefits greatly from running the HyperTag daemon.
$ hypertag search "your important text query"
$ hypertag tags filename1 filename2
$ hypertag metatags tag1 tag2
$ hypertag show
Print names:
$ hypertag show files
Print paths:
$ hypertag show files --path
Visualize the metatag graph hierarchy (saved at HyperTagFS root)
$ hypertag graph
Specify layout algorithm (default: fruchterman_reingold):
$ hypertag graph --layout=kamada_kawai
Generate file system based representation of your files and tags using symbolic links and directories
$ hypertag mount
Start daemon process with dual function:
- Watch HyperTagFS directory for user changes
- Spawn DaemonService to load and expose model used for semantic search
$ hypertag daemon
Default is the user's home directory
$ hypertag set_hypertagfs_dir path/to/directory
- Python powers HyperTag
- Many other awesome open-source projects make HyperTag possible (listed in
pyproject.toml
) - SQLite3 serves as the meta data storage engine (located at
~/.config/hypertag/hypertag.db
) - Symbolic links are used to create the HyperTagFS directory structure
- Semantic text document search is powered by the awesome DistilBERT
- Clone repo:
$ git clone https://github.com/SeanPedersen/HyperTag.git
$ cd HyperTag/
- Install Poetry
- Install dependencies:
$ poetry install
- Activate virtual environment:
$ poetry shell
- Run all tests:
$ pytest -v
- Run formatter:
$ black hypertag/
- Run linter:
$ flake8
- Run type checking:
$ mypy **/*.py
- Run security checking:
$ bandit --exclude tests/ -r .
- Run HyperTag:
$ python -m hypertag
What is the point of HyperTag's existence?
HyperTag offers many unique features such as the import, semantic search, graphing and fuzzy matching functions that make it very convenient to use. All while HyperTag's code base staying tiny at <1000 LOC in comparison to TMSU (>10,000 LOC) and SuperTag (>25,000 LOC), making it easy to hack on.
This project is partially inspired by these open-source projects: