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 hashes)
Built Distribution
Close
Hashes for bubble_client-0.7.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfdee5540b94298c704f5cd46fd5a5b59a5fe67c981640cc9dc4cec89011000a |
|
MD5 | 4e443c6a4b565125acb6c3df23cfbd19 |
|
BLAKE2b-256 | 72216861179bdabc7044f787338fdd77c3648e3c0f781fcae14b6303eb222ad9 |