acdh-baserow-pyutils-0.2.1
توضیحات
Utility functions to work with Baserow
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | acdh-baserow-pyutils-0.2.1 |
| نام | acdh-baserow-pyutils |
| نسخه کتابخانه | 0.2.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Peter Andorfer |
| ایمیل نویسنده | peter.andorfer@oeaw.ac.at |
| آدرس صفحه اصلی | https://github.com/acdh-oeaw/acdh-baserow-pyutils |
| آدرس اینترنتی | https://pypi.org/project/acdh-baserow-pyutils/ |
| مجوز | MIT license |
[](https://github.com/acdh-oeaw/acdh-baserow-pyutils/actions/workflows/lint.yml)
[](https://github.com/acdh-oeaw/acdh-baserow-pyutils/actions/workflows/test.yml)
[](https://codecov.io/github/acdh-oeaw/acdh-baserow-pyutils)
[](https://badge.fury.io/py/acdh-baserow-pyutils)
# acdh-baserow-pyutils
a python client for baserow
## install
`pip install acdh-baserow-client`
## how to use
Have a look into `tests/test_baserow_client.py`
### dump all tables of a given database into JSON-FILES
```python
import os
from acdh_baserow_utils import BaseRowClient
# store baserow credentials as ENV-Variables
BASEROW_USER = os.environ.get("BASEROW_USER")
BASEROW_PW = os.environ.get("BASEROW_PW")
BASEROW_TOKEN = os.environ.get("BASEROW_TOKEN") # you need to create a token via baserow
DATABASE_ID = "41426" # you can get this ID from Baserow
# initialize the client
br_client = BaseRowClient(BASEROW_USER, BASEROW_PW, BASEROW_TOKEN)
# writes all tables from Database as json.files into a folder 'out' (the folder needs to exist!) and returns a list of the file names
files = br_client.dump_tables_as_json(DATABASE_ID, folder_name='out')
print(files)
# ['out/place.json', 'out/person.json', 'out/profession.json']
```
نیازمندی
| مقدار | نام |
|---|---|
| <3,>=2.20.0 | requests |
| <1,>=0.6 | acdh-id-reconciler |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8 | Python |
نحوه نصب
نصب پکیج whl acdh-baserow-pyutils-0.2.1:
pip install acdh-baserow-pyutils-0.2.1.whl
نصب پکیج tar.gz acdh-baserow-pyutils-0.2.1:
pip install acdh-baserow-pyutils-0.2.1.tar.gz