kwork-api/site/search/search_index.json

1 line
18 KiB
JSON

{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"],"fields":{"title":{"boost":1000.0},"text":{"boost":1.0},"tags":{"boost":1000000.0}}},"docs":[{"location":"","title":"Kwork API Documentation","text":"<p>Unofficial Python client for Kwork.ru API.</p>"},{"location":"#quick-start","title":"Quick Start","text":""},{"location":"#installation","title":"Installation","text":"<pre><code>pip install kwork-api\n</code></pre>"},{"location":"#authentication","title":"Authentication","text":"<pre><code>from kwork_api import KworkClient\n\n# Login with credentials\nclient = await KworkClient.login(\"username\", \"password\")\n\n# Or restore from token\nclient = KworkClient(token=\"your_web_auth_token\")\n</code></pre>"},{"location":"#basic-usage","title":"Basic Usage","text":"<pre><code>async with KworkClient(token=\"token\") as client:\n # Get catalog\n catalog = await client.catalog.get_list(page=1)\n\n # Get kwork details\n details = await client.catalog.get_details(kwork_id=123)\n\n # Get projects\n projects = await client.projects.get_list()\n</code></pre>"},{"location":"#documentation-sections","title":"Documentation Sections","text":"<ul> <li>API Reference \u2014 All endpoints and methods</li> <li>Models \u2014 Pydantic models</li> <li>Errors \u2014 Exception classes</li> <li>Examples \u2014 Usage examples</li> </ul>"},{"location":"#features","title":"Features","text":"<ul> <li>\u2705 Full API coverage (45 endpoints)</li> <li>\u2705 Async/await support</li> <li>\u2705 Pydantic models for type safety</li> <li>\u2705 Clear error handling</li> <li>\u2705 Session management</li> </ul>"},{"location":"#rate-limiting","title":"Rate Limiting","text":"<p>Rate limiting is not implemented in the library. Handle it in your code:</p> <pre><code>import asyncio\n\nfor page in range(1, 10):\n catalog = await client.catalog.get_list(page=page)\n await asyncio.sleep(1) # 1 second delay\n</code></pre>"},{"location":"#error-handling","title":"Error Handling","text":"<pre><code>from kwork_api import KworkAuthError, KworkApiError\n\ntry:\n catalog = await client.catalog.get_list()\nexcept KworkAuthError as e:\n print(f\"Auth failed: {e}\")\nexcept KworkApiError as e:\n print(f\"API error [{e.status_code}]: {e.message}\")\n</code></pre> <p>Documentation auto-generated from source code.</p>"},{"location":"api-reference/","title":"API Reference","text":"<p>Auto-generated API documentation.</p> <p>Last updated: kwork-api</p>"},{"location":"api-reference/#kworkclient","title":"KworkClient","text":"<p>Kwork.ru API client.</p> <p>Usage: # Login with credentials client = await KworkClient.login(\"username\", \"password\")</p> <pre><code># Or restore from token\nclient = KworkClient(token=\"your_web_auth_token\")\n\n# Make requests\ncatalog = await client.catalog.get_list(page=1)\n</code></pre>"},{"location":"api-reference/#methods","title":"Methods","text":""},{"location":"api-reference/#catalog","title":"<code>catalog()</code>","text":"<p>Catalog API.</p>"},{"location":"api-reference/#projects","title":"<code>projects()</code>","text":"<p>Projects API.</p>"},{"location":"api-reference/#user","title":"<code>user()</code>","text":"<p>User API.</p>"},{"location":"api-reference/#reference","title":"<code>reference()</code>","text":"<p>Reference data API.</p>"},{"location":"api-reference/#notifications","title":"<code>notifications()</code>","text":"<p>Notifications API.</p>"},{"location":"api-reference/#other","title":"<code>other()</code>","text":"<p>Other endpoints.</p>"},{"location":"api-reference/#catalogapi","title":"CatalogAPI","text":"<p>Catalog/Kworks API endpoints.</p>"},{"location":"api-reference/#projectsapi","title":"ProjectsAPI","text":"<p>Projects (freelance orders) API endpoints.</p>"},{"location":"api-reference/#userapi","title":"UserAPI","text":"<p>User API endpoints.</p>"},{"location":"api-reference/#referenceapi","title":"ReferenceAPI","text":"<p>Reference data (cities, countries, etc.) endpoints.</p>"},{"location":"api-reference/#notificationsapi","title":"NotificationsAPI","text":"<p>Notifications and messages endpoints.</p>"},{"location":"api-reference/#otherapi","title":"OtherAPI","text":"<p>Other API endpoints.</p>"},{"location":"api-reference/#models","title":"Models","text":"<p>Pydantic models used in API responses.</p>"},{"location":"api-reference/#kworkuser","title":"KworkUser","text":"<p>User information.</p>"},{"location":"api-reference/#fields","title":"Fields","text":"Field Type Description <code>id</code> - - <code>username</code> - - <code>avatar_url</code> - - <code>is_online</code> - - <code>rating</code> - -"},{"location":"api-reference/#kworkcategory","title":"KworkCategory","text":"<p>Category information.</p>"},{"location":"api-reference/#fields_1","title":"Fields","text":"Field Type Description <code>id</code> - - <code>name</code> - - <code>slug</code> - - <code>parent_id</code> - -"},{"location":"api-reference/#kwork","title":"Kwork","text":"<p>Kwork (service) information.</p>"},{"location":"api-reference/#fields_2","title":"Fields","text":"Field Type Description <code>id</code> - - <code>title</code> - - <code>description</code> - - <code>price</code> - - <code>currency</code> - - <code>category_id</code> - - <code>seller</code> - - <code>images</code> - - <code>rating</code> - - <code>reviews_count</code> - - <code>created_at</code> - - <code>updated_at</code> - -"},{"location":"api-reference/#kworkdetails","title":"KworkDetails","text":"<p>Extended kwork details.</p>"},{"location":"api-reference/#fields_3","title":"Fields","text":"Field Type Description <code>full_description</code> - - <code>requirements</code> - - <code>delivery_time</code> - - <code>revisions</code> - - <code>features</code> - - <code>faq</code> - -"},{"location":"api-reference/#paginationinfo","title":"PaginationInfo","text":"<p>Pagination metadata.</p>"},{"location":"api-reference/#fields_4","title":"Fields","text":"Field Type Description <code>current_page</code> - - <code>total_pages</code> - - <code>total_items</code> - - <code>items_per_page</code> - - <code>has_next</code> - - <code>has_prev</code> - -"},{"location":"api-reference/#catalogresponse","title":"CatalogResponse","text":"<p>Catalog response with kworks and pagination.</p>"},{"location":"api-reference/#fields_5","title":"Fields","text":"Field Type Description <code>kworks</code> - - <code>pagination</code> - - <code>filters</code> - - <code>sort_options</code> - -"},{"location":"api-reference/#project","title":"Project","text":"<p>Project (freelance order) information.</p>"},{"location":"api-reference/#fields_6","title":"Fields","text":"Field Type Description <code>id</code> - - <code>title</code> - - <code>description</code> - - <code>budget</code> - - <code>budget_type</code> - - <code>category_id</code> - - <code>customer</code> - - <code>status</code> - - <code>created_at</code> - - <code>updated_at</code> - - <code>bids_count</code> - - <code>skills</code> - -"},{"location":"api-reference/#projectsresponse","title":"ProjectsResponse","text":"<p>Projects list response.</p>"},{"location":"api-reference/#fields_7","title":"Fields","text":"Field Type Description <code>projects</code> - - <code>pagination</code> - -"},{"location":"api-reference/#review","title":"Review","text":"<p>Review information.</p>"},{"location":"api-reference/#fields_8","title":"Fields","text":"Field Type Description <code>id</code> - - <code>rating</code> - - <code>comment</code> - - <code>author</code> - - <code>kwork_id</code> - - <code>created_at</code> - -"},{"location":"api-reference/#reviewsresponse","title":"ReviewsResponse","text":"<p>Reviews list response.</p>"},{"location":"api-reference/#fields_9","title":"Fields","text":"Field Type Description <code>reviews</code> - - <code>pagination</code> - - <code>average_rating</code> - -"},{"location":"api-reference/#notification","title":"Notification","text":"<p>Notification information.</p>"},{"location":"api-reference/#fields_10","title":"Fields","text":"Field Type Description <code>id</code> - - <code>type</code> - - <code>title</code> - - <code>message</code> - - <code>is_read</code> - - <code>created_at</code> - - <code>link</code> - -"},{"location":"api-reference/#notificationsresponse","title":"NotificationsResponse","text":"<p>Notifications list response.</p>"},{"location":"api-reference/#fields_11","title":"Fields","text":"Field Type Description <code>notifications</code> - - <code>unread_count</code> - -"},{"location":"api-reference/#dialog","title":"Dialog","text":"<p>Dialog (chat) information.</p>"},{"location":"api-reference/#fields_12","title":"Fields","text":"Field Type Description <code>id</code> - - <code>participant</code> - - <code>last_message</code> - - <code>unread_count</code> - - <code>updated_at</code> - -"},{"location":"api-reference/#authresponse","title":"AuthResponse","text":"<p>Authentication response.</p>"},{"location":"api-reference/#fields_13","title":"Fields","text":"Field Type Description <code>success</code> - - <code>user_id</code> - - <code>username</code> - - <code>web_auth_token</code> - - <code>message</code> - -"},{"location":"api-reference/#errordetail","title":"ErrorDetail","text":"<p>Error detail from API.</p>"},{"location":"api-reference/#fields_14","title":"Fields","text":"Field Type Description <code>code</code> - - <code>message</code> - - <code>field</code> - -"},{"location":"api-reference/#apierrorresponse","title":"APIErrorResponse","text":"<p>Standard API error response.</p>"},{"location":"api-reference/#fields_15","title":"Fields","text":"Field Type Description <code>success</code> - - <code>errors</code> - - <code>message</code> - -"},{"location":"api-reference/#city","title":"City","text":"<p>City information.</p>"},{"location":"api-reference/#fields_16","title":"Fields","text":"Field Type Description <code>id</code> - - <code>name</code> - - <code>country_id</code> - -"},{"location":"api-reference/#country","title":"Country","text":"<p>Country information.</p>"},{"location":"api-reference/#fields_17","title":"Fields","text":"Field Type Description <code>id</code> - - <code>name</code> - - <code>code</code> - - <code>cities</code> - -"},{"location":"api-reference/#timezone","title":"TimeZone","text":"<p>Timezone information.</p>"},{"location":"api-reference/#fields_18","title":"Fields","text":"Field Type Description <code>id</code> - - <code>name</code> - - <code>offset</code> - -"},{"location":"api-reference/#feature","title":"Feature","text":"<p>Feature/addon information.</p>"},{"location":"api-reference/#fields_19","title":"Fields","text":"Field Type Description <code>id</code> - - <code>name</code> - - <code>description</code> - - <code>price</code> - - <code>type</code> - -"},{"location":"api-reference/#badge","title":"Badge","text":"<p>User badge information.</p>"},{"location":"api-reference/#fields_20","title":"Fields","text":"Field Type Description <code>id</code> - - <code>name</code> - - <code>description</code> - - <code>icon_url</code> - -"},{"location":"api-reference/#dataresponse","title":"DataResponse","text":"<p>Generic data response wrapper.</p>"},{"location":"api-reference/#fields_21","title":"Fields","text":"Field Type Description <code>success</code> - - <code>data</code> - - <code>message</code> - -"},{"location":"api-reference/#errors","title":"Errors","text":"<p>Exception classes for error handling.</p>"},{"location":"api-reference/#kworkerror","title":"KworkError","text":"<p>Base exception for all Kwork API errors.</p>"},{"location":"api-reference/#kworkautherror","title":"KworkAuthError","text":"<p>Authentication/authorization error.</p>"},{"location":"api-reference/#kworkapierror","title":"KworkApiError","text":"<p>API request error (4xx, 5xx).</p>"},{"location":"api-reference/#kworknotfounderror","title":"KworkNotFoundError","text":"<p>Resource not found (404).</p>"},{"location":"api-reference/#kworkratelimiterror","title":"KworkRateLimitError","text":"<p>Rate limit exceeded (429).</p>"},{"location":"api-reference/#kworkvalidationerror","title":"KworkValidationError","text":"<p>Validation error (400).</p>"},{"location":"api-reference/#kworknetworkerror","title":"KworkNetworkError","text":"<p>Network/connection error.</p>"},{"location":"examples/","title":"Usage Examples","text":""},{"location":"examples/#catalog","title":"Catalog","text":""},{"location":"examples/#get-catalog-list","title":"Get Catalog List","text":"<pre><code>from kwork_api import KworkClient\n\nasync with KworkClient(token=\"token\") as client:\n catalog = await client.catalog.get_list(page=1, category_id=5)\n\n for kwork in catalog.kworks:\n print(f\"{kwork.title}: {kwork.price} RUB\")\n\n # Pagination\n if catalog.pagination:\n print(f\"Page {catalog.pagination.current_page} of {catalog.pagination.total_pages}\")\n</code></pre>"},{"location":"examples/#get-kwork-details","title":"Get Kwork Details","text":"<pre><code>details = await client.catalog.get_details(kwork_id=123)\n\nprint(f\"Title: {details.title}\")\nprint(f\"Price: {details.price}\")\nprint(f\"Description: {details.full_description}\")\nprint(f\"Delivery: {details.delivery_time} days\")\n</code></pre>"},{"location":"examples/#projects","title":"Projects","text":""},{"location":"examples/#get-projects-list","title":"Get Projects List","text":"<pre><code>projects = await client.projects.get_list(page=1)\n\nfor project in projects.projects:\n print(f\"{project.title} - {project.budget} RUB\")\n</code></pre>"},{"location":"examples/#get-customer-orders","title":"Get Customer Orders","text":"<pre><code>orders = await client.projects.get_payer_orders()\n\nfor order in orders:\n print(f\"Order #{order.id}: {order.status}\")\n</code></pre>"},{"location":"examples/#get-performer-orders","title":"Get Performer Orders","text":"<pre><code>orders = await client.projects.get_worker_orders()\n\nfor order in orders:\n print(f\"Work #{order.id}: {order.status}\")\n</code></pre>"},{"location":"examples/#user","title":"User","text":""},{"location":"examples/#get-user-info","title":"Get User Info","text":"<pre><code>user_info = await client.user.get_info()\nprint(f\"Username: {user_info.get('username')}\")\n</code></pre>"},{"location":"examples/#get-reviews","title":"Get Reviews","text":"<pre><code>reviews = await client.user.get_reviews(page=1)\n\nfor review in reviews.reviews:\n print(f\"Rating: {review.rating}/5 - {review.comment}\")\n</code></pre>"},{"location":"examples/#get-favorite-kworks","title":"Get Favorite Kworks","text":"<pre><code>favorites = await client.user.get_favorite_kworks()\n\nfor kwork in favorites:\n print(f\"Favorite: {kwork.title}\")\n</code></pre>"},{"location":"examples/#reference-data","title":"Reference Data","text":""},{"location":"examples/#get-cities","title":"Get Cities","text":"<pre><code>cities = await client.reference.get_cities()\n\nfor city in cities:\n print(f\"{city.id}: {city.name}\")\n</code></pre>"},{"location":"examples/#get-countries","title":"Get Countries","text":"<pre><code>countries = await client.reference.get_countries()\n\nfor country in countries:\n print(f\"{country.id}: {country.name}\")\n</code></pre>"},{"location":"examples/#get-timezones","title":"Get Timezones","text":"<pre><code>timezones = await client.reference.get_timezones()\n\nfor tz in timezones:\n print(f\"{tz.id}: {tz.name} ({tz.offset})\")\n</code></pre>"},{"location":"examples/#notifications","title":"Notifications","text":""},{"location":"examples/#get-notifications","title":"Get Notifications","text":"<pre><code>notifications = await client.notifications.get_list()\n\nfor notif in notifications.notifications:\n print(f\"{notif.title}: {notif.message}\")\n\nprint(f\"Unread: {notifications.unread_count}\")\n</code></pre>"},{"location":"examples/#fetch-new-notifications","title":"Fetch New Notifications","text":"<pre><code>new_notifications = await client.notifications.fetch()\nprint(f\"New: {len(new_notifications.notifications)}\")\n</code></pre>"},{"location":"examples/#get-dialogs","title":"Get Dialogs","text":"<pre><code>dialogs = await client.notifications.get_dialogs()\n\nfor dialog in dialogs:\n print(f\"Dialog with {dialog.participant.username}: {dialog.last_message}\")\n</code></pre>"},{"location":"examples/#error-handling","title":"Error Handling","text":"<pre><code>from kwork_api import KworkAuthError, KworkApiError, KworkNotFoundError\n\ntry:\n catalog = await client.catalog.get_list()\nexcept KworkAuthError as e:\n print(f\"Authentication failed: {e}\")\nexcept KworkNotFoundError as e:\n print(f\"Resource not found: {e}\")\nexcept KworkApiError as e:\n print(f\"API error [{e.status_code}]: {e.message}\")\nexcept Exception as e:\n print(f\"Unexpected error: {e}\")\n</code></pre>"},{"location":"examples/#rate-limiting","title":"Rate Limiting","text":"<pre><code>import asyncio\n\nasync def fetch_all_pages():\n all_kworks = []\n\n for page in range(1, 10):\n try:\n catalog = await client.catalog.get_list(page=page)\n all_kworks.extend(catalog.kworks)\n\n if not catalog.pagination or not catalog.pagination.has_next:\n break\n\n # Delay to avoid rate limiting\n await asyncio.sleep(1)\n\n except KworkRateLimitError:\n print(\"Rate limited, waiting...\")\n await asyncio.sleep(5)\n\n return all_kworks\n</code></pre>"},{"location":"examples/#pagination-helper","title":"Pagination Helper","text":"<pre><code>async def fetch_all_catalog():\n \"\"\"Fetch all kworks from catalog with pagination.\"\"\"\n all_kworks = []\n page = 1\n\n while True:\n catalog = await client.catalog.get_list(page=page)\n all_kworks.extend(catalog.kworks)\n\n if not catalog.pagination or not catalog.pagination.has_next:\n break\n\n page += 1\n await asyncio.sleep(0.5) # Rate limiting\n\n return all_kworks\n</code></pre> <p>More examples in the API Reference.</p>"}]}