readmdict (simple repacking of readmdict in mdict-analysis)
Project description
readmdict
Read mdx/mdd files (repacking of readmdict from mdict-analysis)
This is a repacking of readmdict.py
in https://github.com/csarron/mdict-analysis. All credit goes to the original author(s).
Installation
pip install readmdict
# or poetry add readmdict
Usage
Command line
- Browse a mdx or mdd file and print its meta information
readmdict
or
python -m readmdict
- Print meta info of a file
file.mdx
readmdict file.mdx
or
python -m readmdict file.mdx
- Print a short summary
readmdict -h
or
python -m readmdict -h
In Python code
from readmdict import MDX, MDD
filename = "some.mdx"
headwords = [*MDX(filename)]
print(headwods[:10]) # fisrt 10 in bytes format
for hdw in headwods[:10]:
print(hdw.decode()) # fisrt 10 in string format
items = [*MDX(filename).items()
for key, val in items[:10]:
print(key.decode(), val.decode()) # first 10 entries
Optional python-lzo
If python-lzo
is not present, you' ll see "LZO compression support is not available" when running readmdict
. Should this bother you, install python-lzo
.
pip install python-lzo
# or poerty add python-lzo
In Windows without a functioning C++ environment, you won't be able to install python-lzo
via pip
. Head to
https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-lzo. Download and install python-lzo
whl for your python version.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
readmdict-0.1.0.tar.gz
(15.7 kB
view hashes)
Built Distribution
readmdict-0.1.0-py3-none-any.whl
(16.7 kB
view hashes)
Close
Hashes for readmdict-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 309d675a03063de9a6207b26a39a56c9bf38f417e36fc67adb9e28ebdc7dd9a5 |
|
MD5 | e2abafa359fc3dadcebaa6eccabeb4ca |
|
BLAKE2b-256 | f70d2da9f9625edd359cdef4c964806d64d21b2ba680741a9a795f16bfdff0c9 |