将希腊beta代码转换为希腊字符,反之亦然
beta-code的Python项目详细描述
python的beta代码转换器
概述
将希腊测试码转换为希腊字符,反之亦然。
安装
pip install beta_code
用法
importbeta_codebeta_code.greek_to_beta_code('χαῖρε ὦ κόσμε')# => 'xai=re w)= ko/sme'beta_code.beta_code_to_greek('mh=nin a)/eide qea\\ *phlhi+a/dew *)axilh=os')# => 'μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος'
测试
python -m unittest tests/test_beta_code.py
在python 2中
cd tests/ && python -m unittest test_beta_code
更新json
git subtree pull --prefix beta_code/vendor/beta-code-json/ https://github.com/zfletch/beta-code-json master --squash
在合并冲突的情况下:
git checkout --theirs vendor/beta-code-json/ git add vendor/beta-code-json git commit
发布
- 安装依赖项:
python3 -m pip install --user --upgrade setuptools wheel python3 -m pip install --user --upgrade twine
- 在
setup.py
中的凹凸版本
- 提交并推送到github
- 在github上,创建一个新版本
- 运行
python3 setup.py sdist bdist_wheel
- 运行
twine upload dist/*
注释
有关beta代码和unicode之间的映射,请参见https://github.com/zfletch/beta-code-json。