Library of Congress script transliterator.

scossu 2cf7352335 Use explicit JSON body. 5 maanden geleden
doc d758e8c765 Merge branch 'main' into hebrew 5 maanden geleden
ext dae54334a7 Add Arabic transliteration via 3d party. 1 jaar geleden
legacy fe42e40f4e Korean (#48) 7 maanden geleden
scriptshifter 2cf7352335 Use explicit JSON body. 5 maanden geleden
tests e23466fd75 Add Hebrew test strings. 5 maanden geleden
.gitignore 45beb9b314 Ignore .bas files. 1 jaar geleden
.gitmodules dae54334a7 Add Arabic transliteration via 3d party. 1 jaar geleden
Dockerfile 07aafd5ccb Dummy change. 1 jaar geleden
LICENSE 20cb85dad1 Initial commit 1 jaar geleden
NOTES.md 58cd0be0fd Rebrand to ScriptShifter. 1 jaar geleden
README.md a1b95dd74c Several Hebrew and general changes: 7 maanden geleden
TODO.md dae54334a7 Add Arabic transliteration via 3d party. 1 jaar geleden
entrypoint.sh 58cd0be0fd Rebrand to ScriptShifter. 1 jaar geleden
example.env a1b95dd74c Several Hebrew and general changes: 7 maanden geleden
requirements.txt 1864399710 Fix dotenv. 5 maanden geleden
uwsgi.ini acf4bf7b3d Flask and Docker boilerplate. 1 jaar geleden
wsgi.py 58cd0be0fd Rebrand to ScriptShifter. 1 jaar geleden

README.md

ScriptShifter

REST API service to convert non-Latin scripts to Latin, and vice versa.

Environment variables

The provided example.env can be renamed to .env in your deployment and/or moved to a location that is not under version control, and adjusted to fit the environment. The file will be parsed directly by the application if present, or it can be pre-loaded in a Docker environment.

Currently, the following environment variables are defined:

  • TXL_LOGLEVEL: Application log level. Defaults to WARN.
  • TXL_FLASK_SECRET: Flask secret key.
  • TXL_DICTA_EP: Endpoint for the Dicta Hebrew transliteration service. This is mandatory for using the Hebrew module.

Local development server

For local development, it is easiest to run Flask without the WSGI wrapper, possibly in a virtual environment:

# python -m venv /path/to/venv
# source /path/to/venv/bin/activate
# pip install -r requirements.txt
# flask run

It is advised to set FLASK_DEBUG=true to reload the web app on code changes and print detailed stack traces when exceptions are raised. Note that changes to any .yml file do NOT trigger a reload of Flask.

Alternatively, the transliteration interface can be accessed directly from Python:

from scriptshifter.trans import transliterate

transliterate("some text", "some language")

Run on Docker

Build container in current dir:

docker build -t scriptshifter:latest .

Start container:

docker run --env-file .env -p 8000:8000 scriptshifter:latest

For running in development mode, add -e FLASK_ENV=development to the options.

Web UI

/ renders a simple HTML form to test the transliteration service.

Contributing

See the contributing guide.

Further documentation

See the doc folder for additional documentation.