Skip to main content

python sdk for nocodb restful api

Project description

description

A wrapper to access nocodb restful api using httpx

functions

test with nocodb v0.255.0

API endpoint
sub module
list read update create delete links
Auth ❌︎ -
Users for base -
Bases -
Record
Table -
Column ❌︎ ❌︎ ❌︎ -
View ❌︎ ❌︎ ❌︎ ❌︎ ❌︎ -

example

sync mode

from pynocodb import Client
from rich import print


def run_sync():
    # here we use an api token.
    # you can do client.auth.signin to use auth token instead
    client = Client(token="YzDNLisEZQ4AuId1i9sodHbDC2eEJxadiAlRUHXu")

    bases = client.base.get_base_ids()
    print(bases)
    base_id = list(bases.values())[0]
    tables = client.table.get_table_ids(base_id)
    print(tables)
    table_id = list(tables.values())[0]
    print(client.record.list_records(table_id)["list"])


if __name__ == "__main__":
    run_sync()

async mode

import asyncio

from pynocodb import AsyncClient
from rich import print


async def run_async():
    client = AsyncClient()
    await client.auth.signin("liunux@qq.com", "r_PypPUajC6y!2B")

    bases = await client.base.get_base_ids()
    print(bases)
    base_id = list(bases.values())[0]
    tables = await client.table.get_table_ids(base_id)
    print(tables)
    table_id = list(tables.values())[0]
    print((await client.record.list_records(table_id))["list"])


if __name__ == "__main__":
    asyncio.run(run_async())

TODOs:

  • use pydantic to define schemas for table, column, source, base, etc.
  • support column creation & update
  • support view creation & update

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pynocodb-0.1.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file pynocodb-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pynocodb-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for pynocodb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5056ee6480d77a26242c2eaeb220663fc49c5c0e0b5c5479a156e802da07cc3
MD5 dcbf9e0a1b25ac1e27aac36924f26c4b
BLAKE2b-256 87b0895f84e317fa17dc8b14857f41b7a65f0108616c6c2b6540759fba6c87ca

See more details on using hashes here.

Supported by

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