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
Library setup
from kudapy.base_api import kuda
import math
import random
from kuda.utils import generate_id, load_private_key, load_public_key
client_key = "name-of-private-key-file"
# load private and public keys
"""
kuda.utils contains 3 utility functions: generate_id, load_private_key and load_public_key
these are not required but would make life easier
"""
private_key = load_private_key() #you have to rename your private key .pem file to private.pem
public_key = load_public_key() #you have to rename your public key .pem file to public.pem
Making a request
#the kuda function expects at most 3 parameters: service_type, request_ref and data
#not all requests require the last parameter (data). see sample request below.
kuda(service_type, request_ref, data)
Refer to the Kuda Bank API documentation for respective SERVICE TYPES and DATA TYPES
Sample request
# Bank List
#generate a random request_reference
request_ref = math.floor(random.random() * 1000000000000 + 1)
kuda(public_key, private_key, client_key)("BANK_LIST", request_ref)
# expected response is decrypted data from Kuda API
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.2.tar.gz
(4.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kudapy-1.0.2.tar.gz.
File metadata
- Download URL: kudapy-1.0.2.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
017afda74937997b9a2189012d4cb2e84d1d2b1c2cc95f45cd638a47bd2dfbe0
|
|
| MD5 |
875215ef8581c2fd6894fcb35d20f378
|
|
| BLAKE2b-256 |
41061b927b70aa19733d83b481cb806766730234240698c30dd81174c837461f
|
File details
Details for the file kudapy-1.0.2-py3-none-any.whl.
File metadata
- Download URL: kudapy-1.0.2-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e420ade3297d2ea8df38992074779d1d7b650651cf90d9b399e1cbba2c33e72a
|
|
| MD5 |
d861b47adc957d7709ba69eb59123d60
|
|
| BLAKE2b-256 |
9456ba27dd333c55ae17c9fdd635bc9aa2c72348fd8263d6442a9f1bafb7a4d3
|