All Projects → Kalebu → pyswahili

Kalebu / pyswahili

Licence: MIT License
A Swahili version of programming language to allow Swahili speakers get started with programming

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pyswahili

Nida
Unofficial package for fetching users information based on National ID Number (Tanzania)
Stars: ✭ 47 (-26.56%)
Mutual labels:  tanzania, python-tanzania
python-client
A Python library to ease the integration with the Beem Africa (SMS, AIRTIME, OTP, 2WAY-SMS, BPAY, USSD)
Stars: ✭ 24 (-62.5%)
Mutual labels:  tanzania, python-tanzania
mtaa
A package consisting of all Tanzania locations from region to streets in an easily accessible way
Stars: ✭ 27 (-57.81%)
Mutual labels:  tanzania, python-tanzania
Daemon
适用于 MCSManager 的守护进程,用于与面板端进行分离直接控制和管理程序
Stars: ✭ 72 (+12.5%)
Mutual labels:  opensource
opensource
Olist Open Source Projects
Stars: ✭ 37 (-42.19%)
Mutual labels:  opensource
actinia core
Actinia Core is an open source REST API for scalable, distributed, high performance processing of geographical data that uses mainly GRASS GIS for computational tasks (DOI: https://doi.org/10.5281/zenodo.5879231)
Stars: ✭ 41 (-35.94%)
Mutual labels:  opensource
OpenDesk
OpenDesk is an open source system for helping organisation optimize utilization office desk space. System will help employees to reserve their office desk when to plan to work from office.
Stars: ✭ 49 (-23.44%)
Mutual labels:  opensource
open-source
A safe, welcoming space for developers to learn good practice for collaboration and try their hand at making contributions to OSS. Maintained by the Virtual Coffee Slack group.
Stars: ✭ 20 (-68.75%)
Mutual labels:  opensource
saml-service-provider
SAML Service Provider (SSO)
Stars: ✭ 13 (-79.69%)
Mutual labels:  opensource
CodeForAfrica.org
The @CodeForAfrica landing page. Built with Jekyll and hosted on Github Pages. Accessible at https://codeforafrica.org/
Stars: ✭ 20 (-68.75%)
Mutual labels:  tanzania
sawmill
Sawmill is a JSON transformation Java library
Stars: ✭ 92 (+43.75%)
Mutual labels:  opensource
EasyAbout
A fully material-designed about fragment for your application.
Stars: ✭ 47 (-26.56%)
Mutual labels:  opensource
flamegapps
The main repository of FlameGApps Project
Stars: ✭ 21 (-67.19%)
Mutual labels:  opensource
react-native-audio-session
React Native module for handling the AVAudioSession instance on iOS.
Stars: ✭ 25 (-60.94%)
Mutual labels:  opensource
d3-dotmatrix
Open Source Javascript library to render Dot Matrix Charts
Stars: ✭ 14 (-78.12%)
Mutual labels:  opensource
oh-my-foss-android
个人收集的实用、良心开源安卓软件
Stars: ✭ 37 (-42.19%)
Mutual labels:  opensource
ultrastar-worldparty
UltraStar WorldParty. A karaoke game inspired by SingStar™
Stars: ✭ 88 (+37.5%)
Mutual labels:  opensource
LGM-SOC-21
This repo belongs to LGM-SOC'21 and contains important links to refer , in case participants want a one stop resource to learn a framework , language or anything
Stars: ✭ 38 (-40.62%)
Mutual labels:  opensource
sokoban-action
Sokoban game using GitHub Actions 🤖
Stars: ✭ 26 (-59.37%)
Mutual labels:  opensource
AndroidEssentialLibraries
👻 Android Essential Libraries - A couple of the Android Libraries to use in your Projects 🛠
Stars: ✭ 203 (+217.19%)
Mutual labels:  opensource

pyswahili

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

Releases Downloads Downloads Downloads License: MIT

Become a patron

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.

pip install pyswahili

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].