Write Python code in South Africa's 11 official languages
Project description
CMT-SALanguages 🇿🇦
Write Python code in all 11 official South African languages.
Developed by Mzwandile.
Install
pip install CMT-SALanguages
Use it
from CMT_SALanguages import isizulu as CAL
CAL.sebenza('phrinta("Sawubona Mzansi!")')
Each language is its own module with the same set of functions:
| Function | Meaning |
|---|---|
sebenza(code) / run(code) |
Run a string of code |
fayela(path) |
Run a file |
phendula(code) |
Run and return output as a string |
guqula(code) |
Transpile to Python (return as string) |
amagama() |
Print all keywords for this language |
live() |
Start the live editor |
Supported languages
from CMT_SALanguages import isizulu as CAL # isiZulu
from CMT_SALanguages import isixhosa as CAL # isiXhosa
from CMT_SALanguages import afrikaans as CAL # Afrikaans
from CMT_SALanguages import sesotho as CAL # Sesotho
from CMT_SALanguages import setswana as CAL # Setswana
from CMT_SALanguages import sepedi as CAL # Sepedi
from CMT_SALanguages import siswati as CAL # siSwati
from CMT_SALanguages import isindebele as CAL # isiNdebele
from CMT_SALanguages import tshivenda as CAL # Tshivenda
from CMT_SALanguages import xitsonga as CAL # Xitsonga
from CMT_SALanguages import english as CAL # English (SA)
Example — isiZulu
from CMT_SALanguages import isizulu as CAL
CAL.sebenza('''
isigaba Umuntu:
sebenza _qala_(kulo, igama):
kulo.igama = igama
sebenza zikhulume(kulo):
phrinta("Sawubona, " + kulo.igama + "!")
u = Umuntu("Thandi")
u.zikhulume()
''')
Example — Afrikaans
from CMT_SALanguages import afrikaans as CAL
CAL.sebenza('''
funksie groet(naam):
druk("Hallo, " + naam + "!")
groet("Pieter")
''')
Example — Setswana
from CMT_SALanguages import setswana as CAL
CAL.sebenza('''
fa palo > 10:
gatisa("Palo e kgolo")
kgotsa_fa palo == 10:
gatisa("E lekana")
fa_go_sa_nnaleng_jalo:
gatisa("E nnye")
''')
List all languages
import CMT_SALanguages as sa
sa.list_languages()
Sikhona. Re teng. Ons bestaan. We exist. 🇿🇦
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cmt_salanguages-1.0.0.tar.gz
(16.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cmt_salanguages-1.0.0.tar.gz.
File metadata
- Download URL: cmt_salanguages-1.0.0.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b38351345bee25d4a6b703fb9a2e54ef4f6886b360d4c4d0432c3dd29d58d37b
|
|
| MD5 |
7f9856e5aaf7c25764b11d7143fbd286
|
|
| BLAKE2b-256 |
8116ff607693bb37b4aa45e239249d19995b1d3b60579191540f2bbdcbdb03ea
|
File details
Details for the file cmt_salanguages-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cmt_salanguages-1.0.0-py3-none-any.whl
- Upload date:
- Size: 26.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e13a8db3819a2b14411b3c11bdfef4e47f86cc569651d14abc171f48908c8d3
|
|
| MD5 |
1fa54ba6bab2c021755644b96f87bdbe
|
|
| BLAKE2b-256 |
4d59f1b929e7858826f73f29fe83833e76fe6aea6f0fd8985612b3edd738c3c7
|