Skip to main content

A Python package to operate with Feishu/Lark bitable

Project description

python-bitable

A Python package to operate with Feishu/Lark bitable

Install

pip install python-bitable

Usage

Quick Start

from bitable import Table

table = Table(BASE_ID, BASE_TOKEN, 'TABLE_NAME')

# select records
records = table.select() # select all records
records = table.select({'field_name1': 'value1', 'field_name2': 'value2'}) # select with conditions
records = table.select(Greater('FieldValue', 90))
records = table.select(Or(Greater('FieldValue', 90), And({'FieldSingle': 'A'}, Contain('FieldText', 'text_value')))) # select with complex conditions

# insert records
table.insert({'field_name1': 'value1', 'field_name2': 'value2'}) # insert a record
table.insert([{'field_name1': 'value1', 'field_name2': 'value2'}, {'field_name1': 'value3', 'field_name2': 'value4'}]) # insert multiple records

# update records
table.update({'FieldMultiple': ['B', 'A'], 'FieldDate':'2024-12-21'}, where={'FieldText': 'text_value'}) # update records with where conditions
result = table.select({'FieldText': 'HelloTestUpdate'})[0]
result['FieldText'] = 'new_value'
table.update(result) # update records with record object

# delete records
self.table.delete(where={'FieldText': 'HelloDelete'}) # with where condition
result = table.select({'FieldText': 'HelloTestUpdate'})[0]
self.table.delete(results) # with selected object

Load a table

from bitable import Table

table = Table(BASE_ID, BASE_TOKEN, 'TABLE_NAME')

BASE_ID can be found at the bitable's URL after 'base/'
BASE_ID on URL

BASE_TOKEN can be found following these steps:

  1. click the "Base extensions" icon on the top right:

  2. click "Customize" on the bottom right Base extension and customize

  3. click "Get Authorization Code" Get Authorization Code

Select Records

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

bitable-1.0.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

bitable-1.0.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file bitable-1.0.0.tar.gz.

File metadata

  • Download URL: bitable-1.0.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for bitable-1.0.0.tar.gz
Algorithm Hash digest
SHA256 380ca34c296f84c5d7393131d80d22b1b0af12f50e0f1518ed5dce3a364a7bc0
MD5 eb62ce25492e389f3b35a526ec57675d
BLAKE2b-256 869777bc292952fc8353630c4e9bfc32c1c0fe9a5ae94172beef0ced9f5050f7

See more details on using hashes here.

File details

Details for the file bitable-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: bitable-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for bitable-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 612366dae763c57401dbeae38a68b7257ee3d69a76f3c94c12debc97f87a6487
MD5 d6ecda10a4759824352876aea2173101
BLAKE2b-256 567d7075fd0ae727ea74c9e8801e8f798e7a49d334e1908319ff0c71e83b4c8c

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