{"library":"rapidata","title":"Rapidata Python Client","description":"The `rapidata` package provides a Python client to easily interact with the Rapidata Web API, enabling users to programmatically request human annotation for their data. It simplifies creating and managing orders for various human-in-the-loop tasks. The current version is 3.8.0, and the library appears to be under active development with regular updates, supporting Python 3.10 and newer.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install -U rapidata"],"cli":null},"imports":["from rapidata import RapidataClient","from rapidata import rapidata_config"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom rapidata import RapidataClient\n\n# Option 1: Interactive login (opens browser)\n# client = RapidataClient()\n\n# Option 2: Using client ID and secret (recommended for automation)\nclient_id = os.environ.get('RAPIDATA_CLIENT_ID', 'your_client_id_here')\nclient_secret = os.environ.get('RAPIDATA_CLIENT_SECRET', 'your_client_secret_here')\n\nif client_id == 'your_client_id_here' or client_secret == 'your_client_secret_here':\n    print(\"Please set RAPIDATA_CLIENT_ID and RAPIDATA_CLIENT_SECRET environment variables or replace placeholders.\")\n    # Fallback to interactive login for demonstration if env vars are not set\n    # client = RapidataClient() # Uncomment for interactive flow if env vars are missing\nelse:\n    client = RapidataClient(client_id=client_id, client_secret=client_secret)\n\n# Example: Create a simple compare order (requires actual data and context)\n# This is a placeholder as full order creation requires specific data inputs\ntry:\n    # This part is illustrative as it requires actual data (datapoints) and URLs\n    # order_name = \"My Example Alignment Order\"\n    # instruction = \"Which image matches the description better?\"\n    # contexts = [\"A small blue book sitting on a large red book.\"]\n    # datapoints = [[\"https://example.com/image1.jpg\", \"https://example.com/image2.jpg\"]]\n    # order = client.order.create_compare_order(\n    #     name=order_name,\n    #     instruction=instruction,\n    #     contexts=contexts,\n    #     datapoints=datapoints\n    # )\n    # print(f\"Order created: {order.name} (ID: {order.id})\")\n    print(\"RapidataClient initialized. You can now use client.order, client.validation, etc.\")\nexcept Exception as e:\n    print(f\"Could not create order example (requires valid credentials and data): {e}\")\n\n# To reset credentials saved locally:\n# client.reset_credentials()\n","lang":"python","description":"Initializes the `RapidataClient` for interacting with the API. It demonstrates both interactive login (which opens a browser for authentication) and programmatic authentication using `client_id` and `client_secret` environment variables or direct arguments. Once authenticated, the client provides managers for `order` and `validation` operations. An illustrative (commented out) example of creating a compare order is included to show typical usage, noting that actual data points and valid URLs are required.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}