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
pip3 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
kuda = kuda(public_key, private_key, client_key) # this initializes the Kuda function
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.tar.gz
(4.8 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
kudapy-1.0-py3-none-any.whl
(6.4 kB
view details)
File details
Details for the file kudapy-1.0.tar.gz.
File metadata
- Download URL: kudapy-1.0.tar.gz
- Upload date:
- Size: 4.8 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 |
f509537a3490c99c3b9f4fa400f5b3ab3ab49caaf8d69860c7d6cef80fe67927
|
|
| MD5 |
bcf24c037e09f0f4644a589766ede97f
|
|
| BLAKE2b-256 |
e1f16af87fc8ba68c359d12b14af17bf501f3e2140a974c02341f9a93b24eee2
|
File details
Details for the file kudapy-1.0-py3-none-any.whl.
File metadata
- Download URL: kudapy-1.0-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 |
584c18919019aad008e4db7421b27416ff8fd3e75d98b8375ac2fe3ecb81b05a
|
|
| MD5 |
ae1aa68895eb8bd7afe6026bb856f7ca
|
|
| BLAKE2b-256 |
ee04df8928a05b4cb10f696498e03241a0cc86588b70f8beace85823ce9cf4e2
|