Menu

Tree [e9e98b] master /
 History

HTTPS access


File Date Author Commit
 doc 2016-05-21 Saeed Rasooli Saeed Rasooli [eea089] remove psyco stuff, psyco is discontinued and h...
 pyglossary 2016-06-27 Saeed Rasooli Saeed Rasooli [e9e98b] BGL reader: add support for Python < 3.5, with ...
 res 2016-04-21 Saeed Rasooli Saeed Rasooli [d51aac] ui_gtk_new (pygi): 'Convert' tab is complete, '...
 scripts 2016-04-26 Saeed Rasooli Saeed Rasooli [54e02d] add scripts/dump.py
 ui 2016-06-27 Saeed Rasooli Saeed Rasooli [0e25c4] ui_tk.py: set window icon to a colorful icon, t...
 .gitignore 2013-01-28 Saeed Rasooli Saeed Rasooli [963937] clean .gitignore
 AUTHORS 2013-01-31 Saeed Rasooli Saeed Rasooli [2cb5b4] update AUTHORS
 COPYING 2011-03-02 Saeed Rasooli Saeed Rasooli [2b1a4d] update and clean AUTHORS file
 README.md 2016-06-27 Saeed Rasooli Saeed Rasooli [9ac520] README.md: fix package names for tkinter in Deb...
 __init__.py 2013-01-14 Saeed Rasooli Saeed Rasooli [3c21d6] change directory structure (commits by Thomas V...
 about 2015-09-17 Saeed Rasooli Saeed Rasooli [ce4b9d] update about text
 config.json 2016-05-22 Saeed Rasooli Saeed Rasooli [11f0ec] migrate config
 help 2016-06-09 Saeed Rasooli Saeed Rasooli [82723f] help: fix indentations, rename Usage section in...
 license 2012-10-08 Saeed Rasooli Saeed Rasooli [1a5e4f] read aboutText and licenseText from files
 pyglossary.desktop 2014-04-18 Saeed Rasooli Saeed Rasooli [63f1bb] add xdg-open line to .desktop file
 pyglossary.pyw 2016-06-27 Saeed Rasooli Saeed Rasooli [698bc7] fix minor bug in pyglossary.pyw: remove gtk_new...
 pyglossary.spec 2013-01-14 Saeed Rasooli Saeed Rasooli [3c21d6] change directory structure (commits by Thomas V...
 setup.py 2016-06-18 Saeed Rasooli Saeed Rasooli [84b91d] bug fix in setup.py: add plugin_lib directory

Read Me

PyGlossary

PyGlossary is a tool for converting dictionary files aka glossaries,
from/to various formats used by different dictionary applications

Screenshots

Linux - (New) Gtk3-based intreface


Windows - Tkinter-based interface


Linux - command line interface

Supported formats

Format Extension Read Write
ABBYY Lingvo DSL .dsl X
AppleDict Source .xml X
Babylon .bgl X
Babylon Source .gls X
CSV .csv X X
DictionaryForMIDs X X
DICTD dictionary server .index X X
Editable Linked List of Entries .edlin X X
FreeDict .tei X
Gettext Source .po X X
Lingoes Source (LDF) .ldf X X
Octopus MDict .mdx X
Octopus MDict Source .txt X X
Omnidic X X
Sdictionary Binary .dct X
Sdictionary Source .sdct X
SQL .sql X
SQLite 3 .sqlite X X
StarDict .ifo X X
Tabfile .txt, .dic X X
TreeDict X
XDXF .xdxf X
xFarDic .xdb X X

Requirements

PyGlossary uses Python 3.x, and works in practically all operating
systems. While primarilly designed for GNU/Linux, it works on Windows,
Mac OS X and other Unix-based operating systems as well.

As shown in the screenshots, there are multiple User Interface types,
ie. multiple ways to use the program.

  • Gtk3-based interface, uses PyGI (Python Gobject Introspection)
    You can install it on:

    • Debian: apt-get install python3-gi
    • openSUSE: zypper install python3-gobject
    • Fedora: yum install python3-gobject
    • Archlinux: pacman -S python-gobject
  • Tkinter-based interface, works in the lack of Gtk. Specially on
    Windows where Tkinter library is installed with the Python itself.
    You can also install it on:

  • Command-line interface, works in all operating systems without
    any specific requirements, just type:

    python3 pyglossary.pyw --help

    You may have to give --no-progress-bar option in Windows when
    converting glossaries (becouse the progress bar does not work
    properly in Windows command window)

When you run the program without any command line arguments or options,
PyGlossary tries to find PyGI, if it's installed, opens the Gtk3-based
interface, if it's not, tries to find Tkinter and open the Tkinter-based
interface. And exits with an error if neither are installed.

But you can explicitly determine the user interface type using --ui,
for example:

python3 pyglossary.pyw --ui=gtk

python3 pyglossary.pyw --ui=tk

Format-specific Requirements

  • Writing to AppleDict

    sudo easy_install3 beautifulsoup4 html5lib

  • Reading from Octopus Mdict (MDX)

    sudo pip3 install python-lzo

Other Requirements for Mac OS X

If you want to convert glossaries into AppleDict format on Mac OS X,
you also need:

HOWTOs

Convert Babylon (bgl) to Mac OS X dictionary

Let's assume the Babylon dict is at
~/Documents/Duden_Synonym/Duden_Synonym.BGL:

cd ~/Documents/Duden_Synonym/
python3 ~/Software/pyglossary/pyglossary.pyw --read-options=resPath=OtherResources --write-format=AppleDict Duden_Synonym.BGL Duden_Synonym.xml
make
make install

Launch Dictionary.app and test.

Convert Octopus Mdict to Mac OS X dictionary

Let's assume the MDict dict is at
~/Documents/Duden-Oxford/Duden-Oxford DEED ver.20110408.mdx.

Run the following command:

cd ~/Documents/Duden-Oxford/
python3 ~/Software/pyglossary/pyglossary.pyw --read-options=resPath=OtherResources --write-format=AppleDict "Duden-Oxford DEED ver.20110408.mdx" "Duden-Oxford DEED ver.20110408.xml"
make
make install

Launch Dictionary.app and test.

Let's assume the MDict dict is at ~/Downloads/oald8/oald8.mdx, along
with the image/audio resources file oald8.mdd.

Run the following commands: :

cd ~/Downloads/oald8/
python3 ~/Software/pyglossary/pyglossary.pyw --read-options=resPath=OtherResources --write-format=AppleDict oald8.mdx oald8.xml

This extracts dictionary into oald8.xml and data resources into folder
OtherResources. Hyperlinks use relative path. :

sed -i "" 's:src="/:src=":g' oald8.xml

Convert audio file from SPX format to WAV format. You need package
speex from MacPorts :

find OtherResources -name "*.spx" -execdir sh -c 'spx={};speexdec $spx  ${spx%.*}.wav' \;
sed -i "" 's|sound://\([/_a-zA-Z0-9]*\).spx|\1.wav|g' oald8.xml

But be warned that the decoded WAVE audio can consume \~5 times more disk
space!

Compile and install. :

make
make install

Launch Dictionary.app and test.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.