Skip to main content

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+V to 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

  1. Copy the vscode_extension/ folder to your VS Code extensions directory
  2. Set your API key in Settings โ†’ CMT_Voice โ†’ API Key
  3. Open any .py file
  4. Press Ctrl+Shift+V (Mac: Cmd+Shift+V) to open the panel
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cmt_voice_za-1.0.0.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cmt_voice_za-1.0.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

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

Hashes for cmt_voice_za-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c48ad0ad1597031667e5ff09b53d184256e8beabdd2d8944f8a8d88cf8a6aaf3
MD5 b2104a0a8fa11639226120dd64992545
BLAKE2b-256 8f5d5a6aa8102f3ff0e8265d5d85de69c3edbbdc838c7694f4a749fe3f8a7347

See more details on using hashes here.

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

Hashes for cmt_voice_za-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5085cb60abc76bd6830e3677164f567482cfeac4b25a5622fbaf7b8170f76b2b
MD5 90f470a74ecee79a0ba499ed6b604020
BLAKE2b-256 33968ca8903fa383e9abb7b2b3a4f0349a00a76bf0625b75b4b1703a60938159

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page