Skip to main content

A Python client for NocoDB, The Open Source Airtable Alternative.

Project description

PyNoco

A Python client for NocoDB, The Open Source Airtable Alternative. This library provides an easy-to-use interface for interacting with NocoDB's API, allowing you to manage your databases, tables, and records seamlessly.

Features

  • Connect to NocoDB and perform CRUD operations on bases.
  • Fetch, create, update, and delete records with simple method calls.
  • Support for custom queries and filters.

Installation

To install the SDK, use pip:

pip install pynoco

Getting Started

  1. Initialize the Client

To get started, you'll need to initialize the Client with your API access token. If you're using a different server, you can also specify a custom base URL.

from pynoco.client import Client

# Custom NocoDB Server
base_url = 'https://app.nocodb.com'
client = Client("YOUR_TOKEN", base_url)
  1. Creating a Source

You can connect to various sources, such as MySQL, by configuring your source data. Use the Source object to define the connection details for your data source.

from pynoco.source import Source

mysql_source = Source(
    id='my_unique_id',
    base_id='base_id',
    type='mysql',
    inflection_column='camelize',
    inflection_table='camelize',
    order=2,
    config='YOUR_DATABASE_CONFIG'
)
  1. Creating a Base

You can create a base and associate it with a source.

# Create a base with a source
base = client.bases.create('base_name', sources=[mysql_source])

You can also add a source to an existing base:

# Create a base without a source
base2 = client.bases.create('base_name')

# Add a source to the base
base2.add_source(mysql_source)

Managing Bases

You can create a base.

base = client.bases.create(base_name='base_name', sources=[mysql_source])

To update a base, specify the new name, color, and order.

base.update(
    title='new_name',
    order=4,
    color='#24716E'
)

List Bases

You can list all the bases you’ve created.

print(client.bases.list())

Get a Base by ID

You can fetch details of a base by its name.

base = client.bases.get('p#######')

Remove a Base

To delete a base, use the following command:

client.bases.drop('p#######')

Contributing

Contributions are welcome! If you have suggestions or improvements, please create a pull request or open an issue.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

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

pynoco-1.0.0.tar.gz (5.0 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: pynoco-1.0.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for pynoco-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c371b64e6992ca1a5f2134b70aafae280f9b95594e6e139863837b748e7a4ce7
MD5 ce03f1e326a0077fc4768904f7e46713
BLAKE2b-256 2e2bcb973e7c936c97c7f980c19f87885b1ccaefe8ae44606b5867c933e998c6

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 Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page