Package: pyswahili
pyswahiliA programming language built over Python to easily allow swahili speakers to get started with programming without ever knowing englishpyswahiliis not a completely independent language but more of a swahili version ofpython language, syntax and language grammar is
equivalent to python one with only change ofkeywordsfrom english to swahili.pyswahili TranspilerTranspiler(Pyswahili) is for converting the swahili version of python to english version so that it can be intepreted by the python Intepreterextension ?There is no official extension for pyswahili, so for now.pyis fine.Repl vs ScriptSimilar 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 sideScript moderequires you
to write your Pyswahili code on a file and run it as whole.Getting startedTo get started using Pyswahili you might need to eithercloneormanually downloadthe repository
and then use pip command to install the package just as shown below.pipinstallpyswahiliLinux usersIt might require admistrator priveledge to install so usesudoduring the installation.$gitclonehttps://github.com/Kalebu/pyswahili
$cdpyswahili
$sudopip3install-epyswahiliWindow UsersIf you're a Windows user, I would recommed running command prompt(cmd) with admistrator priveledge during the installation.$gitclonehttps://github.com/Kalebu/pyswahili$cdpyswahili$pipinstall-epyswahiliREPL MODENow that the pyswahili package is installed, we can start playing with it, To involve repl just runpyswahiliwithout any argument
just as shown below;_________|__\||(_)(_)||__)|___________||___||_|___/||/__\ \/\//_`|'_\||||||||_|\__\\VV/(_|||||||||_|\__,|___/\_/\_/\__,_|_||_|_|_|_|__/||___/author:KalebuJordan(github.com/kalebu)Pyswahili1.0onLinux|Saturday02,January2021->UsageThe 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->a12->a+89101->andika('umri wako ni',a)umriwakoni12->a=a+13->a25->kamaa%2==0:...andika(a,'ni namba shufwa')...zaidi:...andika(a,'ni namba witiri')...25ninambawitiriFunctions in pyswahili->njiajumla(a,b):...rudishaa+b...->andika(jumla(20,21))41->andika(jumla('hello ','2021'))hello2021Loops Pyswahiliwhile loop
for while loop, we use the swahili keywordwakatiinstead ofwhilebut the syntax stays the same
to break the loop, use keywordvunja->x=3->wakatix>0:...andika(x*10)...x=x-1...302010SCRIPT MODEIn 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.pynamba=ingiza('Namba yoyote : ')namba=int(namba)ikiwanoimokatiya(1,12):andika(no,'x ',namba,'=',no*namba)running script$pyswahilihello.pyNambayoyote:81x8=82x8=163x8=244x8=325x8=406x8=487x8=568x8=649x8=7210x8=8011x8=88SUPPORTED KEYWORDSIf you want to see all the supported keywords in pyswahili, you can view all of them by visitingPyswahili supported keywords,
Keywords are not final, so whenever you see a need for a keyword change feel free to reach me directly.To DoStarter string based logoMaking sure only keywords are replacedImproving the choice of keywordsadding documentation + examplesfixing REPL bugsSupporting the Module structurePublishing Version 1.0 to the PyPIEnsuring Keywords are replacedThe 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 builtinlexical scannertokenize for python source code, which is capable of breaking the
python source code into pieces strings with theirtype(NAME, OP, NUMBER, NEWLINE, IDENT) and so on.More documentation abouut tokenize can be found on itsofficial documentationContributingWanna contribute ? then pleasecontributing.mdto see howGive it a starIf you found this repository useful, give it a starYou can also keep in touch with me onTwitter.Bug bounty?If you encounterissuewith the usage of the package, feel free raise anissueso as
we can fix it as soon as possible(ASAP) or just reach me directly throughemailThe journey has just began