{"id":19756853,"url":"https://github.com/compdfkit/compdfkit-api-python","last_synced_at":"2025-09-10T04:10:58.819Z","repository":{"id":193210403,"uuid":"688272508","full_name":"ComPDFKit/compdfkit-api-python","owner":"ComPDFKit","description":"A Python component library for integrating with ComPDFKit API to build a PDF Viewer and Editor.","archived":false,"fork":false,"pushed_at":"2024-08-01T02:30:34.000Z","size":35,"stargazers_count":19,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-08-01T10:46:16.967Z","etag":null,"topics":["api","compdfkit-api","pdf","pdf-converter","pdf-document","pdf-editor","pdf-viewer","python"],"latest_commit_sha":null,"homepage":"https://api.compdf.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ComPDFKit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-07T02:26:55.000Z","updated_at":"2024-08-01T02:30:37.000Z","dependencies_parsed_at":"2023-09-07T07:43:13.826Z","dependency_job_id":"44c47401-2e25-4a4b-9483-5f75ce40f725","html_url":"https://github.com/ComPDFKit/compdfkit-api-python","commit_stats":null,"previous_names":["compdfkit/compdfkit-api-python"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComPDFKit%2Fcompdfkit-api-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComPDFKit%2Fcompdfkit-api-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComPDFKit%2Fcompdfkit-api-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComPDFKit%2Fcompdfkit-api-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ComPDFKit","download_url":"https://codeload.github.com/ComPDFKit/compdfkit-api-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224207936,"owners_count":17273679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","compdfkit-api","pdf","pdf-converter","pdf-document","pdf-editor","pdf-viewer","python"],"created_at":"2024-11-12T03:17:12.730Z","updated_at":"2024-11-12T03:17:13.192Z","avatar_url":"https://github.com/ComPDFKit.png","language":"Python","readme":"## ComPDFKit API in Python\n\n[ComPDFKit](https://api.compdf.com/api/docs/introduction) API provides a variety of Python API tools that allow you to create an efficient document processing workflow in a single API call. Try our various APIs for free — no credit card required.\n\n\n\n## Requirements\n\nProgramming Environment: Python 3.8 and higher.\n\nDependencies: pip.\n\n\n\n## Installation\n\nYou can install the library via pip. Run the following command:\n\n```shell script\npip install compdfkit-api-python\n```\n\n\n\n## Create API Client\n\nYou can use your **publicKey** and **secretKey** to complete the authentication. You need to [sign in](https://api.compdf.com/login) your ComPDFKit API account to get your **publicKey** and **secretKey** at the [dashboard](https://api-dashboard.compdf.com/api/keys). If you are new to ComPDFKit, click here to [sign up](https://api.compdf.com/signup) for a free trial.\n\n- Project public Key: You can find the public key in the **API Keys** section of your ComPDFKit API account.\n\n- Project secret Key: You can find the secret key in the **API Keys** section of your ComPDFKit API account.\n\n```python\n# Create a client\nclient = CPDFClient(public_key, secret_key)\n```\n\n\n\n## Create Task\n\nA task ID is automatically generated for you based on the type of PDF tool you choose. You can provide the callback notification URL. After the task processing is completed, we will notify you of the task result through the callback interface. You can perform other operations according to the request result, such as checking the status of the task, uploading files, starting the task, or downloading the result file.\n\n```python\n# Create a client\nclient = CPDFClient(public_key, secret_key)\n\n# Create a task\n# Create an example task to convert a PDF tO a Word\ncreate_task_result = client.create_task(CPDFConversionEnum.PDF_TO_WORD)\n\n# Get a task id\ntask_id = create_task_result.task_id\n```\n\n\n\n## Upload Files\n\nUpload the original file and bind the file to the task ID. The field parameter is used to pass the JSON string to set the processing parameters for the file. Each file will generate automatically a unique file key. Please note that a maximum of five files can be uploaded for a task ID and no files can be uploaded for that task after it has started.\n\n```python\n# Create a client\nclient = CPDFClient(public_key, secret_key)\n\n# Create a task\n# Create an example task to convert a PDF tO a Word\ncreate_task_result = client.create_task(CPDFConversionEnum.PDF_TO_WORD)\n\n# Get a task id\ntask_id = create_task_result.task_id\n\n# Upload files\nclient.upload_file(convert_file, task_id)\n```\n\n\n\n## Execute the Task\n\nAfter the file upload is completed, call this interface with the task ID to process the files.\n\n```python\n# Create a client\nclient = CPDFClient(public_key, secret_key)\n\n# Create a task\n# Create an example task to convert a PDF tO a Word\ncreate_task_result = client.create_task(CPDFConversionEnum.PDF_TO_WORD)\n\n# Get a task id\ntask_id = create_task_result.task_id\n\n# Upload files\nclient.upload_file(convert_file, task_id)\n\n# execute Task\nclient.execute_task(task_id)\n```\n\n\n\n## Get Task Info\n\nRequest task status and file-related meta data based on the task ID.\n\n```python\n# Create a client\nclient = CPDFClient(public_key, secret_key)\n\n# Create a task\n# Create an example task to convert a PDF tO a Word\ncreate_task_result = client.create_task(CPDFConversionEnum.PDF_TO_WORD)\n\n# Get a task id\ntask_id = create_task_result.task_id\n\n# Upload files\nclient.upload_file(convert_file, task_id)\n\n# execute task\nclient.execute_task(task_id)\n\n# Query TaskInfo\ntask_info = client.get_task_info(task_id)\n```\n\n\n\n## Samples\n\nSee ***\"Samples\"*** folder in this folder.\n\n\n\n## Resources\n\n- [ComPDFKit API Libraries](https://api.compdf.com/api-libraries/overview)\n- [ComPDFKit API Documentation](https://api.compdf.com/api/docs/introduction)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompdfkit%2Fcompdfkit-api-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompdfkit%2Fcompdfkit-api-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompdfkit%2Fcompdfkit-api-python/lists"}