[![flake8 Lint](https://github.com/acdh-oeaw/acdh-baserow-pyutils/actions/workflows/lint.yml/badge.svg)](https://github.com/acdh-oeaw/acdh-baserow-pyutils/actions/workflows/lint.yml)
[![Test](https://github.com/acdh-oeaw/acdh-baserow-pyutils/actions/workflows/test.yml/badge.svg)](https://github.com/acdh-oeaw/acdh-baserow-pyutils/actions/workflows/test.yml)
[![codecov](https://codecov.io/github/acdh-oeaw/acdh-baserow-pyutils/branch/main/graph/badge.svg?token=8B1K7Y36HN)](https://codecov.io/github/acdh-oeaw/acdh-baserow-pyutils)
[![PyPI version](https://badge.fury.io/py/acdh-baserow-pyutils.svg)](https://badge.fury.io/py/acdh-baserow-pyutils)
# 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
```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']
```
Raw data
{
"_id": null,
"home_page": "https://github.com/acdh-oeaw/acdh-baserow-pyutils",
"name": "acdh-baserow-pyutils",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Peter Andorfer",
"author_email": "peter.andorfer@oeaw.ac.at",
"download_url": "https://files.pythonhosted.org/packages/b5/34/9cf64efff277bace4679ea5dbd6ed7e0aa0a512bcff6954d1f51440148e9/acdh_baserow_pyutils-0.10.tar.gz",
"platform": null,
"description": "[![flake8 Lint](https://github.com/acdh-oeaw/acdh-baserow-pyutils/actions/workflows/lint.yml/badge.svg)](https://github.com/acdh-oeaw/acdh-baserow-pyutils/actions/workflows/lint.yml)\n[![Test](https://github.com/acdh-oeaw/acdh-baserow-pyutils/actions/workflows/test.yml/badge.svg)](https://github.com/acdh-oeaw/acdh-baserow-pyutils/actions/workflows/test.yml)\n[![codecov](https://codecov.io/github/acdh-oeaw/acdh-baserow-pyutils/branch/main/graph/badge.svg?token=8B1K7Y36HN)](https://codecov.io/github/acdh-oeaw/acdh-baserow-pyutils)\n[![PyPI version](https://badge.fury.io/py/acdh-baserow-pyutils.svg)](https://badge.fury.io/py/acdh-baserow-pyutils)\n\n# acdh-baserow-pyutils\na python client for baserow\n\n## install\n\n`pip install acdh-baserow-pyutils`\n\n\n## how to use\n\nHave a look into `tests/test_baserow_client.py`\n\n### dump all tables of a given database into JSON-FILES\n\n```python\nimport os\nfrom acdh_baserow_utils import BaseRowClient\n\n# store baserow credentials as ENV-Variables\nBASEROW_USER = os.environ.get(\"BASEROW_USER\")\nBASEROW_PW = os.environ.get(\"BASEROW_PW\")\nBASEROW_TOKEN = os.environ.get(\"BASEROW_TOKEN\") # you need to create a token via baserow\nDATABASE_ID = \"41426\" # you can get this ID from Baserow\n\n# initialize the client\nbr_client = BaseRowClient(BASEROW_USER, BASEROW_PW, BASEROW_TOKEN)\n\n# 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\nfiles = br_client.dump_tables_as_json(DATABASE_ID, folder_name='out')\nprint(files)\n# ['out/place.json', 'out/person.json', 'out/profession.json']\n```\n\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Utility functions to work with Baserow",
"version": "0.10",
"project_urls": {
"Homepage": "https://github.com/acdh-oeaw/acdh-baserow-pyutils"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a5bc6e9e692c385e7fca699fc917bc6fd18a9f2fadff6f940fb93f2a9ef05829",
"md5": "b96a63d6f5d0fc24125569b356045be7",
"sha256": "d27788e59706a44399f84d5ca6662e86c38bb230c97bb3015e51064d2b3f4754"
},
"downloads": -1,
"filename": "acdh_baserow_pyutils-0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b96a63d6f5d0fc24125569b356045be7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 5898,
"upload_time": "2024-09-26T13:03:48",
"upload_time_iso_8601": "2024-09-26T13:03:48.934179Z",
"url": "https://files.pythonhosted.org/packages/a5/bc/6e9e692c385e7fca699fc917bc6fd18a9f2fadff6f940fb93f2a9ef05829/acdh_baserow_pyutils-0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b5349cf64efff277bace4679ea5dbd6ed7e0aa0a512bcff6954d1f51440148e9",
"md5": "0ed396d1ef856074aeadd6f06b94b4b0",
"sha256": "d8f0a056dc9a56158e0074f44a498a20d43e1db33c5584ab2d074b16b83268b1"
},
"downloads": -1,
"filename": "acdh_baserow_pyutils-0.10.tar.gz",
"has_sig": false,
"md5_digest": "0ed396d1ef856074aeadd6f06b94b4b0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 5695,
"upload_time": "2024-09-26T13:03:50",
"upload_time_iso_8601": "2024-09-26T13:03:50.158539Z",
"url": "https://files.pythonhosted.org/packages/b5/34/9cf64efff277bace4679ea5dbd6ed7e0aa0a512bcff6954d1f51440148e9/acdh_baserow_pyutils-0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-26 13:03:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "acdh-oeaw",
"github_project": "acdh-baserow-pyutils",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "acdh-baserow-pyutils"
}