A python library to consume Rattify API
Project description
rattifyapi-python
Python plugin for RattifApi View on pypi.python.org
Installation
pip install rattifyapi
Example
from rattifyapi.rattify import Rattify
secret_key = "rt_test_4973"
rattify = Rattify(secret_key=secret_key)
# to use transaction class
print(rattify.user.list())
# initiate a generic
data = {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@email.com",
"date_of_birth": "2000-12-24",
"country": "Ghana",
}
print(rattify.generic.initialize(data))
# get user
print(rattify.user.verify(reference="e1b6679c5aad4bd3999953ac78e677a79d28d539085e409ebde1be640ebc27e7"))
Static Use
To start using the Rattify Python API, you need to start by setting your secret key.
You can set your secret key in your environment by running:
export SECRET_KEY = 'your_secret_secret_key'
After exporting the keys, you can use the api like this
from rattifyapi.generic import Generic
from rattifyapi.users import User
# list users
print(User.list())
# initiate a generic
data = {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@email.com",
"date_of_birth": "2000-12-24",
"country": "Ghana",
}
print(Generic.initialize(data))
# get user
print(User.verify(reference="reference"))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file rattifyapi-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: rattifyapi-0.2.2-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ff87dd00455fab327612e9e88d960161582083561add07639349b1821e37aa4 |
|
MD5 | 08b45cb70486f19552ef2a15f3626690 |
|
BLAKE2b-256 | e04e35361b9f31fed0d94c6662d1af1d1307bc6732220bcf3619033fbd195153 |