Skip to main content

Modern async Python client for ClickUp API with type hints, rate limiting and fluent interface

Project description

ClickUp Async ✨

PyPI Version Python Versions License: MIT Downloads

A modern, high-performance Python client for the ClickUp API with first-class async support.

Why Choose ClickUp Async?

Feature ClickUp Async Other Libraries
Async Support ✅ Full async/await ❌ Synchronous only
Type Safety ✅ Full type hints & validation ❌ Limited or none
Rate Limiting ✅ Intelligent handling ❌ Basic or none
Fluent Interface ✅ Clean, chainable API ❌ Verbose calls
Modern Python ✅ Python 3.9+ features ❌ Legacy compatibility
Error Handling ✅ Comprehensive ❌ Basic exceptions
Pagination ✅ Automatic ❌ Manual handling
Maintenance ✅ Active development ❌ Limited updates

Installation

pip install clickup-async

Quick Start

import asyncio
from clickup_async import ClickUp, Priority

async def main():
    # Use as a context manager for automatic cleanup
    async with ClickUp(api_token="your_token_here") as client:
        # Get all workspaces
        workspaces = await client.get_workspaces()
        
        # Create a task with fluent interface
        task = await client.list("your_list_id").create_task(
            name="Implement new feature",
            description="Add the awesome new feature",
            priority=Priority.HIGH,
            due_date="next Friday"
        )
        
        print(f"Created task: {task.name} (ID: {task.id})")

if __name__ == "__main__":
    asyncio.run(main())

Key Features

⚡ Async First

All API operations use httpx for non-blocking I/O, making your applications more efficient and responsive.

# Concurrent API calls
tasks = await asyncio.gather(
    client.get_task("task1"),
    client.get_task("task2"),
    client.get_task("task3")
)

🔄 Smart Rate Limiting

Automatically handles ClickUp API rate limits with exponential backoff and proactive throttling.

# Configure rate limiting behavior
client = ClickUp(
    api_token="your_token",
    retry_rate_limited_requests=True,  # Auto retry when rate limited
    rate_limit_buffer=5                # Buffer seconds before hitting limits
)

🔍 Type Safety

Comprehensive type hints for better IDE integration and Pydantic models for runtime validation.

# Full type hints
from clickup_async.models import Task, Workspace, Space

async def process_task(task: Task) -> None:
    # IDE auto-completion works!
    print(f"Task: {task.name}, Status: {task.status.status}")

📝 Fluent Interface

Intuitive, chainable API design that reflects ClickUp's resource hierarchy.

# Traditional approach
task = await client.get_task("task_id")
comment = await client.create_task_comment(task.id, "Great work!")

# Fluent approach
task = await client.task("task_id").get_task()
comment = await client.task("task_id").create_task_comment("Great work!")

Documentation

For more detailed examples and API documentation, visit our GitHub repository.

Working with Tasks

# Create a task
task = await client.list("list_id").create_task(
    name="New task",
    description="Task description with **markdown** support",
    priority=Priority.HIGH,
    due_date=datetime.now() + timedelta(days=7),
    assignees=["user_id"],
    tags=["feature", "backend"]
)

# Update a task
updated_task = await client.task(task.id).update_task(
    name="Updated task name",
    status="In Progress"
)

# Get tasks with filtering
tasks = await client.list("list_id").get_tasks(
    due_date_gt="today",
    due_date_lt="next week",
    assignees=["user_id"],
    include_closed=False
)

Pagination Handling

# Get first page of tasks
tasks_page = await client.get_tasks(list_id="list_id")

# Process all tasks across all pages
all_tasks = []
while True:
    all_tasks.extend(tasks_page.items)
    if not tasks_page.has_more:
        break
    tasks_page = await tasks_page.next_page()

Development

  1. Clone the repository

    git clone https://github.com/catorch/clickup-async.git
    cd clickup-async
    
  2. Set up a virtual environment

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install development dependencies

    pip install -e ".[dev,test]"
    
  4. Run tests (requires a ClickUp API token in the environment)

    export CLICKUP_API_TOKEN=your_token_here
    pytest
    

License

MIT License - See LICENSE for details.


⭐ If you find this library helpful, please consider starring it on GitHub!

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

clickup_async-0.1.0.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

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

clickup_async-0.1.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file clickup_async-0.1.0.tar.gz.

File metadata

  • Download URL: clickup_async-0.1.0.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for clickup_async-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4044b625d4d2cdc1e2c29a90dccb9f4e90639a656c72bb382ee689874377b337
MD5 5f709c8dad2f863b055506b481d91048
BLAKE2b-256 f56eb2ed350302a5843b883b49e89bde1a8011bc22b974b5988414a83e0d0ff2

See more details on using hashes here.

File details

Details for the file clickup_async-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: clickup_async-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for clickup_async-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8196468de10384ccb2c02a07ed4ab3d3c61c30a0f3fc62d53529cf19fd902e7
MD5 8ccd54056bb07312fe7ad7de207d149c
BLAKE2b-256 e78e0a204a7173498b1b6936dfd1ef63c85c73bfbf1b9ad10529c56fc431ae81

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