{"id":18924666,"url":"https://github.com/neurotech-hq/pypesa","last_synced_at":"2025-04-15T11:13:36.086Z","repository":{"id":37068843,"uuid":"317293921","full_name":"Neurotech-HQ/pypesa","owner":"Neurotech-HQ","description":"Python wrapper on Mpesa public API for mobile Payment Integration ","archived":false,"fork":false,"pushed_at":"2024-05-16T20:25:15.000Z","size":580,"stargazers_count":34,"open_issues_count":5,"forks_count":10,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-15T11:13:19.097Z","etag":null,"topics":["mpesa","mpesa-api","mpesa-developer-portal","mpesa-integration","mpesa-payments","mpesa-rest","mpesa-sdk","pypesa","python","python-mpesa","python-tanzania","tanzania"],"latest_commit_sha":null,"homepage":"https://kalebu.github.io/python-pesa/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Neurotech-HQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"Contributing.md","funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"kalebujordan"}},"created_at":"2020-11-30T17:15:01.000Z","updated_at":"2024-12-28T01:26:40.000Z","dependencies_parsed_at":"2024-11-20T11:01:23.772Z","dependency_job_id":null,"html_url":"https://github.com/Neurotech-HQ/pypesa","commit_stats":null,"previous_names":["kalebu/pypesa"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neurotech-HQ%2Fpypesa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neurotech-HQ%2Fpypesa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neurotech-HQ%2Fpypesa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neurotech-HQ%2Fpypesa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Neurotech-HQ","download_url":"https://codeload.github.com/Neurotech-HQ/pypesa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249058384,"owners_count":21205911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mpesa","mpesa-api","mpesa-developer-portal","mpesa-integration","mpesa-payments","mpesa-rest","mpesa-sdk","pypesa","python","python-mpesa","python-tanzania","tanzania"],"created_at":"2024-11-08T11:07:44.516Z","updated_at":"2025-04-15T11:13:36.065Z","avatar_url":"https://github.com/Neurotech-HQ.png","language":"Python","funding_links":["https://patreon.com/kalebujordan","https://www.patreon.com/kalebujordan"],"categories":[],"sub_categories":[],"readme":"\u003csamp\u003e \n  \n# [pypesa](http://kalebu.github.io/pypesa)\n\n[![Pypesa banner](assets/pypesa-banner.png)](https://kalebu.github.io/pypesa/)\n[![PyPI version](https://badge.fury.io/py/python-pesa.svg)](https://badge.fury.io/py/python-pesa)\n[![Releases](https://badgen.net/github/releases/kalebu/pypesa)](https://github.com/Kalebu/pypesa)\n[![Downloads](https://pepy.tech/badge/python-pesa)](https://pepy.tech/project/python-pesa)\n[![Downloads](https://pepy.tech/badge/python-pesa/month)](https://pepy.tech/project/python-pesa)\n[![Downloads](https://pepy.tech/badge/python-pesa/week)](https://pepy.tech/project/python-pesa)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nPython wrapper on **Mpesa public API** for mobile Payment Integration made with care to offer easy and elegant integration made by [kalebu](https://github.com/kalebu)\n\n[![Become a patron](assets/become_a_patron_button.png)](https://www.patreon.com/kalebujordan)\n\n## Implemented Features\n\nThe following are the features that are supported by the **Mpesa** public API and require the **python** implementation.\n\n- [x] Customer to Bussiness (C2B) Single Payment\n- [x] Bussiness to Customer (B2C)\n- [x] Bussiness to Bussiness (B2B)\n- [x] Payment Reversal\n- [x] Query Transaction status\n- [x] Direct debit creation and Payment\n\n## Documentation\n\nFull documentation can be found on [pypesa](http://kalebu.github.io/pypesa)\n\n## Getting started\n\nGetting started with **pypesa** is pretty straight forward and can be categorized\n\ninto steps shown below.\n\n- Sign up for Mpesa Developer portal\n\n- Install the [pypesa](http://kalebu.github.io/pypesa) package using **pip**\n\n- Build your services with **pypesa**\n\n## Signing up\n\nTo sign up for Mpesa public API visit [Mpesa-API](https://openapiportal.m-pesa.com/sign-up) and then\n\nyou can go through [getting started Mpesa Developer portal](https://dev.to/alphaolomi/getting-started-with-mpesa-developer-portal-46a4)\nby [alphaolomi](https://github.com/alphaolomi) to see how.\n\n## Installation\n\nTo install the **pypesa** package to your machine you can either\n\ninstall directly from github or use pip to install it.\n\n- Using github\n\n```bash\n$~ git clone https://github.com/Kalebu/pypesa\n$~ cd pypesa\n$ pypesa ~ python setup.py install \n```\n\n- Using pip\n\n```bash\n\npip install python-pesa\n\n```\n\n## Usage\n\nTo begin using the package is pretty straight forward\n\n1. You need to have a json file named **keys.json** on your project directly\n  and then fill put in it your public and api keys in json format shown below\n\n  ```python\n\n    {\n     'api_key': 'xxx', \n     'public_key': 'xxxxxxxxxxxxxx' \n    }\n  ```\n\n2.Once done you're ready to go, just make sure you have active internet connection\n\n### Example of Usage (Customer to Bussiness Transaction)\n\n```python\n\u003e\u003e\u003e from pypesa import Mpesa\n\u003e\u003e\u003e mpesa = Mpesa()\n\u003e\u003e\u003e transaction_query = {\"input_Amount\": \"10\", \n                        \"input_Country\": \"TZN\", \n                        \"input_Currency\": \"TZS\", \n                        \"input_CustomerMSISDN\": \"000000000001\", \n                        \"input_ServiceProviderCode\": \"000000\", \n                        \"input_ThirdPartyConversationID\":'2edf7a0206d848f6b6fedea26accdc3a', \n                        \"input_TransactionReference\": 'T23434ZE5',\n                        \"input_PurchasedItemsDesc\": \"Python Book\"\n}\n\u003e\u003e\u003e mpesa.customer_to_bussiness(transaction_query)\n\nRequest processed successfully   INS-0\n{'output_ResponseCode': 'INS-0', 'output_ResponseDesc': 'Request processed successfully',\n 'output_TransactionID': 'uGnPxFoXT2W0', 'output_ConversationID': '1d1e38495dc946729a8cffb136ab8391', 'output_ThirdPartyConversationID': '2edf7a0206d848f6b6fedea26accdc3a'}\n\n```\n\n### Naming the authentication json\n\nIf you named your authentication json in other name than **keys** you might to\nspecify it while creating an instance for mpesa just as shown below;\n\n```python\n\u003e\u003e\u003e from pypesa import Mpesa\n\u003e\u003e\u003e mpesa = Mpesa(auth_path = filename)\n```\n\n## production environment\n\nThe package run by default using sandbox environment, If you wanna use it to real production\nenvironment you can specify it while creating an instance as shown below\n\n```python\n\u003e\u003e\u003e from pypesa import Mpesa\n\u003e\u003e\u003e mpesa = Mpesa(environment=\"production\")\n```\n\n## To do list\n\n- [x] Adding a well structured documentation\n- [ ] Adding a detailed test case to the implementation\n- [ ] Fixing rising bugs\n\n## Contributing\n\nWanna contribute to Pypesa ? then please [contributing.md](https://github.com/Kalebu/pypesa/blob/main/Contributing.md) to see how\n\n## Give it a star\n\nIf you found this repository useful, give it a star, You can also keep in touch with on [twitter](https://twitter.com/j_kalebu).\n\n## Bug bounty?\n\nIf you encounter **issue** with the usage of the package, feel free raise an **issue** so as\nwe can fix it as soon as possible(ASAP) or just reach me directly through my email isaackeinstein(at)gmail.com\n\n## Credit\n\nAll the credits to\n1. [kalebu](https://github.com/Kalebu/)\n2. [SentielWarren](https://github.com/SentinelWarren)\n3. and all the future contributors\n  \n\u003c/samp\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneurotech-hq%2Fpypesa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneurotech-hq%2Fpypesa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneurotech-hq%2Fpypesa/lists"}