African-language AI coding assistant for Python โ converts spoken isiZulu, isiXhosa, Sesotho, Setswana, Sepedi, Tshivenda, Xitsonga to Python code
Project description
๐ค CMT_Voice
African-language AI coding assistant for Python and VS Code
"Funda iCSV ebizwa abafundi.csv bese ukhombisa imigqa emihlanu" โ
df = pd.read_csv("abafundi.csv")+print(df.head())
CMT_Voice lets South African students, researchers, and developers write Python by speaking isiZulu, isiXhosa, Sesotho, Setswana, Sepedi, Tshivenda, Xitsonga, and English โ directly inside VS Code or Jupyter Notebooks.
โจ Features
- All Python keywords in 7+ South African languages
- All built-in functions (
print,len,range,input,open, ...) - pandas โ read CSV/Excel, head, describe, groupby, merge, pivot ...
- NumPy โ arrays, math, random, reshape, matrix ops ...
- Matplotlib + Seaborn โ line, bar, histogram, scatter, pie, heatmap ...
- Scikit-Learn โ train/test split, RandomForest, SVM, KNN, accuracy, PCA ...
- TensorFlow / Keras โ Sequential, Dense, compile, fit, predict, save ...
- PyTorch โ tensors, nn.Module, optimizers, backward, CUDA ...
- Flask โ routes, GET/POST, jsonify, run ...
- File operations โ open, read, write, os.path, makedirs ...
- AI fallback โ Claude AI handles anything not in the dictionary
- VS Code extension โ
Ctrl+Shift+Vto open the translation panel - Multi-turn context โ remembers your current file for smarter completions
๐ Quick Start
Install Python package
pip install cmt-voice
Use in Python
import cmt_voice as cmtv
# Configure (reads ANTHROPIC_API_KEY env var automatically)
cmtv.configure()
# Translate simple phrase
print(cmtv.translate("Phrinta Sawubona"))
# โ print("Sawubona")
# Translate with AI for complex intents
print(cmtv.translate("Funda iCSV ebizwa abafundi.csv bese ukhombisa imigqa emihlanu"))
# โ df = pd.read_csv("abafundi.csv")
# โ print(df.head())
# Interactive REPL
cmtv.listen_loop()
VS Code Extension
- Copy the
vscode_extension/folder to your VS Code extensions directory - Set your API key in Settings โ CMT_Voice โ API Key
- Open any
.pyfile - Press
Ctrl+Shift+V(Mac:Cmd+Shift+V) to open the panel - Type in any South African language โ click Translate โ Insert
๐ฃ๏ธ Language Examples
Keywords
| Spoken | Language | Python |
|---|---|---|
Phrinta Sawubona |
isiZulu | print("Sawubona") |
Khombisa igama |
isiZulu | print(igama) |
Laetsa lebitso |
Sesotho | print(lebitso) |
Bontsha leina |
Setswana | print(leina) |
Uma x inkulu kuno 5 |
isiZulu | if x > 5: |
Xa x inkulu ku 5 |
isiXhosa | if x > 5: |
Haeba x e fetisa 5 |
Sesotho | if x > 5: |
Ngaphandle kwalokho |
isiZulu | else: |
Phinda i in range 10 |
isiZulu | for i in range(10): |
Ngenkathi x inkulu kuno 0 |
isiZulu | while x > 0: |
Dala umsebenzi obizwa sawubona |
isiZulu | def sawubona(): |
Buyisa umphumela |
isiZulu | return umphumela |
iKilasi Mfundi |
isiZulu | class Mfundi: |
Zama |
isiZulu | try: |
Uma kunephutha Exception |
isiZulu | except Exception: |
Fakisa pandas |
isiZulu | import pandas as pd |
Iqiniso |
isiZulu | True |
Amanga |
isiZulu | False |
Lutho |
isiZulu | None |
Data Science (pandas)
| Spoken | Python |
|---|---|
Funda iCSV ebizwa data.csv |
df = pd.read_csv("data.csv") |
Funda iExcel ebizwa data.xlsx |
df = pd.read_excel("data.xlsx") |
Khombisa imigqa emihlanu yokuqala |
print(df.head()) |
Bonisa ulwazi |
df.info() |
Chaza idatha |
df.describe() |
Ubunjalo bedatha |
df.shape |
Susa ulutho |
df.dropna() |
Hlela ngamanani |
df.sort_values('column') |
Hlanganisa ngemihlobo |
df.groupby('column') |
Gcina njengescsv |
df.to_csv("output.csv") |
Machine Learning (scikit-learn)
| Spoken | Python |
|---|---|
Hlukanisa idatha ibe yi-training ne-testing |
X_train, X_test, y_train, y_test = train_test_split(...) |
Dala i-random forest |
model = RandomForestClassifier() |
Dala i-logistic regression |
model = LogisticRegression() |
Dala i-svm |
model = SVC() |
Qeqesha imodeli |
model.fit(X_train, y_train) |
Bikezela |
predictions = model.predict(X_test) |
Bonisa ukunemba |
print(accuracy_score(y_test, predictions)) |
Bonisa inhlalo |
print(classification_report(...)) |
Lungisa idatha |
scaler = StandardScaler() |
Nciphisa izikhombisi |
pca = PCA(n_components=2) |
Visualisation (matplotlib/seaborn)
| Spoken | Python |
|---|---|
Dweba umugqa |
plt.plot(x, y) |
Dweba i-bar chart |
plt.bar(x, y) |
Dweba i-histogram |
plt.hist(data) |
Dweba amachashazi |
plt.scatter(x, y) |
Dweba i-pie chart |
plt.pie(sizes) |
Faka isihloko Imiphumela |
plt.title("Imiphumela") |
Dweba igraph |
plt.show() |
Dweba i-heatmap |
sns.heatmap(df.corr()) |
Dweba i-pairplot |
sns.pairplot(df) |
Deep Learning (TensorFlow/PyTorch)
| Spoken | Python |
|---|---|
Dala i-neural network |
model = tf.keras.Sequential() |
Faka i-dense layer |
model.add(tf.keras.layers.Dense(64, activation='relu')) |
Faka i-dropout |
model.add(tf.keras.layers.Dropout(0.5)) |
Lungisa imodeli |
model.compile(optimizer='adam', ...) |
Qeqesha imodeli |
model.fit(X_train, y_train, epochs=10) |
Hlola imodeli |
loss, acc = model.evaluate(X_test, y_test) |
Gcina imodeli |
model.save("imodeli.h5") |
๐๏ธ Architecture
CMT_Voice/
โโโ cmt_voice/
โ โโโ __init__.py # Public API
โ โโโ engine.py # Core engine (local + AI translation)
โ โโโ mappings.py # 1000+ language โ Python mappings
โโโ vscode_extension/
โ โโโ package.json # Extension manifest
โ โโโ src/extension.js # VS Code extension (Ctrl+Shift+V)
โโโ examples/
โ โโโ all_examples.py # Full test suite
โ โโโ data_science_izulu.py # Complete isiZulu ML workflow
โโโ setup.py
โโโ README.md
Translation pipeline:
Spoken SA Language
โ
LocalTranslator (dictionary, instant)
โ (no match)
AITranslator (Claude API, handles complex/novel phrases)
โ
Post-processing (clean indentation, strip fences)
โ
Valid Python Code โ inserted at cursor in VS Code
โ๏ธ Configuration
import cmt_voice as cmtv
cmtv.configure(
api_key="sk-ant-...", # or set ANTHROPIC_API_KEY env var
model="claude-sonnet-4-6", # Claude model
always_use_ai=False, # True = always use AI (slower, more accurate)
)
VS Code settings (settings.json):
{
"cmtvoice.apiKey": "sk-ant-...",
"cmtvoice.model": "claude-sonnet-4-6",
"cmtvoice.alwaysUseAI": false,
"cmtvoice.addImportsAutomatically": true,
"cmtvoice.insertAtCursor": true,
"cmtvoice.language": "auto"
}
๐ Supported Languages
| Language | Region |
|---|---|
| isiZulu | KwaZulu-Natal, Gauteng |
| isiXhosa | Eastern Cape, Western Cape |
| Sesotho | Free State, Lesotho |
| Setswana | North West, Botswana |
| Sepedi (Northern Sotho) | Limpopo |
| Tshivenda | Limpopo |
| Xitsonga | Limpopo, Mpumalanga |
| English | All provinces |
| Mixed SA | Any combination |
๐ฏ Roadmap
- v1.0 โ Python package with 1000+ mappings
- v1.0 โ VS Code extension (Ctrl+Shift+V)
- v1.1 โ Jupyter Notebook extension (speak โ cell code)
- v1.2 โ Real microphone input (speech-to-text โ code)
- v1.3 โ More languages (Siswati, isiNdebele, Afrikaans)
- v2.0 โ Full IDE plugin (JetBrains, Cursor)
- v2.0 โ Voice activation ("Hey CMT") support
๐ License
MIT License โ built for African students, researchers, and developers.
Sala kahle. Totsiens. Goodbye.
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
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_voice_za-1.0.0.tar.gz.
File metadata
- Download URL: cmt_voice_za-1.0.0.tar.gz
- Upload date:
- Size: 23.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c48ad0ad1597031667e5ff09b53d184256e8beabdd2d8944f8a8d88cf8a6aaf3
|
|
| MD5 |
b2104a0a8fa11639226120dd64992545
|
|
| BLAKE2b-256 |
8f5d5a6aa8102f3ff0e8265d5d85de69c3edbbdc838c7694f4a749fe3f8a7347
|
File details
Details for the file cmt_voice_za-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cmt_voice_za-1.0.0-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5085cb60abc76bd6830e3677164f567482cfeac4b25a5622fbaf7b8170f76b2b
|
|
| MD5 |
90f470a74ecee79a0ba499ed6b604020
|
|
| BLAKE2b-256 |
33968ca8903fa383e9abb7b2b3a4f0349a00a76bf0625b75b4b1703a60938159
|