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.3.tar.gz (5.3 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for betacode-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4215272bea5c4c52f10cf7fdd77c30d63ee3db56767f65d622b3a3cd319c7cb1
MD5 8d4aeeb5a03385727555a39f2c4eac7e
BLAKE2b-256 b20dedd2eb2a8431b8ddb176bd7490b72e12e791ac1d0ecff7784a005569fde5

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