Skip to main content

a simple to use mpesa module around the daraja api

Project description

Daraja - Easy to use functions around M-Pesa Daraja API

PyPI version

This module provides functions around the daraja api to simplify the whole integration process.

This is what you need to do:

  1. Fill out the config.json file with your credentials from Daraja dashboard.

  2. Install daraja with pip install daraja

  3. Import the mpesa module from daraja like so:

from daraja import mpesa
  1. Instantiate a Mpesa object with only two parameters, the config.json file and your environment(either dev or prod)
...

mpesa = mpesa.Mpesa(config_file="config.json", env="prod")
  1. Use the Mpesa object to do stuff, like so:
...
response = mpesa.stk(receiver="254791500264, amount=50)
print(response)

I am working on implementing the remaining endpoints and even right now this does not work functionally well and i am working to solve the issue.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

daraja-0.0.1.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

daraja-0.0.1-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page