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.1.tar.gz
(4.4 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.1.tar.gz.
File metadata
- Download URL: kudapy-1.0.1.tar.gz
- Upload date:
- Size: 4.4 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 |
eba2890165c2d10f588de3248c72c87557634b6c0124e7b8d8440439312c78eb
|
|
| MD5 |
8366099d50f365f6c7ca2807c27c5290
|
|
| BLAKE2b-256 |
6cfb0b119fb4480a4c2dbfc9a086feed47a1f24cef39166f674f8157e53897d2
|
File details
Details for the file kudapy-1.0.1-py3-none-any.whl.
File metadata
- Download URL: kudapy-1.0.1-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 |
943d1fea1e7348474e35b6e593d3ace9b97996b2da65f211c47b83ad8a2c369b
|
|
| MD5 |
201b7faec658cb105645c9660c8cdd6c
|
|
| BLAKE2b-256 |
8826b08d516587b7cde012197fd19964ab2a9e7b9fac58969dff95a099f6c2e8
|