package metadb

  1. Overview
  2. Docs
A database for storing and managing file metadata in JSON format

Install

Dune Dependency

Authors

Maintainers

Sources

v1.3.1.tar.gz
md5=c3732a371c6372d0f278b741ff86e853
sha512=78733fd0f43bc32f6a7974c517697b667701b1c1c91b6213f0b2542f3b42e557db6f580e01ba380c2980203fc89a9cb356752b807ebe6f4f648a1998aeee896a

doc/metadb/Metadb/index.html

Module MetadbSource

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.

Sourceexception FileExists of Path.root
Sourceexception EntryExists of string * Path.rel
Sourceexception EntryDoesNotExist of string * Path.rel
Sourceexception DirNotEmpty of Path.root
Sourceexception LibraryExists
Sourcemodule Path : module type of Path

A minimal library for manipulating typed representations of paths

Sourcemodule Hash : module type of Hash

This is a wrapper for the standard Digest library.

Sourcemodule Json : module type of Json

This is a wrapper for the Yojson library

Sourcemodule System : module type of System

This is a wrapper for the standard Sys library.

Sourcemodule type Metadata = sig ... end

Metadata to be associated to each file in a library

Sourcemodule type LibData = sig ... end

Metadata associated to each library

Sourcemodule Make (D : Metadata) (LD : LibData) : sig ... end

Make a Metadb database

OCaml

Innovation. Community. Security.