SDpy is a TUI application for querying StarDict dictionaries.
SDpy uses the Python3, and following libraries:
This project also uses a scroll widget from stig project (included in the sources).
Preferred way for installation is to use virtualenv (or any other virtualenv managers), i.e:
$ python -m venv venv
$ . venv/bin/activate
(venv) $ git clone https://github.com/gryf/sdpy
(venv) $ cd sdpy
(venv) $ pip install .
Or via pip:
$ git clone https://github.com/gryf/sdpy
$ cd sdpy
$ pip install --user .
Executable sdpy
should be now available in the $PATH
.
Config file sdpy.conf
will be looked in $XDG_CONFIG_HOME
, which usually
means ~/.config
. Config is very simple:
[DEFAULT]
basedir = /usr/share/stardict/dic
use-section-name = false
[dict.1]
filebase = dictd_www.freedict.de_eng-spa
name = Freedict English-Spanish
[dict.2]
filebase = quick_english-japanese
name = Quick English-Japanese
find-recursively-dir =
Where
basedir
- optional path to the dictionary files, saves typing whole pathuse-section-name
- false by default, forces sections name to be used instead of name fieldfind-recursively-dir
- instead of manually adding dicts one by one, scan provided directory for dictionary filesfilebase
- mandatory filename of the database (without extensions like.idx
,.dict
,.dict.dz
,.ifo
)name
- optional name of the dictionary. If omitted, name will be obtained form dictionary.ifo
filebookname
field
Sections can be named whatever you want, it doesn't matter, and will be used
instead of provided (or not) name only if use-section-name
is set to true.
You can use filebase
as relative path to the global basedir
or local
basedir
placed in each section or even provide basedir for selected
sections.
Note, that section order determine order of displayed definitions on the definitions view. Automatically scanned directory doesn't guarantee the order. Also note, that adding many dictionaries will increase startup time and will have impact on searching for the terms.
This work is licensed on GPL3 license. See LICENSE file for details.