A python library for converting text to braille.
Project description
TouchMap
TouchMap is a Python library for converting textual data into Braille representations.
Currently, it supports Grade 1 Braille only. Grade 2 support is under active development.
Features
- Converts plain text (including numbers, punctuation, and scientific notation) into Grade 1 Braille.
- Supports both Unicode Braille and binary (dot) representation.
- Handles context-sensitive characters like
",x,*,/, and-. - Graceful handling of unsupported characters.
Installation
pip install touchmap
Usage
Import the Function
from touchmap import text_to_braille
Function Signature
def text_to_braille(text: Any, grade: int = 1, characterError: bool = True, binary: bool = False) -> str:
...
Parameters
| Argument | Data Type | Default Value | Required | Description |
|---|---|---|---|---|
text |
Any |
— | Yes | Input to be converted. Accepts strings, numbers, and booleans. |
grade |
1 or 2 |
1 |
No | Braille grade to use. Currently only 1 is supported. |
characterError |
bool |
True |
No | If True, raises error on unsupported characters; if False, replaces with space. |
binary |
bool |
False |
No | If True, returns binary (6-dot) format; if False, returns Unicode Braille. |
Example
text = "The value is -3.14e+10 and x is not multiplication."
braille = text_to_braille(text)
binary = text_to_braille(text, binary=True)
print(braille)
print(binary)
⠠⠞⠓⠑ ⠧⠁⠇⠥⠑ ⠊⠎ ⠼⠐⠤⠉⠲⠁⠙ ⠐⠦ ⠼⠁⠚⠄⠐⠖⠁⠚ ⠁⠝⠙ ⠭ ⠊⠎ ⠝⠕⠞ ⠍⠥⠇⠞⠊⠏⠇⠊⠉⠁⠞⠊⠕⠝⠲
000001011110101100100100000000101011100000101010100011100100000000011000011010000000010111010000001001110000001110100000110100000000010000110110000000010111100000010110000100010000101110100000010110000000100000110110110100000000110011000000011000011010000000110110100110011110000000110010100011101010011110011000111010101010011000110000100000011110011000100110110110001110
Roadmap
- Implementation of Grade 2 Braille conversion.
- Development of a web API for trying TouchMap online.
Meta
License: Apache License 2.0
Author: Yajat Pathak
By Kayak for Braillent
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
touchmap-0.2.0.tar.gz
(10.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
touchmap-0.2.0-py3-none-any.whl
(11.3 kB
view details)
File details
Details for the file touchmap-0.2.0.tar.gz.
File metadata
- Download URL: touchmap-0.2.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d139c2700b33c2bef0d7042d9e5ad1780bc27532f0c2f6a591ba712635790566
|
|
| MD5 |
68b7637e0c3511e3d027e79083c190e4
|
|
| BLAKE2b-256 |
968a2e58400a3b54026984812b2769314f5a125a91c8220d9b477333983f5f96
|
File details
Details for the file touchmap-0.2.0-py3-none-any.whl.
File metadata
- Download URL: touchmap-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
deda197192c9ebf3449c50267db5051fbadea20190e8372007d8bb65163aaaf3
|
|
| MD5 |
a1ec917ec445de06ee81636bb18d97d5
|
|
| BLAKE2b-256 |
161d0c044e7c58a2a6b0b4c8fc7ba3b7724e0bdc27e10bbe182503046f874961
|