Showing posts with label braillebase. Show all posts
Showing posts with label braillebase. Show all posts

Tuesday, September 8, 2026

braillebaseio

import json
import csv
import xml.etree.ElementTree as ET

# 0
def read_file(path: str) -> list:
    with open(path, "r", encoding="utf-8") as f:
        return read_string(f.read())

# 1
def read_string(data: str) -> list:
    data = data.strip()

    if data.startswith("[") or data.startswith("{"):
        return _from_json(data)

    if data.startswith("<?xml") or data.startswith("<"):
        return _from_xml(data)

    return _from_csv(data)


def _from_json(data: str):
    raw = json.loads(data)
    result = []

    for item in raw:
        braille_raw = item.get("braille")

        if isinstance(braille_raw, str):
            braille = [b.strip() for b in braille_raw.split(",")]
        else:
            braille = braille_raw

        result.append((
            item.get("letter"),
            braille,
            int(item.get("pattern"))
        ))

    return result


def _from_csv(data: str):
    result = []
    reader = csv.reader(data.splitlines())

    for row in reader:
        if len(row) < 3:
            continue

        letter, braille_raw, pattern = row
        braille = [b.strip() for b in braille_raw.split(",")]

        result.append((
            letter,
            braille,
            int(pattern)
        ))

    return result


def _from_xml(data: str):
    root = ET.fromstring(data)
    result = []

    for item in root.findall("item"):
        letter = item.findtext("letter")
        braille_raw = item.findtext("braille")
        pattern = item.findtext("pattern")

        braille = [b.strip() for b in braille_raw.split(",")]

        result.append((
            letter,
            braille,
            int(pattern)
        ))

    return result



LICENSE


braillebaseio — CC0 1.0 Universal


This software is released under the Creative Commons Zero v1.0 Universal (CC0 1.0) license.


To the extent possible under law, the author has waived all copyright and related or neighboring rights to this work.

You may copy, modify, distribute, and use this software for any purpose, including commercial purposes, without asking permission.


Full legal text:

https://creativecommons.org/publicdomain/zero/1.0/



README


🙏 Thanks

This project exists thanks to the support, collaboration, and tools provided by many people and communities.

My sincere appreciation goes to:

Microsoft – Copilot

  • For providing an accessible AI assistant that played a fundamental role in the growth and refinement of this system.

Microsoft – Visual Studio Code

  • For offering a powerful, free, and accessible development environment.

Python Community

  • For maintaining a free, open, and expressive programming language that makes projects like this possible.

Developers Who Came Before

  • For building the foundations, tools, and knowledge that allow new accessibility technologies to exist today.

Nagao Yuji

  • For creating and maintaining BrailleBase, designing its architecture, and developing its core features with a focus on accessibility and education.


pyproject.toml

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "braillebaseio"
version = "1.0.3"
description = "Universal Braille Data Loader: Reads CSV, XML, or JSON sheets and converts them into a unified structure containing Letter, Braille cell, and Pattern classification."
authors = [
    { name = "Nagao Yuji" }
]
readme = "README.md"
license = { text = "CC0-1.0" }
requires-python = ">=3.6"
keywords = ["braille", "csv", "json", "xml", "braillebase", "blind", "education", "loader"]

[project.urls]
Homepage = "https://github.com/DukaCrazy/braillebaseio"
Documentation = "https://github.com/DukaCrazy/braillebaseio"
Source = "https://github.com/DukaCrazy/braillebaseio"

Saturday, June 27, 2026

newsletters - What is BrailleBase #0001

BrailleBase

What is BrailleBase

  • BrailleBase is an algorithm that translates characters into Braille.
  • Today, each country uses different Braille rules, and there is no universal standard for developers. This makes it almost impossible to create tools that are compatible with each other.
  • BrailleBase creates a universal layer that standardizes the logic, allowing any tool — from screen readers to Braille embossers — to speak the same language.
  • As a result, learning languages, accessing culture, and integrating devices becomes more accessible for millions of people.

Beyond translation

  • BrailleBase provides the number of dots in each Braille symbol. Example: the character '⠼', which indicates that a number follows, contains 4 dots.

  • It also provides the numeric position of each dot and the corresponding binary pattern.  For '⠼', the positions are 3‑4‑5‑6 and the binary is 001111.

  • These data can be accessed directly through methods that return dot counts, positions, binary patterns, and other metadata.

  • For integration with other tools, the output methods generate a complete map of each symbol in formats such as JSON, XML, YAML, and more.

  • The library is still under development, so method signatures may change. We are working to release a stable version as soon as possible.

Purpose of BrailleBase

Standardized Technology

  • Many companies and developers who want to create tools and technologies for blind people face a major barrier: integrating their microsystems with other equipment.
  • BrailleBase is the first library that combines translation, complete metadata, and multiple output formats without external dependencies.

Challenges to Be Addressed

  • Many countries do not have a well‑structured Braille system or documented rules.
  • Understanding these rules, standardizing them, and converting them into a base algorithm usable by subclasses is one of the biggest challenges.
  • Presenting BrailleBase to companies in the accessibility sector is another area we need to improve, especially in communicating the value of the tool.
  • It is also essential to produce educational material and clear documentation, ensuring that both beginners and experienced developers can use BrailleBase without difficulty.

Final Statement

  • This is the first official text of the BrailleBase tool.
  • The system currently includes the Japanese, Portuguese, Arabic, and English alphabets.
  • All letters have been individually verified, but the second‑level rules are still under development.
  • There is still no support for full‑word translation, but this feature is already planned.
  • We are preparing a draft of the Pinyin class.
  • Once the English documentation is completed, the Pinyin class finalized, and the known bugs fixed, we will release the first usable version of the package.
  • From that release onward, the method signatures will become stable, ensuring that updates do not break dependent applications.
  • We do not use external dependencies beyond those provided by default in each programming language.
  • The classes braille, braillebase, braillebasejapanese, braillebaseportuguese, braillebasearabic, and braillebaseenglish have (or will have) CC0, MIT, or Apache 2.0 licenses.

Get in touch through GitHub: https://github.com/DukaCrazy

My name is Duka — and if a project isn’t crazy enough to change the world, it’s probably not mine.

  • 2026/06/24

braillebaseuniversalset

  class BrailleBaseBniversalSet : def braille_base_universal_set (): #LOWER return [[ "a" , [ "⠁...