kwork-api/docs/index.md
2026-03-23 03:26:21 +00:00

1.7 KiB

Kwork API Documentation

Unofficial Python client for Kwork.ru API.

Quick Start

Installation

pip install kwork-api

Authentication

from kwork_api import KworkClient

# Login with credentials
client = await KworkClient.login("username", "password")

# Or restore from token
client = KworkClient(token="your_web_auth_token")

Basic Usage

async with KworkClient(token="token") as client:
    # Get catalog
    catalog = await client.catalog.get_list(page=1)
    
    # Get kwork details
    details = await client.catalog.get_details(kwork_id=123)
    
    # Get projects
    projects = await client.projects.get_list()

Documentation Sections

Features

  • Full API coverage (45 endpoints)
  • Async/await support
  • Pydantic models for type safety
  • Clear error handling
  • Session management

Rate Limiting

Rate limiting is not implemented in the library. Handle it in your code:

import asyncio

for page in range(1, 10):
    catalog = await client.catalog.get_list(page=page)
    await asyncio.sleep(1)  # 1 second delay

Error Handling

from kwork_api import KworkAuthError, KworkApiError

try:
    catalog = await client.catalog.get_list()
except KworkAuthError as e:
    print(f"Auth failed: {e}")
except KworkApiError as e:
    print(f"API error [{e.status_code}]: {e.message}")

Documentation auto-generated from source code.