Skip to main content

Baserow OpenAPI Python SDK

Project description

Baserowsdk

Requirements

python3.8 +

Installation

pip install --upgrade baserowsdk

Getting started

初始化客户端

from baserowsdk import Client

client = Client(
    api_key="your_api_key",
    base_url="http://your.baserow.domain"
)

获取字段信息

# 获取表的所有字段定义
fields = client.fields(table_id=182)
print(fields)

查询数据

# 单条查询
row = client.row(table_id=182, row_id=1)
print(row)

# 批量查询
base = client.base(39)
rows = base.table(182).select(page_size=100)
print(rows)

创建数据

# 创建新记录
row = client.base(39).table(182).create(
    fields={"执行批次ID": "1234567890"}
)
print(row)

更新数据

# 更新记录
updated_row = client.base(39).table(182).update(
    row_id=6,
    fields={
        "执行批次ID": "BATCH-001",
        "测试用例": [1, 2, 3]  # 关联字段支持多值
    },
    user_field_names=True  # 使用用户定义的字段名
)
print(updated_row)

删除数据

# 删除记录
client.base(39).table(182).delete(row_id=7)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

baserowsdk-0.0.4.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

baserowsdk-0.0.4-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file baserowsdk-0.0.4.tar.gz.

File metadata

  • Download URL: baserowsdk-0.0.4.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Darwin/23.5.0

File hashes

Hashes for baserowsdk-0.0.4.tar.gz
Algorithm Hash digest
SHA256 40b53ab3d39c9aeee24af1b3f6e866f2cf7d8a436cac3fe95fe4b5d80edd7464
MD5 e2eb24597fe4a7ee0501f970ef6bcf2f
BLAKE2b-256 71fbd9b6f9329106525277364bb2e34856b9964bfecdd9c76dce25801d8b87c2

See more details on using hashes here.

File details

Details for the file baserowsdk-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: baserowsdk-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Darwin/23.5.0

File hashes

Hashes for baserowsdk-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 03dfdfbba9926c6e30a514c00f4782c3c95eb9bc1f03f0d26a569f4203e32edb
MD5 e12b05b51da5e7502be0c0ea8711a2f1
BLAKE2b-256 788f8d2f95459c716efc8b77c8d17a5bd7f0bf59c7c8afafe083b205ccd93451

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page