Skip to main content

A Python SDK for GiftBit's API

Project description

giftbit-python

A Python SDK for GiftBit's API.

Installation

$ pip install giftbit

Getting Started

API Credentials

The GiftbitClient needs your Giftbit credentials. You can pass them into the constructor or use the environment variable GIFTBIT_API_KEY.

from giftbit import GiftbitClient

client = GiftbitClient(api_key="<your api key here>")

# or using the environment variable
client = GiftbitClient()

By default, the GiftbitClient uses Giftbit's testbed API. To use the production API server, do the following:

from giftbit import GiftbitClient, 

client = GiftbitClient(testbed=False)

You can check to see if the client is configured correctly by using the ping method

from giftbit import GiftbitClient, 

client = GiftbitClient(testbed=False)

result = client.ping()

print(result)

Brands

List Brands

from giftbit import GiftbitClient, 

client = GiftbitClient()

result = client.list_brands()

for brand in result['brands']:
    print(brand['name'])

Get Individual Brand

from giftbit import GiftbitClient, 

client = GiftbitClient()

result = client.get_brand('amazonus')

print(result['brand'])

Regions

Not implemented yet

Campaigns

Not implemented yet

Funds

Not implemented yet

Gifts

Not implemented yet

Links

Not implemented yet

Project details


Release history Release notifications

This version
History Node

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
giftbit-0.1-py3-none-any.whl (3.9 kB) Copy SHA256 hash SHA256 Wheel py3 Jun 7, 2018
giftbit-0.1.tar.gz (3.1 kB) Copy SHA256 hash SHA256 Source None Jun 7, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page