Files
foreignthon-docs/docs/index.md

1.1 KiB

ForeignThon

Write Python in any human language.

ForeignThon is a transpiler that converts .xx.py files into standard Python — keywords, builtins, and exceptions all translated into your language. The compiled output runs anywhere without ForeignThon installed.


How it works

source.es.py  →  fpy  →  source.compiled.py  →  Python

ForeignThon uses Python's tokenize module to swap NAME tokens. Strings, comments, and f-strings are never touched. The result is identical, valid Python.


Install

pip install foreignthon
pip install foreignthon-es   # or any other language pack

At a glance

Feature Description
Transpiler Tokenizer-based, safe, unicode-aware
File format .xx.py where xx is the language code
Errors Shown in your language first, English below
Postfix syntax @@ operator for SOV languages
Custom packs Local JSON override, no PyPI needed
CLI fpy run, fpy compile, fpy decompile, fpy new

Get started →{ .md-button .md-button--primary } CLI Reference →{ .md-button }