This article originally started as a thread on Twitter and then decided to make an article about it regarding my journey as an open-source contributor, Hope you will enjoy it, take your time
Early 2020 I started a journey as a content creator whereby I have been writing technical content on Software Development mostly being focused on the Python stack.
In the last 5 months, I began a new journey as an opensource contributor, and up to date I have contributed to 8 different python packages
In this article, I'm going to share my journey as 5 months old contributor and my thoughts on contributing to opensource.
The Journey started in December 2020 when Vodacom released their public Mpesa Payment API, As I was looking for a way to integrate with python I came across their implementation for a python wrapper.
I hardly understood it, and usage seems unpythonic to me, I then convinced myself it could be better than that and immediately started my very first opensource project (pypesa) for its re-implementation.
It wasn't easy, a lot of googling and StackOverflow, but eventually, I was able to come up with something that actually worked, and I finally ported it to PyPI.
Python wrapper on Mpesa public API for mobile Payment Integration made with care to offer easy and elegant integration made by kalebu
The following are the features that are supported by the Mpesa public API and require the python implementation.
- Customer to Bussiness (C2B) Single Payment
- Bussiness to Customer (B2C)
- Bussiness to Bussiness (B2B)
- Payment Reversal
- Query Transaction status
- Direct debit creation and Payment
Full documentation can be found on pypesa
Getting started with pypesa is pretty straight forward and can be categorized
into steps shown below.
Sign up for Mpesa Developer portal
Install the pypesa package using pip
Build your services with pypesa
To sign up for Mpesa public API visit Mpesa-API and then
To install the pypesa package to your machine you can either
It now has over 1.9K downloads
It was so fulfilling to me seeing other people using something I crafted and that good feeling lead me to meditate and rethink that I might able to do more to the opensource community taking apart Mpesa package.
For a long time, I have been wishing and admiring being an open-source contributor, inspired by the fact that most software we use today in some ways relies upon OSS whereby people dedicate their time, skills, and effort to build something that we can all use for free.
That single contribution to the Mpesa package helped overcome the imposter syndrome of feeling unskilled enough and contributed anyway which keep me moving through the rest of the journey
The same month I started pypesa I opened a new repository titled pyswahili while procrastinating preparing a talk for Pycon Tanzania, envisioning to be the Swahili version of python programming language.
Honestly speaking, I didn't intend to begin working on this project anytime soon but it changed when I saw the repository with a 0 line code gaining stars and people are betting on it and I said to myself I need to make it real.
Well after a couple of weeks I managed to come with an early implementation of pyswahili with a couple of bugs like replacing non-keyword strings, lack of an interactive repl, unstructured packaging.
I then shared the early implementation with my fellow devs and they were really excited which lead the repo itself to gain a few contributors and a little bit more stars
Recently I managed to port to PyPI and up to date it has been downloaded by over 0.8K
A Swahili version of programming language to allow Swahili speakers get started with programming
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.
Transpiler(Pyswahili) is for converting the swahili version of python to english version so that it can be intepreted by the python Intepreter
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…
The third package arose when I came across a Github repository consisting of data about all locations data in Tanzania grouped by region as CSV Files.
I then thought how about organizing those data as a python package for easy accessibility and usage when it comes to building a real-life application with it.
which leading creating mtaa, a python package just do that;
A package consisting of all Tanzania locations from region to streets in an easily accessible way
A package consisting of all Tanzania locations from region to streets in a easy accessible way made by kalebu
A strory behind
Mtaa package is result of organized json of all the locations in Tanzania, As I was looking for data about these locations data I came across repo tanzania-location-db, It consists of locations data organized into regions, whereby each region has its own csv file. So I wrote a script to transform all the locations from csv into a single Json and from there package came.
If you wanna give a look at the script or interested about building your Json from a similar kind of raw data here is Json Transformer script.
Use pip to install it just as shown below;
pip install mtaa
The library is very straight forward, at the very top of the library is country which…
Pysimilar came up after a previously published article on how to detect plagiarism in Python using cosine similarity, which stands as one of the most-read articles here on dev.to and multiple platforms I published including my personal blog.
After realizing many people were looking into building something like that, I then thought of building a light python package that will enable even complete beginners to able to build a plagiarism detector in python
A python library for computing the similarity between two string(text) based on cosine similarity
A python library for computing the similarity between two string(text) based on cosine similarity made by kalebu
How does it work ?
It uses Tfidf Vectorizer to transform the text into vectors and then obtained vectors are converted into arrays of numbers and then finally cosine similary computation is employed resulting to output indicating how similar they are.
You can either install it directly from Github or use pip to install it, here is how you to install it directly from github;
$ git clone https://github.com/Kalebu/pysimilar
$ cd pysimilar
$ pysimilar -> python setup.py install
Installation with pip
$ pip install pysimilar
Example of usage
Pysimilar allows you to either specify the string you want to compare directly or specify path to files containing string you want to compare.
Here an example on how to compare strings directly;
>>> from pysimilar import compare
If you can't find it, develop and opensource it said opensource, So I did and began developing packages focused mostly on simplifying the integration with the APIS,
These packages include;
NextSMS a python Package to ease the integration with nextsms SMS Gateway
Tigopesa Python package to ease the Tigo Pesa Payment API integration
BeemAfrica A python library to ease the integration with the Beem Africa (SMS, AIRTIME, OTP, 2WAY-SMS, BPAY, USSD)
Nida un-official Python library for loading user information based on National ID number(Tanzania)
Personally getting to open-source has completely transformed me in terms of perception and improvement in the way I write code than code examples ever taught me.
Therefore I would also recommend If you're currently learning a programming language or looking to advance your skills, one of the best things you can do to achieve that is contributing to opensource
Your contribution to open-source projects can act as your portfolio with vivid evidence on how you write code and document your project which can help you land paying gigs, I recently worked with a client who reached out only after going through my GitHub so it works for sure.
You don't really to be an expert to contribute, you just need to have something to contribute that's all, and sometimes you don't even have that something, there are couples of websites such as CodeTriage that highlight issues you fix and level of the difficulties for tons of opensource software.
Well, that's all for this article, I'm glad you enjoyed learning exploring my journey as an open-source contributor, to me this is just beginning and I really think you should too.
You can connect me with me on Twitter
I also write articles on personal blog