an attempt a creating a Zettelkasten management software inspired by notmuch
fix but uid instead of struid
2ea2fdeeec51 draft — xaltsc 5 months ago
remove timestamps and expose more directories via _get_config
ccc99cecb90c draft — xaltsc 6 months ago
add sorting and limiting the cardinality of the subset queried



Propositions for a better name are welcome.

Documentation Status


Xettel (for Xapian Zettel) is an attempt at creating a Zettelkasten using Xapian as the backend for searching and indexing. It is heavily inspired by notmuch. One of the main goals of Xettel is to be agnostic regarding the format you may wish to store your Zettelkasten. My own implementation, once redered, looks like below.

screenshot of my Zettelkasten

Using graphviz, xettel is able to produce a map of the Zettelkasten. Zettelkasten map


Usage: xettel [OPTIONS] COMMAND [ARGS]...

  -c, --config TEXT  config file
  -d, --dir TEXT     Zettelkasten directory
  --help             Show this message and exit.

  count     count zettels matching query
  edit      Edit zettel matching query.
  export    export the Zettelkasten to html
  genmap    generate a map of the zettelkasten
  health    check the health of the zettelkasten
  new       Create a new zettel
  search    search in the database
  updatedb  update the db from the zettelkasten folder

#Overview of code

The code is organised in such a fashion that the user may overload the default settings by defining new classes in the subfolder impl of the xettel config directory. All python files located within this folder are imported at launch. Classes defining Zettels must inherit from (a subclass of) ZettelAbstract or ZettelFile and they must be registered using the @register_Z(name) decorator in order to be acknowledged by xettel. Likewise, classes defining Zettelkasten must inherit from (a subclass of) ZettelkastenAbstract or Zettelkasten and be registered using the @register_ZK(name) decorator. Names must match if they are to be used together. The classes used may then be specified in the config file. See the files in the doc subfolder for examples. The default config path is ~/.config/xettel.

#Zettels and Zettelkästen


In this module are defined abstractions for Zettels and Zettelkästen to build upon.

The class ZettelkastenAbstract defines a mutable mapping that is used to store Zettels and provides additional methods to construct the graph properties as Zettels get added to the Zettelkasten

The class ZettelAbstract provides an abstract class for Zettels. All classes defining Zettels must inherit from this class. It defines the basic behaviour expected from a Zettel.


The class Zettelkasten provides an abstraction for a Zettelkasten stored in a folder. It may be used as is as it can store the subclass of ZettelFile that may be used for Zettels in the folder.


The class ZettelFile provides an abstraction for Zettels that are stored as files. Concrete Zettel classes should inherit from this class as it provides expected way to store them with Xapian.

#Interface to xapian

Means to access the xapian database are define in the zxapian module.

#Command line interface

Commands are defined in the file and the xettel.ui subpackage.