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.3.tar.gz
(4.2 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.3.tar.gz.
File metadata
- Download URL: kudapy-1.0.3.tar.gz
- Upload date:
- Size: 4.2 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 |
a7e62695a43586032886dd884d7227fa73050a4671cebfeb932c5515a6f72613
|
|
| MD5 |
82206e83d34d07f3475b1f5fee4c66f8
|
|
| BLAKE2b-256 |
dc1129d18f0868bbd840a341f15ea6fac064c58550165146740735065701bb7e
|
File details
Details for the file kudapy-1.0.3-py3-none-any.whl.
File metadata
- Download URL: kudapy-1.0.3-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 |
348affd57dd443d6b3dcf6941c7273222a4658c2fcdd03dccb29f90621969237
|
|
| MD5 |
845c16d74e5215dee6a11f68b5132793
|
|
| BLAKE2b-256 |
159634afee8293b0ecd0238696cb9b96d8a16dfe4955d2da39c5a61d72d8d487
|