A Python client for interacting with the ClickUp API V2.
Project description
ClickUp API V2 Client
A Python client for interacting with the ClickUp API V2, providing convenient methods to fetch data, update tasks, and manage custom fields. Features
- Retrieve team IDs.
- Fetch workspaces, folders, lists, and tasks.
- Get custom fields for a specific list.
- Update task attributes.
- Set custom field values for tasks.
Installation
pip install clickup-apiv2
Usage
Initialize the Client
from clickup_apiv2 import Client
api_token = "your_clickup_api_token"
client = Client(api_token)
Methods
- Get Team IDs
Retrieve the IDs of your teams.
team_ids = client.get_team_id()
print("Team IDs:", team_ids)
- Get Workspaces
Fetch all workspaces (spaces) for a given team.
team_id = "your_team_id"
workspaces = client.get_workspaces(team_id)
print("Workspaces:", workspaces)
- Get Workspace Folders
Fetch all folders within a specific workspace.
workspace_id = "your_workspace_id"
folders = client.get_workspace_folders(workspace_id)
print("Folders:", folders)
- Get Workspace Lists
Retrieve lists directly under a workspace.
workspace_id = "your_workspace_id"
lists = client.get_workspace_lists(workspace_id)
print("Lists:", lists)
- Get Folder Lists
Fetch lists contained within a folder.
folder_id = "your_folder_id"
lists = client.get_folder_lists(folder_id)
print("Folder Lists:", lists)
- Get List Tasks
Retrieve all tasks in a specific list.
list_id = "your_list_id"
tasks = client.get_list_tasks(list_id)
print("Tasks:", tasks)
- Get List Custom Fields
Fetch all custom fields for a list.
list_id = "your_list_id"
custom_fields = client.get_list_custom_fields(list_id)
print("Custom Fields:", custom_fields)
- Update a Task
Update attributes of a task (e.g., name, status).
task_id = "your_task_id"
update_task_data = {
"name": "New Task Name",
"status": "in progress"
}
response = client.update_task(task_id, update_task_data)
print("Task Update Response:", response)
- Set Task Custom Field Value
Set or update a custom field value for a task.
task_id = "your_task_id"
field_id = "your_field_id"
custom_field_data = {"value": "New Value"}
response = client.set_task_custom_field_value(task_id, field_id, custom_field_data)
print("Set Custom Field Response:", response)
Example Workflow
Initialize client
api_token = "your_clickup_api_token"
client = Client(api_token)
Fetch team IDs
team_ids = client.get_team_id()
if team_ids:
team_id = team_ids[0]
# Get workspaces
workspaces = client.get_workspaces(team_id)
print("Workspaces:", workspaces)
if workspaces:
workspace_id = workspaces[0]["id"]
# Get lists in workspace
lists = client.get_workspace_lists(workspace_id)
print("Lists:", lists)
if lists:
list_id = lists[0]["id"]
# Get tasks in the list
tasks = client.get_list_tasks(list_id)
print("Tasks:", tasks)
if tasks:
task_id = tasks[0]["id"]
# Update a task
update_data = {"status": "completed"}
client.update_task(task_id, update_data)
# Set custom field value
field_id = "your_field_id"
client.set_task_custom_field_value(task_id, field_id, {"value": "Updated Value"})
Error Handling
The client handles HTTP errors gracefully by catching requests.exceptions.RequestException and printing a relevant error message.
Contributing
Feel free to submit issues or pull requests to enhance the functionality.
License
This project is licensed under the MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clickup_apiv2-0.0.6.tar.gz.
File metadata
- Download URL: clickup_apiv2-0.0.6.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5905eaf24816425eaf722ab724d20c482649b7c5b260e3a3cfa13ede52d88597
|
|
| MD5 |
ad03efa8fc5994a78cd90965e5ec4b44
|
|
| BLAKE2b-256 |
19dd05eae5b246bdbbf89ff43179d7297bcdb66ec0ffd837f5d283c7be9d931e
|
Provenance
The following attestation bundles were made for clickup_apiv2-0.0.6.tar.gz:
Publisher:
python-publish.yml on lorithai/clickup_apiV2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clickup_apiv2-0.0.6.tar.gz -
Subject digest:
5905eaf24816425eaf722ab724d20c482649b7c5b260e3a3cfa13ede52d88597 - Sigstore transparency entry: 174124637
- Sigstore integration time:
-
Permalink:
lorithai/clickup_apiV2@813c82a389cb08b203c03b46448c275452e711a8 -
Branch / Tag:
refs/tags/bugfix - Owner: https://github.com/lorithai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@813c82a389cb08b203c03b46448c275452e711a8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file clickup_apiv2-0.0.6-py3-none-any.whl.
File metadata
- Download URL: clickup_apiv2-0.0.6-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14f6220b2ca1f6af135d8b1009525c7511ac96e1657de7e6eb2fb2123c8ae82a
|
|
| MD5 |
147a204d0a7cf45c7dde30b1850a43e3
|
|
| BLAKE2b-256 |
e9441d97bf4935acf2fc731dfedf22ef048e970665578216c56d4e690d6cbe14
|
Provenance
The following attestation bundles were made for clickup_apiv2-0.0.6-py3-none-any.whl:
Publisher:
python-publish.yml on lorithai/clickup_apiV2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clickup_apiv2-0.0.6-py3-none-any.whl -
Subject digest:
14f6220b2ca1f6af135d8b1009525c7511ac96e1657de7e6eb2fb2123c8ae82a - Sigstore transparency entry: 174124641
- Sigstore integration time:
-
Permalink:
lorithai/clickup_apiV2@813c82a389cb08b203c03b46448c275452e711a8 -
Branch / Tag:
refs/tags/bugfix - Owner: https://github.com/lorithai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@813c82a389cb08b203c03b46448c275452e711a8 -
Trigger Event:
release
-
Statement type: