A programming language built on top of Python to easily allow Swahili speakers to get started with programming without ever knowing English

Overview

pyswahili

A programming language built over Python to easily allow swahili speakers to get started with programming without ever knowing english

pyswahili is not a completely independent language but more of a swahili version of python language, syntax and language grammar is equivalent to python one with only change of keywords from english to swahili.

pyswahili Transpiler

Transpiler(Pyswahili) is for converting the swahili version of python to english version so that it can be intepreted by the python Intepreter

extension ?

There is no official extension for pyswahili, so for now .py is fine.

Repl vs Script

Similar to Python, Pyswahili supports both modes; the Read-evaluate-print(Repl) loop and Script mode, Repl enable you to interactively execute pyswahili code line by line without requiring to write a complete program while on other side Script mode requires you to write your Pyswahili code on a file and run it as whole.

Getting started

To get started using Pyswahili you might need to either clone or manually download the repository and then use pip command to install the package just as shown below.

Linux users

It might require admistrator priveledge to install so use sudo during the installation.

$ git clone https://github.com/Kalebu/pyswahili
$ cd pyswahili
$ sudo pip3 install -e pyswahili

Window Users

If you're a Windows user, I would recommed running command prompt(cmd) with admistrator priveledge during the installation.

$ git clone https://github.com/Kalebu/pyswahili
$ cd pyswahili
$ pip install -e pyswahili

REPL MODE

Now that the pyswahili package is installed, we can start playing with it, To involve repl just run pyswahili without any argument just as shown below;

                 _____                         _     _ _ _ 
                |  __ \                       | |   (_) (_)
                | |__) |   _ _____      ____ _| |__  _| |_ 
                |  ___/ | | / __\ \ /\ / / _` | '_ \| | | |
                | |   | |_| \__ \\ V  V / (_| | | | | | | |
                |_|    \__, |___/ \_/\_/ \__,_|_| |_|_|_|_|
                        __/ |                              
                        |___/                               
            
author: Kalebu Jordan (github.com/kalebu)
Pyswahili 1.0 on Linux | Saturday 02, January 2021
-> 

Usage

The Pyswahili REPL is used the same wise as the normal python repl, supporting basic statements to complex logic with block statements written in swahili, just as illustrated in the example below.

-> a = 12
-> a
12
-> a + 89
101
-> andika('umri wako ni', a)
umri wako ni 12
-> a = a + 13
-> a
25
-> kama a%2==0:
...     andika(a, 'ni namba shufwa')
...zaidi:
...     andika(a,'ni namba witiri')
...
25 ni namba witiri

Functions in pyswahili

-> njia jumla(a, b):
...     rudisha a + b 
...
-> andika(jumla(20, 21))
41
-> andika(jumla('hello ', '2021'))
hello 2021

Loops Pyswahili

  • while loop for while loop, we use the swahili keyword wakati instead of while but the syntax stays the same to break the loop, use keyword vunja
-> x = 3   
-> wakati x>0:
...     andika(x*10)
...     x = x - 1
...
30
20
10

SCRIPT MODE

In script mode, you're supposed to have write your pyswahili code in a file and then pyswahili will run it as whole, your code should follow pyswahili syntax (python one) for it to be evaluated.

  • hello.py
namba = ingiza('Namba yoyote : ')
namba = int(namba)

ikiwa no imo katiya(1, 12):
    andika(no, 'x ', namba, '=', no*namba)

running script

$ pyswahili hello.py 
Namba yoyote : 8 
1 x  8 = 8
2 x  8 = 16
3 x  8 = 24
4 x  8 = 32
5 x  8 = 40
6 x  8 = 48
7 x  8 = 56
8 x  8 = 64
9 x  8 = 72
10 x  8 = 80
11 x  8 = 88

SUPPORTED KEYWORDS

If you want to see all the supported keywords in pyswahili, you can view all of them by visiting Pyswahili supported keywords, Keywords are not final, so whenever you see a need for a keyword change feel free to reach me directly.

To Do

  • Starter string based logo
  • Making sure only keywords are replaced
  • Improving the choice of keywords
  • adding documentation + examples
  • fixing REPL bugs
  • Supporting the Module structure
  • Publishing Version 1.0 to the PyPI

Ensuring Keywords are replaced

The current approach is just to replace the keywords in the whole python source code string, but the methods are error-prone since they also replace user defined strings, so we have to find a way whereby only keywords are being replaced.

This can be achieved by using Python builtin lexical scanner tokenize for python source code, which is capable of breaking the python source code into pieces strings with their type (NAME, OP, NUMBER, NEWLINE, IDENT) and so on.

More documentation abouut tokenize can be found on its official documentation

Contributing

Wanna contribute ? then please contributing.md to see how

Give it a star

If you found this repository useful, give it a star

You can also keep in touch with me on Twitter.

Bug bounty?

If you encounter issue with the usage of the package, feel free raise an issue so as we can fix it as soon as possible(ASAP) or just reach me directly through email

The journey has just began

You might also like...
🐍PyNode Next allows you to easily create beautiful graph visualisations and animations
🐍PyNode Next allows you to easily create beautiful graph visualisations and animations

PyNode Next A complete rewrite of PyNode for the modern era. Up to five times faster than the original PyNode. PyNode Next allows you to easily create

Plotly Dash Command Line Tools - Easily create and deploy Plotly Dash projects from templates
Plotly Dash Command Line Tools - Easily create and deploy Plotly Dash projects from templates

🛠️ dash-tools - Create and Deploy Plotly Dash Apps from Command Line | | | | | Create a templated multi-page Plotly Dash app with CLI in less than 7

An interactive dashboard built with python that enables you to visualise how rent prices differ across Sweden.
An interactive dashboard built with python that enables you to visualise how rent prices differ across Sweden.

sweden-rent-dashboard An interactive dashboard built with python that enables you to visualise how rent prices differ across Sweden. The dashboard/web

MPL Plotter is a Matplotlib based Python plotting library built with the goal of delivering publication-quality plots concisely.
MPL Plotter is a Matplotlib based Python plotting library built with the goal of delivering publication-quality plots concisely.

MPL Plotter is a Matplotlib based Python plotting library built with the goal of delivering publication-quality plots concisely.

A filler visualizer built using python
A filler visualizer built using python

filler-visualizer 42 filler のログをビジュアライズしてスポーツさながら楽しむことができます! Usage (標準入力でvisualizer.pyに渡せばALL OK) 1. 既にあるログをビジュアライズする $ ./filler_vm -t 3 -p1 john_fill

A Python-based non-fungible token (NFT) generator built using Samilla and Matplotlib
A Python-based non-fungible token (NFT) generator built using Samilla and Matplotlib

PyNFT A Pythonic NF (non-fungible token) generator built using Samilla and Matplotlib Use python pynft.py [amount] The intention behind this generato

The Timescale NFT Starter Kit is a step-by-step guide to get up and running with collecting, storing, analyzing and visualizing NFT data from OpenSea, using PostgreSQL and TimescaleDB.

Timescale NFT Starter Kit The Timescale NFT Starter Kit is a step-by-step guide to get up and running with collecting, storing, analyzing and visualiz

Eulera Dashboard is an easy and intuitive way to get a quick feel of what’s happening on the world’s market.
Eulera Dashboard is an easy and intuitive way to get a quick feel of what’s happening on the world’s market.

an easy and intuitive way to get a quick feel of what’s happening on the world’s market ! Eulera dashboard is a tool allows you to monitor historical

This tool is designed to help administrators get an overview of their Active Directory structure.
This tool is designed to help administrators get an overview of their Active Directory structure.

This tool is designed to help administrators get an overview of their Active Directory structure. In the group view you can see all elements of an AD (OU, USER, GROUPS, COMPUTERS etc.). In the user view one sees all users according to their Manager/Manager of Hierarchy.

Comments
  • Update sw_to_en.py

    Update sw_to_en.py

    "kama": "if" #we have to put ikiwa so as to give keyword "as" as kama, "ingiza": "input", # we have to use weka so as ingiza to be used on import

    opened by ismohamedi 0
Releases(0.1)
Owner
Jordan Kalebu
Python Developer | Arduino | Rust | Javascript | C/C++ | Love Machine Learning & Open Source
Jordan Kalebu
A python package for animating plots build on matplotlib.

animatplot A python package for making interactive as well as animated plots with matplotlib. Requires Python = 3.5 Matplotlib = 2.2 (because slider

Tyler Makaro 394 Dec 18, 2022
A simple, fast, extensible python library for data validation.

Validr A simple, fast, extensible python library for data validation. Simple and readable schema 10X faster than jsonschema, 40X faster than schematic

kk 209 Sep 19, 2022
Scientific Visualization: Python + Matplotlib

An open access book on scientific visualization using python and matplotlib

Nicolas P. Rougier 8.6k Dec 31, 2022
Ana's Portfolio

Ana's Portfolio ✌️ Welcome to my Portfolio! You will find here different Projects I have worked on (from scratch) 💪 Projects 💻 1️⃣ Hangman game (Mad

Ana Katherine Cortes Sobrino 9 Mar 15, 2022
plotly scatterplots which show molecule images on hover!

molplotly Plotly scatterplots which show molecule images on hovering over the datapoints! Required packages: pandas rdkit jupyter_dash ➡️ See example.

150 Dec 28, 2022
Data aggregated from the reports found at the MCPS COVID Dashboard into a set of visualizations.

Montgomery County Public Schools COVID-19 Visualizer Contents About this project Data Support this project About this project Data All data we use can

James 3 Jan 19, 2022
Simple CLI python app to show a stocks graph performance. Made with Matplotlib and Tiingo.

stock-graph-python Simple CLI python app to show a stocks graph performance. Made with Matplotlib and Tiingo. Tiingo API Key You will need to add your

Toby 3 May 14, 2022
It's an application to calculate I from v and r. It can also plot a graph between V vs I.

Ohm-s-Law-Visualizer It's an application to calculate I from v and r using Ohm's Law. It can also plot a graph between V vs I. Story I'm doing my Unde

Sihab Sahariar 1 Nov 20, 2021
🐞 📊 Ladybug extension to generate 2D charts

ladybug-charts Ladybug extension to generate 2D charts. Installation pip install ladybug-charts QuickStart import ladybug_charts API Documentation Loc

Ladybug Tools 3 Dec 30, 2022
Shaded 😎 quantile plots

shadyquant 😎 This python package allows you to quantile and plot lines where you have multiple samples, typically for visualizing uncertainty. Your d

Mehrad Ansari 13 Sep 29, 2022
🐍PyNode Next allows you to easily create beautiful graph visualisations and animations

PyNode Next A complete rewrite of PyNode for the modern era. Up to five times faster than the original PyNode. PyNode Next allows you to easily create

ehne 3 Feb 12, 2022
trade bot connected to binance API/ websocket.,, include dashboard in plotly dash to visualize trades and balances

Crypto trade bot 1. What it is Trading bot connected to Binance API. This project made for fun. So ... Do not use to trade live before you have backte

G 3 Oct 07, 2022
EPViz is a tool to aid researchers in developing, validating, and reporting their predictive modeling outputs.

EPViz (EEG Prediction Visualizer) EPViz is a tool to aid researchers in developing, validating, and reporting their predictive modeling outputs. A lig

Jeff 2 Oct 19, 2022
ICS-Visualizer is an interactive Industrial Control Systems (ICS) network graph that contains up-to-date ICS metadata

ICS-Visualizer is an interactive Industrial Control Systems (ICS) network graph that contains up-to-date ICS metadata (Name, company, port, user manua

QeeqBox 2 Dec 13, 2021
Tidy data structures, summaries, and visualisations for missing data

naniar naniar provides principled, tidy ways to summarise, visualise, and manipulate missing data with minimal deviations from the workflows in ggplot

Nicholas Tierney 611 Dec 22, 2022
Generate a 3D Skyline in STL format and a OpenSCAD file from Gitlab contributions

Your Gitlab's contributions in a 3D Skyline gitlab-skyline is a Python command to generate a skyline figure from Gitlab contributions as Github did at

Félix Gómez 70 Dec 22, 2022
Make sankey, alluvial and sankey bump plots in ggplot

The goal of ggsankey is to make beautiful sankey, alluvial and sankey bump plots in ggplot2

David Sjoberg 156 Jan 03, 2023
High-level geospatial data visualization library for Python.

geoplot: geospatial data visualization geoplot is a high-level Python geospatial plotting library. It's an extension to cartopy and matplotlib which m

Aleksey Bilogur 1k Jan 01, 2023
The Python ensemble sampling toolkit for affine-invariant MCMC

emcee The Python ensemble sampling toolkit for affine-invariant MCMC emcee is a stable, well tested Python implementation of the affine-invariant ense

Dan Foreman-Mackey 1.3k Jan 04, 2023