Library of Congress script transliterator.

scossu b239d5eaa4 Fix Malayalam config. il y a 11 mois
.github 87289c2141 Fix typo on test workflow trigger. il y a 1 an
doc 235100f043 Also use JSON in feedback request; update docs. il y a 1 an
ext 1a2dc2565b Yiddish transliteration via submodules. il y a 1 an
legacy 26bb6f98bb Add Thai from Randy's table il y a 1 an
scriptshifter b239d5eaa4 Fix Malayalam config. il y a 11 mois
tests fe7d8d39dc P3 legacy mappings (#110) il y a 1 an
.dockerignore ef159ddf98 Update Docker image to Debian. il y a 1 an
.gitignore ef159ddf98 Update Docker image to Debian. il y a 1 an
.gitmodules 95445ba642 Change refs for Yiddish submodules. il y a 1 an
Dockerfile 779b0c6fe1 Fix image name typo. il y a 1 an
LICENSE 20cb85dad1 Initial commit il y a 2 ans
NOTES.md 58cd0be0fd Rebrand to ScriptShifter. il y a 2 ans
README.md 0fca32b496 Add language note in README. il y a 1 an
TODO.md dae54334a7 Add Arabic transliteration via 3d party. il y a 2 ans
deps.txt ea31ab1591 Update Aksharamukha. il y a 1 an
entrypoint.sh 2d64c48b9a Link large model; fix Docker image. (#90) il y a 1 an
example.env 6413dd586c Hebrew (#81) il y a 1 an
requirements.txt 2dda4ee92e Split docker files and requirements. il y a 1 an
scriptshifter_base.Dockerfile 2dda4ee92e Split docker files and requirements. il y a 1 an
test.Dockerfile 2dda4ee92e Split docker files and requirements. il y a 1 an
uwsgi.ini acf4bf7b3d Flask and Docker boilerplate. il y a 2 ans
wsgi.py 58cd0be0fd Rebrand to ScriptShifter. il y a 2 ans

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.

Environment variables

The following environment variables are available for modification:

TXL_EMAIL_FROM: Email address sending the feedback form on behalf of users.

TXL_EMAIL_TO: Recipients of the feedback form.

TXL_FLASK_SECRET: Seed for web server security. Set to a random-generated string in a production environment.

TXL_LOGLEVEL: Logging level. Use Python notation. The default is WARN.

TXL_SMTP_HOST: SMTP host to send feedback messages through. Defaults to localhost.

TXL_SMTP_PORT: Port of the SMTP server. Defaults to 1025.

Web UI

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

Adding a language as a value of the lang URL parameter, the UI will start with that language selected. E.g. /?lang=chinese will select Chinese from the drop-down automatically. The value must be one of the keys found in /languages.

Contributing

See the contributing guide.

Further documentation

See the doc folder for additional documentation.