https://github.com/vedrane/betacode-parser
A fully implemented Beta Code parser
https://github.com/vedrane/betacode-parser
ancient-greek archaeology betacode ccat coptic digital-humanities greek hebrew humanities python thesaurus-linguae-graecae tlg transcription
Last synced: 19 days ago
JSON representation
A fully implemented Beta Code parser
- Host: GitHub
- URL: https://github.com/vedrane/betacode-parser
- Owner: vedrane
- License: mit
- Created: 2025-04-02T15:28:33.000Z (29 days ago)
- Default Branch: main
- Last Pushed: 2025-04-10T00:01:23.000Z (22 days ago)
- Last Synced: 2025-04-12T13:12:34.111Z (19 days ago)
- Topics: ancient-greek, archaeology, betacode, ccat, coptic, digital-humanities, greek, hebrew, humanities, python, thesaurus-linguae-graecae, tlg, transcription
- Language: Python
- Homepage: https://pypi.org/project/betacode-parser/
- Size: 22.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# betacode-parser
### Introduction
betacode-parser is a Python package that allows one to convert to and from Beta Code for Greek, Coptic, and Hebrew. It is implemented according to the standard of *Thesaurus Linguae Graecae* (TLG) as seen in [this manual](https://stephanus.tlg.uci.edu/encoding/BCM.pdf). In addition, the Hebrew conversion also supports the older CCAT (Center for Computer Analysis of Text, University of Pennsylvania) standard as seen on [this webpage](https://ccat.sas.upenn.edu/beta/key.html). This project is inspired by the PyPI package [`betacode`](https://pypi.org/project/betacode/), which only implemented conversion for Greek.
### Installation
To install, run `pip install betacode-parser`. Import in projects like this:
```python
from betacode_parser import *
```
Alternatively, you can import the following functions separately: `beta_to_coptic`, `coptic_to_beta`, `beta_to_greek`, `greek_to_beta`, `beta_to_hebrew`, and `hebrew_to_beta`.
### Usage
```python
# Greek
print(beta_to_greek("*A)RIS1TOTE/LHS")) # Ἀριστοτέλης
print(greek_to_beta("Ἀριστοτέλης")) # *A)RIS1TOTE/LHS2# Coptic
print(beta_to_coptic("*PTOLEMAIOS")) # Ⲡⲧⲟⲗⲉⲙⲁⲓⲟⲥ
print(coptic_to_beta("Ⲡⲧⲟⲗⲉⲙⲁⲓⲟⲥ")) # *PTOLEMAIOS# Hebrew
# Modern (TLG) Standard
print(beta_to_hebrew("ysrAl")) # ישראל
print(hebrew_to_beta("ישראל")) # ysrAl
# Old (CCAT) Standard
print(beta_to_hebrew("Y&R)L", True)) # ישׂראל
print(hebrew_to_beta("ישראל", True)) # Y#R)L
```
You can see how to transcribe to and from Beta Code manually in the TLG manual and CCAT webpage.
### Development
Contributions are welcome.