Skip to main content

Python wrapper for making secure requests to Kuda API

Project description

kudapy

Python wrapper for making secure requests to Kuda API

Getting started

  • register on kuda bank website to recieve public and private keys in xml format
  • paste your private and public keys (both in PEM format) in your project directory - both keys come in XML format(YOU NEED TO CONVERT FROM XML TO PEM)
  • Your client key is the name of your private key file sent after registration on kuda bank website.

Installation

pip install kudapy

Making a request

from kudapy import kuda

"""
Save your public and private pem file somewhere on the filesystem. Specify the full path to your keys
then create a Kuda Object instance. Also provide a client key string and base url (for production).
"""

kuda_instance = Kuda(path_to_public_key, path_to_private_key, client_key_string, base_url)


#Use the kuda instance to call the appropiate methods of the 
#action you want to perform.

#For available actions run help(kuda)

Sample requests

# List of banks
kuda_instance.bank_list()

-------------------------

# Name enquiry
kuda_instance.name_enquiry("1100000734", "999129")

-------------------------

# Create a virtual account 
# (Provide email, phone, lastname, firstname)

kuda_instance.create_virtual_account(
    "okonkwo_yusuf@kudabank.com", 
    "07011111111",
    "Okonkwo",
    "Yusuf"
)
--------------

## Expected response is decrypted data from Kuda API in JSON

"""
You get back two values from the method calls, status and data. If status is true, there is a valid response data else
the status will be False - with data being the error message.
"""

status, data = kuda_instance.bank_list()
(True, {'Status': True, 'Message': 'Completed Successfully', ...})

or
status, data = kuda_instance.name_enquiry('0000000000', 999000')
(False, 'Cannot validate account number at this time, Please try again')

Contribution & Issues

  • Simply fork the repo, make changes and make a pull request
  • You can open an issue for support or suggestions

Author

Acknowledgements

  • Kuda Bank Team
  • Cowrywise Team

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

kudapy-1.0.5.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kudapy-1.0.5-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file kudapy-1.0.5.tar.gz.

File metadata

  • Download URL: kudapy-1.0.5.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for kudapy-1.0.5.tar.gz
Algorithm Hash digest
SHA256 61ed145f1511c0efdf0581e82643421aa70ab9a6bc64fdaa39ef6a902d4e60f4
MD5 1a83404c040ca16b954a1f922cc1b4b8
BLAKE2b-256 c2792ce4fcfc625353f60fd9736e4fabc6ed13d25b7ce564f5b60039873a2589

See more details on using hashes here.

File details

Details for the file kudapy-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: kudapy-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for kudapy-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2e3a65426df3481610a0461216b2564f9ba6c2ccc325325adebabc5d1734778c
MD5 54ef67c0d331b86aaf096ed652926f17
BLAKE2b-256 202d7744af4956710689ee92a2a4cb1b9f948c70936d4293b35cd46600f3d935

See more details on using hashes here.

Supported by

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