Skip to main content

Betacode to Unicode converter.

Project description

Build Status Coverage Status

betacode

Convert betacode to unicode and vice-versa easily. Tested on python 3.4, 3.5, and 3.6.

Install

Installation is easy. Use pip or your preferred method to download from PyPI.

pip install betacode

Usage

Note that in all examples, strings are unicode encoded.

Betacode to unicode

import betacode.conv

beta = 'analabo/ntes de\ kaq\' e(/kaston'
betacode.conv.beta_to_uni(beta) # αναλαβόντες δὲ καθ᾽ ἕκαστον

Note that polytonic accent marks will be used, and not monotonic accent marks. Both are de jure equivalent in Greece, and betacode was initially developed to encode classic works. In other words, the oxeîa will be used rather than tónos. The oxeîa form can be converted to the modern accent form through unicode normalization which is easy in python.

import unicodedata

import betacode.conv

beta = 'analabo/ntes de\ kaq\' e(/kaston'
uni = betacode.conv.beta_to_uni(beta) # αναλαβόντες δὲ καθ᾽ ἕκαστον

unicodedata.normalize('NFC', uni) # Use the appropriate normalization ('NFC', 'NFKC', etc).

Unicode to betacode

import betacode.conv

uni = 'αναλαβόντες δὲ καθ᾽ ἕκαστον'
betacode.conv.uni_to_beta(uni) # analabo/ntes de\ kaq\' e(/kaston

The unicode text can use polytonic (oxeîa) or monotonic (tónos) accent marks and converesion will still be correct.

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

betacode-0.1.4.tar.gz (5.4 kB view details)

Uploaded Source

File details

Details for the file betacode-0.1.4.tar.gz.

File metadata

  • Download URL: betacode-0.1.4.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for betacode-0.1.4.tar.gz
Algorithm Hash digest
SHA256 0c4f64b06b22acbd7ba677f45392859fd49b120a3c328fa203de45e785357cfc
MD5 5b3e28cf8e9d33456b66005ca5ab0bc7
BLAKE2b-256 ae917fd47ba3ba4b8394da8a5401109d2e2e5f7a7fee3f75b152ce33844dac55

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page