{"library":"polytomic","title":"Polytomic Python Client","description":"The Polytomic Python library provides convenient access to the Polytomic API for managing ETL, ELT, Reverse ETL, and general data syncing between various systems. It supports integration with data warehouses, databases, cloud applications, and HTTP APIs. The library is actively maintained, frequently updated to support new features and integrations, and is currently at version 1.17.1.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install polytomic"],"cli":null},"imports":["from polytomic.client import Polytomic","from polytomic.client import AsyncPolytomic","from polytomic import BulkSchedule"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom polytomic.client import Polytomic\nfrom polytomic import BulkSchedule\n\n# Best practice: Load token from environment variable\nPOLYTOMIC_TOKEN = os.environ.get('POLYTOMIC_TOKEN', 'YOUR_POLYTOMIC_API_KEY')\n\nif POLYTOMIC_TOKEN == 'YOUR_POLYTOMIC_API_KEY':\n    print(\"Please set the POLYTOMIC_TOKEN environment variable or replace 'YOUR_POLYTOMIC_API_KEY'.\")\nelse:\n    try:\n        client = Polytomic(token=POLYTOMIC_TOKEN)\n\n        # Example: Listing bulk syncs (replace with actual API call relevant to your use case)\n        bulk_syncs = client.bulk_sync.list()\n        print(f\"Successfully connected. Found {len(bulk_syncs.data)} bulk syncs.\")\n\n        # Example of creating a bulk sync (dummy data for illustration, needs valid IDs)\n        # try:\n        #     new_sync = client.bulk_sync.create(\n        #         destination_connection_id=\"248df4b7-aa70-47b8-a036-33ac447e668d\", # Replace with actual ID\n        #         mode=\"replicate\",\n        #         name=\"My New Bulk Sync\",\n        #         schedule=BulkSchedule(frequency=\"manual\"),\n        #         source_connection_id=\"248df4b7-aa70-47b8-a036-33ac447e668d\", # Replace with actual ID\n        #     )\n        #     print(f\"Created new bulk sync with ID: {new_sync.data.id}\")\n        # except Exception as e:\n        #     print(f\"Error creating bulk sync: {e}\")\n\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to initialize the Polytomic client and make a basic API call to list bulk syncs. It uses an environment variable for the API token for security best practices. To run the commented-out `create` example, you would need valid connection IDs from your Polytomic account.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}