{"id":9140,"library":"nocodb-simple-client","title":"NocoDB Simple Client","description":"A simple and powerful Python client for the NocoDB REST API, allowing interaction with NocoDB projects, tables, and records. It handles API authentication and provides a Pythonic interface for CRUD operations. The current version is 1.3.2, and it follows NocoDB's API changes with new releases.","status":"active","version":"1.3.2","language":"en","source_language":"en","source_url":"https://github.com/bauer-group/LIB-NocoDB_SimpleClient","tags":["NocoDB","database","ORM","client","API"],"install":[{"cmd":"pip install nocodb-simple-client","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"NocoDBClient","correct":"from nocodb_simple_client import NocoDBClient"}],"quickstart":{"code":"import os\nfrom nocodb_simple_client import NocoDBClient\n\n# It is recommended to use environment variables for sensitive data\nBASE_URL = os.environ.get(\"NOCODB_BASE_URL\", \"http://localhost:8080\")\nAUTH_TOKEN = os.environ.get(\"NOCODB_AUTH_TOKEN\", \"YOUR_AUTH_TOKEN_HERE\") # X-NocoDB-Auth token\nPROJECT_ID = os.environ.get(\"NOCODB_PROJECT_ID\", \"p00000000000000000000000000\") # Replace with your actual Project ID\n\ntry:\n    client = NocoDBClient(\n        base_url=BASE_URL,\n        auth_token=AUTH_TOKEN,\n        project_id=PROJECT_ID\n    )\n\n    # Example: List all tables in the project\n    # This requires the AUTH_TOKEN and PROJECT_ID to be valid.\n    tables_response = client.tables.list()\n    print(f\"Tables in project: {[t['title'] for t in tables_response.get('list', [])]}\")\n\n    # Example: Get records from a specific table\n    # Replace 'MyTable' with an actual table name from your NocoDB project\n    TABLE_NAME = os.environ.get(\"NOCODB_EXAMPLE_TABLE\", \"TestTable\")\n    print(f\"\\nAttempting to fetch records from table: {TABLE_NAME}\")\n    records = client.tables.get_all(TABLE_NAME)\n    print(f\"First 3 records from {TABLE_NAME}: {records[:3]}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Please ensure NOCODB_BASE_URL, NOCODB_AUTH_TOKEN, and NOCODB_PROJECT_ID are correctly set.\")\n    print(\"Also verify the NOCODB_EXAMPLE_TABLE exists and is accessible by the provided token.\")","lang":"python","description":"Initializes the NocoDB client using environment variables for sensitive details, then lists tables and fetches records from an example table. This helps verify basic connectivity and authentication."},"warnings":[{"fix":"Ensure your `nocodb-simple-client` version is compatible with your NocoDB backend version. Consult the client's release notes and NocoDB's changelog to match versions.","message":"The client adapts to NocoDB API changes. Client versions 1.2.0+ support NocoDB v0.90.0+ APIs, and 1.3.0+ support NocoDB v0.103.0+. Older client versions or older NocoDB instances may lead to API incompatibility.","severity":"breaking","affected_versions":"1.2.0+, 1.3.0+"},{"fix":"Always retrieve the NocoDB record ID (often named `id` or `uuid` in the NocoDB response) from a `get` operation before attempting `update` or `delete`.","message":"When performing `update` or `delete` operations, NocoDB requires its internal record ID (e.g., `rec_xxxxxxxxxxxxxx`), not a custom primary key from your table.","severity":"gotcha","affected_versions":"All"},{"fix":"Double-check that `NOCODB_BASE_URL` points to your NocoDB instance, `NOCODB_AUTH_TOKEN` is the correct global `X-NocoDB-Auth` token, and `NOCODB_PROJECT_ID` is your project's internal ID. Ensure the NocoDB server is running and accessible.","message":"Incorrect `base_url`, `auth_token`, or `project_id` will lead to authentication failures or 'Project not found' errors. The `auth_token` must be the `X-NocoDB-Auth` token from your NocoDB instance, not a personal access token.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Verify that your `NOCODB_PROJECT_ID` is correct and that your `NOCODB_AUTH_TOKEN` has the necessary permissions for that project. Check the NocoDB UI for the exact project ID and token.","cause":"The provided `project_id` does not exist or the `auth_token` does not have access to it.","error":"NocoDB API Error: {'msg': 'Project not found', 'status': 404}"},{"fix":"Ensure your `NOCODB_AUTH_TOKEN` is the correct `X-NocoDB-Auth` token (global API token) for your NocoDB instance and is still valid. Regenerate it if necessary.","cause":"The `auth_token` is incorrect, expired, or missing.","error":"NocoDB API Error: {'msg': 'Authentication failed', 'status': 401}"},{"fix":"Check the exact spelling and case of the table name. Verify the table exists in the NocoDB project associated with the `project_id` and that the provided `auth_token` has access.","cause":"The specified table name does not exist in the project or is misspelled, or the `auth_token` lacks permissions to access it.","error":"NocoDB API Error: {'msg': 'Table not found', 'status': 404}"},{"fix":"Inspect the structure of the record object returned by NocoDB to confirm the exact field names and their casing (e.g., `print(records[0])`). NocoDB field names are case-sensitive.","cause":"Trying to access a field name that doesn't exist or has a different case in the NocoDB record response.","error":"KeyError: 'some_field_name'"}]}