Skip to main content

Clixify: Python Client for ClickUp API v2

Project description

Clixify: Python Client for ClickUp API v2

A Python library providing an object-oriented interface to interact with the ClickUp API v2. This library aims to simplify common operations like managing workspaces, spaces, folders, lists, and tasks.

Features

  • Object-Oriented: Interact with ClickUp resources (Workspaces, Spaces, Folders, Lists, Tasks) as Python objects.
  • Hierarchy Management: Easily navigate and manage the ClickUp hierarchy (Workspace -> Space -> Folder -> List -> Task).
  • Core CRUD Operations: Create, Read (Get), Update, Delete operations for major resources where applicable via the API.
  • Task Management:
    • Create tasks within lists.
    • List tasks with filtering and automatic pagination support (get_all=True).
    • Update task details (name, description, status, priority, dates, etc.).
    • Assign/Unassign users by ID or Name (with ambiguity handling).
    • Add/Get task comments.
    • Add/Remove task tags (by name).
    • Add/Remove task watchers (by ID or Name).
    • Create subtasks.
    • Add/Remove task dependencies.
  • User Resolution: Find users within a List context by name or email fragment for assignments/watchers, raising specific exceptions (UserNotFoundByNameError, AmbiguousUserNameError) on failure.
  • Rate Limiting: Includes a built-in delay (time.sleep) between requests to help avoid rate limits.
  • Caching: Basic caching for list members, spaces, folders, and lists to reduce redundant API calls.

Installation

pip install clixify

Requirements

  • Python 3.8+
  • requests
  • python-dotenv (for loading API key from .env file)

Install requirements:

pip install requests python-dotenv

Configuration

Obtain your Personal API Token from your ClickUp account settings (Settings -> Apps).

Create a file named .env in the root directory of your project.

Add your API token to the .env file:

CLICKUP_TOKEN=pk_YOUR_PERSONAL_API_TOKEN_HERE

The library will automatically load the token from this environment variable. Alternatively, you can pass the token directly when initializing the client:

from clixify.client import ClickUpClient
client = ClickUpClient(token="pk_YOUR_PERSONAL_API_TOKEN_HERE")

Quick Start

import os
from dotenv import load_dotenv
from clixify.client import ClickUpClient
from clixify.team import Team

load_dotenv()

try:
    client = ClickUpClient()
    print("Client initialized.")
except ValueError as e:
    print(f"Error: {e}")
    exit()

team_manager = Team(client)

workspace_name = "Your Target Workspace Name"  # <-- CHANGE THIS
my_workspace = team_manager.get_workspace(workspace_name)

if my_workspace:
    print(f"Found Workspace: {my_workspace.name} (ID: {my_workspace.id})")
    print("\nListing spaces...")
    spaces = my_workspace.list_spaces()
    if spaces:
        for space in spaces:
            print(f" - Space: {space.name} (ID: {space.id})")
    else:
        print("No spaces found in this workspace.")
else:
    print(f"Workspace '{workspace_name}' not found.")

Error Handling

The library uses custom exceptions for specific known issues found in the clixify.exceptions module:

  • UserNotFoundByNameError: Raised during name resolution if a provided name query does not match any user.
  • AmbiguousUserNameError: Raised if a provided name query matches multiple users. Includes details of matches found.
  • clixifyException: Base exception for other library-specific errors.

Example:

from clixify.exceptions import UserNotFoundByNameError, AmbiguousUserNameError

try:
    my_list.create_task(name="Test Ambiguity", assignees=["admin"])
except AmbiguousUserNameError as e:
    print(f"Assignment failed: {e}")
    print("Please use a more specific name or the User ID.")
except UserNotFoundByNameError as e:
    print(f"Assignment failed: User '{e.name_query}' not found in list '{e.list_id}'.")
except Exception as e:
    print(f"An unexpected error occurred: {e}")

Rate Limiting

A default delay of 0.65 seconds is automatically added before each API request in ClickUpClient.request to help prevent hitting standard ClickUp API rate limits.

Contributing

(Add contribution guidelines here if applicable)

License

(Specify your chosen license here, e.g., MIT License, Apache 2.0)

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

clixify-0.1.1.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clixify-0.1.1-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file clixify-0.1.1.tar.gz.

File metadata

  • Download URL: clixify-0.1.1.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for clixify-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bc1a6da8123b0b1d0c872fef5b26ffb0a9962de5a38775966594617b32cd9aba
MD5 82afb709d8969d1b835b82d6ec839046
BLAKE2b-256 3470644e491b3c108b33c7d45aaa5ecfced61339ef5b04abd65e5e235a0c741c

See more details on using hashes here.

File details

Details for the file clixify-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: clixify-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for clixify-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 64eb5f4e6408a6b76b46bd9da5a80ecbd7cb1c939b1588186417ebc8379f15f4
MD5 ab0df21865b9d3bc4abba5098c1e7419
BLAKE2b-256 a12709267ae4821835806f69c22478e9aeb0cf1d3f2630101d3cf3c04ad838e5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page