package metadb
Install
Dune Dependency
Authors
Maintainers
Sources
md5=c3732a371c6372d0f278b741ff86e853
sha512=78733fd0f43bc32f6a7974c517697b667701b1c1c91b6213f0b2542f3b42e557db6f580e01ba380c2980203fc89a9cb356752b807ebe6f4f648a1998aeee896a
doc/metadb/Metadb/index.html
Module Metadb
Source
Metadb
is a library to locally store and manipulate a JSON database of file metadata. A key feature of Metadb is that a user may rename or move files within or between libraries, and Metadb will resolve missing or renamed files according to their MD5 hash. Metadb can also find duplicate files across libraries.
A database is composed of one or more libraries, each of which points to a specific directory in the $HOME
path. A library may have metadata specified by LibData
, such as its version of the type of its entries. Name, path, and metadata of each library is stored as JSON in a configuration file which may be read and written by Make.load_config
and Make.write_config
. For example, such a file may be stored in $HOME/.config/libraries.json
.
Each library assigns a JSON file to each file in its associated directory, for example, consider a library named "documents" that points to a directory ~/Documents/Articles
and suppose the following files are contained in this library:
~/Documents/Articles/
article1.pdf
article2.djvu
path/to/article3.pdf
Then Metadb
will store metadata for each file specified by Metadata
in a hidden directory ./.metadata
: ~/Documents/Articles/.metadata
article1.pdf.json
article2.djvu.json
path/to/article3.pdf.json
The key to an entry or file in a library is always given by its relative path with respect to the library's root path.
A minimal library for manipulating typed representations of paths