82 lines
1.7 KiB
Markdown
82 lines
1.7 KiB
Markdown
# Kwork API Documentation
|
|
|
|
Unofficial Python client for Kwork.ru API.
|
|
|
|
## Quick Start
|
|
|
|
### Installation
|
|
|
|
```bash
|
|
pip install kwork-api
|
|
```
|
|
|
|
### Authentication
|
|
|
|
```python
|
|
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
|
|
|
|
```python
|
|
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
|
|
|
|
- **[API Reference](api-reference.md)** — All endpoints and methods
|
|
- **[Models](api-reference.md#models)** — Pydantic models
|
|
- **[Errors](api-reference.md#errors)** — Exception classes
|
|
- **[Examples](examples.md)** — Usage examples
|
|
|
|
## 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:
|
|
|
|
```python
|
|
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
|
|
|
|
```python
|
|
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.*
|