Python client for Bubble.io APIs
Project description
Bubble-Client
Python client for the Bubble.io APIs
Installation
pip install bubble-client
Examples
- Get users (or any Bubble thing, really):
>>> from bubble_client import configure, BubbleThing
>>> configure(base_url=..., token=...)
>>> class User(BubbleThing):
... pass
>>> async for user in User.get():
... print(user)
User({'name': 'Beatrix Emery', ...})
User({'name': 'Dr. Jekyll', ...})
>>> user.name
'Dr. Jekyll'
- Change values:
>>> user.name = "Mr. Hyde"
>>> await user.save()
>>> user.name
'Mr. Hyde'
- Count users:
>>> User.count()
2
- Add a new user:
>>> user = User(name="Sir Charles Emery")
>>> await user.save()
>>> User.count()
3
- Join stuff!
>>> class Pet(BubbleThing):
... pass
>>> pet = await pet.get_one()
>>> await pet.join("created_by", User)
>>> pet.type
'dog'
>>> pet.created_by
User({'name': 'Mr. Hyde', ...})
>>> pet.created_by.name
'Mr. Hyde'
- Also works on cursors!
>>> async for pet in Pet.get().join("created_by", User):
... print(pet)
Pet({'type': 'dog', 'created_by': User({'name': 'Mr. Hyde', ...}), ...})
Pet({'type': 'donkey', 'created_by': User({'name': 'Beatrix Emery', ...}), ...})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bubble-client-0.7.3.tar.gz
(4.6 kB
view details)
Built Distribution
File details
Details for the file bubble-client-0.7.3.tar.gz
.
File metadata
- Download URL: bubble-client-0.7.3.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78fea899bd5770f2a13ca1703e5125c0942d8e46209520b92a0913bce8819abe |
|
MD5 | e082095ba4f24f7b8693e21290d4fbf3 |
|
BLAKE2b-256 | aff5f50850b426e5c11fe3581ac674f4fcfaea9fdbce66d82497d54e5a43e620 |
File details
Details for the file bubble_client-0.7.3-py2.py3-none-any.whl
.
File metadata
- Download URL: bubble_client-0.7.3-py2.py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfdee5540b94298c704f5cd46fd5a5b59a5fe67c981640cc9dc4cec89011000a |
|
MD5 | 4e443c6a4b565125acb6c3df23cfbd19 |
|
BLAKE2b-256 | 72216861179bdabc7044f787338fdd77c3648e3c0f781fcae14b6303eb222ad9 |