Metadata-Version: 2.1
Name: bubble-client
Version: 0.7.3
Summary: Python client for Bubble.io APIs
Home-page: https://github.com/Refty/bubble-client
Author: Guillaume Gelin
Author-email: guillaume@refty.co
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.7, <4
Description-Content-Type: text/markdown
License-File: LICENSE

[Bubble.io]: https://bubble.io/

Bubble-Client
=============

[![PyPI](https://img.shields.io/pypi/v/bubble-client.svg)](https://pypi.org/project/bubble-client)
[![License](https://img.shields.io/github/license/Refty/bubble-client)](LICENSE)
[![Code style](https://img.shields.io/badge/code%20style-black-black)](https://github.com/ambv/black)

Python client for the [Bubble.io][] APIs

Installation
------------

```shell
pip install bubble-client
```

Examples
--------

* Get users (or any Bubble thing, really):

```python
>>> 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:

```python
>>> user.name = "Mr. Hyde"
>>> await user.save()
>>> user.name
'Mr. Hyde'
```

* Count users:

```python
>>> User.count()
2
```

* Add a new user:

```python
>>> user = User(name="Sir Charles Emery")
>>> await user.save()
>>> User.count()
3
```

* Join stuff!

```python
>>> 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!

```python
>>> 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', ...}), ...})
```


