Deployment
emtranslator is a standalone, dependency-free Python package. It runs
anywhere Python 3.8+ is available: on your machine, on a server, or inside a
container.
Installing into a deployment environment
From the source repository:
python -m pip install .
Editable installs are only intended for development.
From a source distribution or wheel
Build a wheel with pip (no extra tooling required):
python -m pip wheel . --no-deps -w dist
The resulting dist/emtranslator-0.1.0-py3-none-any.whl can be installed with
pip on any target machine:
python -m pip install dist/emtranslator-0.1.0-py3-none-any.whl
TODO: publishing to PyPI is not configured. When the package is published, replace the above with
python -m pip install emtranslator.
Docker
A Dockerfile is included in the repository. Build and run locally:
docker build -t emtranslator .
docker run --rm emtranslator "Hello world" # Monsu_1 monsu_2
docker run --rm emtranslator --version # emtrans 0.1.0
Prebuilt images are published to GitHub Container Registry on every push to
main (latest) and on version tags such as v0.1.0 (0.1.0):
docker run --rm ghcr.io/rkriad585/emtranslator "Hello world"
docker run --rm ghcr.io/rkriad585/emtranslator:0.1.0 "Hello world"
Notes:
- The image is based on
python:3.12-slimand built in two stages: the package is installed into a virtual environment in the build stage and only that environment is copied to the runtime stage, so the final image contains the runtime package without its source, tests, or build tooling. - The container runs as the non-root user
emtrans. User-dictionary entries added inside a container are stored in/home/emtrans/.config/neostore/emtranslator/config.toml. Mount a volume to persist them, for example:docker run --rm -v "$HOME/.config/neostore:/home/emtrans/.config/neostore" ghcr.io/rkriad585/emtranslator "hi".
Files and security
The tool reads only the input you give it and writes only its user dictionary. It makes no network requests, so it is safe to run in offline or restricted environments.