Utility functions to work with Baserow
Project description
acdh-baserow-pyutils
a python client for baserow
install
pip install acdh-baserow-pyutils
how to use
Have a look into tests/test_baserow_client.py
dump all tables of a given database into JSON-FILES
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']
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
Built Distribution
Close
Hashes for acdh_baserow_pyutils-0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0533aa1e52d29ed43a3ff1ddfc0cbdc153f1fc993fa25c45ae4c95037cb9ef8 |
|
MD5 | 89c42a9b707d0612ac221844dd73fb34 |
|
BLAKE2b-256 | 24bd9f3427945c4d037c5bc9d888c293d29cd3aab52c802004b0fffe75839dde |