Skip to main content

Python client for Qwhale API

Project description

qwhale-client

This is the official python client library

The library is simple, all you need is a TOKEN that you can get from our website hare and that it! you are ready to work with our service.

The library works with pymongo so you can use it like you use to.

code example

from qwhale_client import APIClient

TOKEN = "<YOUR API TOKEN>"

client = APIClient(TOKEN)

with client as database:
    print(client.activated)  # -> True
    database["test"].insert_one({"key": "value", "extra": "123456"})
    document = database["test"].find_one({"key": "value"})
    print(document)  # -> {"_id": ObjectId(...), "key": "value", "extra": "123456"}

print(client.activated)  # -> False

Another code example

from qwhale_client import APIClient

TOKEN = "<YOUR API TOKEN>"

client = APIClient(TOKEN)

database = client.get_database()
print(client.activated)  # -> True

database["test"].insert_one({"key": "value", "extra": "123456"})
document = database["test"].find_one({"key": "value"})
print(document)  # -> {"_id": ObjectId(...), "key": "value", "extra": "123456"}

print(client.close())  # -> {'data_saved': True}
print(client.activated)  # -> False

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

qwhale_client-0.1.20.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

qwhale_client-0.1.20-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page