Using Python 3
- Python >= 3.5
- Python Packages
- ruamel.yaml
- click
- pandas
- lark-parser
- attrs
- typing
pip install (--user) git+https://github.com/aslemen/pyksnk
docker run -it aslemen/pyksnk
pip remove pyksnk
Example:
# load the modules
import sys
import pandas as pd
import pyksnk.mordict as md
# load the dictionary file
dic: md.Dictionary
with open("path/to/some_dict.cut") as f:
dic = md.parse(f.name, f.read())
# convert the dictionary to a Pandas DataForm
dic_pd: pd.DataFrame = dic.to_dataframe()
# You can play around with `dic_pd`
# before pushing it back to the original dictionary object `dic`
dic.update_with_dataframe(dic_pd)
# write the modified `dic` out to the STDOUT
dic.dump_mordict(sys.stdout)
pyksnk [command] [subcommand]
Please see the helps.