{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["code-snippet"]},"type":"markdown"},"seo":{"title":"Python Example","description":"API documentation for Celonis APIs.","siteUrl":"https://developer.celonis.com/","keywords":"celonis developer portal, celonis apis, celonis api reference docs","lang":"en-US","llmstxt":{"hide":false,"description":"Celonis API documentation","sections":[{"title":"API Docs","description":"Available Celonis API Docs","includeFiles":["**/*.md"],"excludeFiles":[]},{"title":"API Specs","description":"All Celonis API specifications","includeFiles":["**/openapi.yaml"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"python-example","__idx":0},"children":["Python Example"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following example provides a complete Python script for uploading Parquet files to the Data Push API."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"./python-example.py","language":"Python","title":"python-example.py","header":{"title":"python-example.py","controls":{"copy":{}}},"lang":"Python","source":"\n# Test script for Data Push Job API. \n# Uploads a given parquet file. \n#\n# Parameter:\n# - Parquet filename in the current directory\n#\n#\n# Before usage:\n# Update app_key or api_key, pool_id, targetName and eventually base_url to your needs.\n#\n\n\nimport datetime\nimport sys\nimport uuid\n\nimport requests\n\n# Adopt to your needs\napp_key = \"YOUR APP KEY\" # You can create this under the team setting page and application key\napi_key = \"YOUR API KEY\" # You can create this under user setting by going to edit profile and api keys section\npool_id = \"YOUR POOL ID\"\ntargetName = \"TABLE_PARQUET\"\n\n\nbase_url = \"YOUR TEAM CELONIS DOMAIN\" \nconnection_id =\"YOUR CONNECTION ID\" # this is optional you can also push on data pool global schema\n\nclient_id = str(uuid.uuid4())\nfile_name = sys.argv[1]\n\nurl = base_url + \"/integration/api/v1/data-push/\" + pool_id + \"/jobs/\"\n\nprint('file_name', file_name)\n\n\nbody={'type': 'DELTA', 'fileType': 'PARQUET', 'targetName': targetName, 'dataPoolId': pool_id}\n# This is for authenticating with team based App Key\nheaders = {'Authorization': 'AppKey ' + app_key, 'Body-Type': 'application/json'} \n# Uncomment the line below if user based apiKey is used.\n# headers = {'Authorization': 'Bearer ' + api_key, 'Body-Type': 'application/json'} \nresponse = requests.post(url=url ,json=body, headers=headers)\nif response.status_code != 200:\n    print(\"Received non 200 code created data push job\", response.status_code)\n   \ndata_push_job = response.json()\nprint(str(datetime.datetime.now()) + \": Data push job \" +response.text + \" successful created \")\n\n\n\npush_chunk_url = url + data_push_job['id'] + \"/chunks/upserted\"\nprint(push_chunk_url);\nfile = {'file': open(file_name, 'rb')}\n# This is for authenticating with team based App Key\nheaders = {'Authorization': 'AppKey ' + app_key, 'Body-Type': 'multipart/form-data'}\n# Uncomment the line below if user based apiKey is used.\n# headers = {'Authorization': 'Bearer ' + api_key, 'Body-Type': 'application/json'}\nresponse = requests.post(url=push_chunk_url ,files=file, headers=headers)\n\nif response.status_code != 200:\n    print(\"Received non 200 code on pushing chunk\", response.status_code)\n   \n\nprint(str(datetime.datetime.now()) + \": Data push job chunk\" + response.text + \" successful created \")\n\n\n# This is for authenticating with team based App Key\nheaders = {'Authorization': 'AppKey ' + app_key, 'Body-Type': 'application/json'}\n# Uncomment the line below if user based apiKey is used.\n# headers = {'Authorization': 'Bearer ' + api_key, 'Body-Type': 'application/json'}\nurl =url+data_push_job['id']\nresponse = requests.post(url=url ,json={}, headers=headers)\nif response.status_code != 200:\n    print(\"Received non 200 code created data push job\", response.status_code)\n\nprint(str(datetime.datetime.now()) + \": Successful data push job \", response.text)\n\n#data_push_job {'file': open(file_name, 'rb')}\n","wrapContents":true},"children":[]}]},"headings":[{"value":"Python Example","id":"python-example","depth":1}],"frontmatter":{"seo":{"title":"Python Example"}},"lastModified":"2026-06-08T19:31:40.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/data-ingestion-api/python-example-1","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}