Tremendous Api Client client is a Python library to access services quickly.
Use the package manager pip to install foobar.
pip install TremendousClient
TREMENDOUS_ENV: 'dev|prod'
TREMENDOUS_TOKEN: 'TREMENDOUS TOKEN'
If you don't want to set this variables from global environment you can pass them to class. You can see usage below
from tremendous import TremendousService
kwargs = {
# you can also set tremendous environment from environment.
'environment': 'dev|prod', # Default value : dev
# you can also set token from environment.
'token': 'tremendous token', # Default value : None
}
# Initialize client with
tremendous_service = TremendousService()
# or tremendous_service = TremendousService(**kwargs)
# For Products
products = tremendous_service.getProducts()
# For Funding Source
funding_source = tremendous_service.getFundingSource()
# For Create Order
body = {
"payment": {
"funding_source_id": "funding_source_id"
},
"rewards": [
{
"products": [
"product_id"
],
"value": {
"denomination": 2,
"currency_code": "USD"
},
"recipient": {
"name": "John Doe Jr.",
"email": "[email protected]"
},
"delivery": {
"method": "LINK"
}
}
]
}
order = tremendous_service.createOrder(body)
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.