Converts Greek Beta Code to Greek characters and vice versa
Project description
Beta Code Converter for Python
Converts Greek Beta Code to Greek characters and vice versa.
Installation
pip install beta-code
(See project on PyPI)
Usage
import beta_code
beta_code.greek_to_beta_code(u'χαῖρε ὦ κόσμε')
# => 'xai=re w)= ko/sme'
beta_code.beta_code_to_greek(u'mh=nin a)/eide qea\\ *phlhi+a/dew *)axilh=os')
# => 'μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος'
With additional mappings
beta_code.beta_code_to_greek(u'f2a/nac', custom_map={ u'f2': u'ϝ' })
# => 'ϝάναξ'
Tests
python -m unittest tests/test_beta_code.py
Updating JSON
git subtree pull --prefix beta_code/vendor/beta-code-json/ https://github.com/perseids-tools/beta-code-json master --squash
In the case of a merge conflict:
git checkout --theirs vendor/beta-code-json/
git add vendor/beta-code-json
git commit
Publishing
- Install dependencies:
python3 -m venv venv
. ./venv/bin/activate
pip3 install -r requirements.txt
- Bump version in
setup.py
- Commit and push to GitHub
- On GitHub, create a new release
- Run
pip3 install wheel
- Run
python3 setup.py sdist bdist_wheel
- Run
python3 -m twine upload dist/*
Notes
For the mappings between Beta Code and Unicode, see https://github.com/perseids-tools/beta-code-json.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
beta_code-1.1.0.tar.gz
(9.2 kB
view hashes)
Built Distribution
Close
Hashes for beta_code-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95cb07e4a2ea49bf042c49f6a6107943bf0e156868cfd269c35fff8acd1bcd54 |
|
MD5 | 07ed0c10b40254a453349944534daaca |
|
BLAKE2b-256 | 3821d59dca365bb5c2a9b501a6db1e60a115cc34ebf7daae6ca476fc338bbbae |