Braille (6-dot cell patterns) notation and conversion library for Python


In [1]:
import pybrl

In [2]:
print pybrl.braille("braille for python is cool!")


⠃⠗⠁⠊⠇⠇⠑⠀⠋⠕⠗⠀⠏⠽⠞⠓⠕⠝⠀⠊⠎⠀⠉⠕⠕⠇⠮

In [3]:
print pybrl.ascii("⠃⠗⠁⠊⠇⠇⠑⠀⠋⠕⠗⠀⠏⠽⠞⠓⠕⠝⠀⠊⠎⠀⠉⠕⠕⠇⠮")


braille for python is cool!

In [4]:
print ' '.join(pybrl.convert("braille for python is cool!", pybrl.hexcodes, pybrl.asciicodes))


42 52 41 49 4c 4c 45 20 46 4f 52 20 50 59 54 48 4f 4e 20 49 53 20 43 4f 4f 4c 21

In [5]:
d = ['1-2', '1-2-3-5', '1', '2-4', '1-2-3', '1-2-3', '1-5', '', 
     '1-2-4', '1-3-5', '1-2-3-5', '', '1-2-3-4', '1-3-4-5-6', 
     '2-3-4-5', '1-2-5', '1-3-5', '1-3-4-5', '', '2-4', '2-3-4', '', 
     '1-4', '1-3-5', '1-3-5', '1-2-3', '2-3-4-6']

print ''.join(pybrl.dot2braille(d))


⠃⠗⠁⠊⠇⠇⠑⠀⠋⠕⠗⠀⠏⠽⠞⠓⠕⠝⠀⠊⠎⠀⠉⠕⠕⠇⠮

In [6]:
print pybrl.braille("pybrl")


⠏⠽⠃⠗⠇