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.6.2.tar.gz
(4.7 kB
view hashes)
Built Distribution
Close
Hashes for bubble_client-0.6.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 329bffd7c5c7898412220b93e39dad0149482dbad1d5c3d3e4373b896da2096f |
|
MD5 | d9ae4a1ddb4a34d89a4ab455bb1d0b05 |
|
BLAKE2b-256 | 5815fedc537a1b3169c133d054e1fc8c071667725c0e03488eece346648113f2 |