Title: Async support · Issue #6 · recombee/python-api-client · GitHub
Open Graph Title: Async support · Issue #6 · recombee/python-api-client
X Title: Async support · Issue #6 · recombee/python-api-client
Description: Hey there, thanks for the neat library. Do you have any plan to support native async features of Python for the client? e.g. something in the lines of: import asyncio import random from recombee_api_client.api_client import AsyncRecombee...
Open Graph Description: Hey there, thanks for the neat library. Do you have any plan to support native async features of Python for the client? e.g. something in the lines of: import asyncio import random from recombee_ap...
X Description: Hey there, thanks for the neat library. Do you have any plan to support native async features of Python for the client? e.g. something in the lines of: import asyncio import random from recombee_ap...
Opengraph URL: https://github.com/recombee/python-api-client/issues/6
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Async support","articleBody":"Hey there, thanks for the neat library.\r\n\r\nDo you have any plan to support native async features of Python for the client?\r\n\r\ne.g. something in the lines of:\r\n\r\n```python\r\nimport asyncio\r\nimport random\r\n\r\nfrom recombee_api_client.api_client import AsyncRecombeeClient, Region\r\nfrom recombee_api_client.exceptions import APIException\r\nfrom recombee_api_client.api_requests import *\r\n\r\nasync def main():\r\n client = AsyncRecombeeClient('--my-database-id--', '--db-private-token--', region=Region.US_WEST)\r\n \r\n #Generate some random purchases of items by users\r\n PROBABILITY_PURCHASED = 0.1\r\n NUM = 100\r\n purchase_requests = []\r\n \r\n for user_id in [\"user-%s\" % i for i in range(NUM) ]:\r\n for item_id in [\"item-%s\" % i for i in range(NUM) ]:\r\n if random.random() \u003c PROBABILITY_PURCHASED:\r\n \r\n request = AddPurchase(user_id, item_id, cascade_create=True)\r\n purchase_requests.append(request)\r\n \r\n try:\r\n # Send the data to Recombee, use Batch for faster processing of larger data\r\n print('Send purchases')\r\n await client.send(Batch(purchase_requests))\r\n \r\n # Get recommendations for user 'user-25'\r\n response = await client.send(RecommendItemsToUser('user-25', 5))\r\n print(\"Recommended items: %s\" % response)\r\n \r\n # User scrolled down - get next 3 recommended items\r\n response = await client.send(RecommendNextItems(response['recommId'], 3))\r\n print(\"Next recommended items: %s\" % response)\r\n \r\n except APIException as e:\r\n print(e)\r\n\r\n\r\nasyncio.run(main())\r\n```","author":{"url":"https://github.com/ramnes","@type":"Person","name":"ramnes"},"datePublished":"2023-09-07T15:04:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/6/python-api-client/issues/6"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8fe04731-d1df-03e2-8934-844f394b9776 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8234:34D83D:A19EA9:D5E4FB:696B551F |
| html-safe-nonce | d07b1b5926b374eed6a6b283bfdbe01d3a10093e1ad1716e338376d15bcc83ff |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjM0OjM0RDgzRDpBMTlFQTk6RDVFNEZCOjY5NkI1NTFGIiwidmlzaXRvcl9pZCI6IjI1NTgwODIxMzI0MjQyMTc4ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 37a9165aedc18cf6031faab0a466f752924c99765abcace95d0177b06ffad0dc |
| hovercard-subject-tag | issue:1886078730 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/recombee/python-api-client/6/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7153476f622576fb0b567e8d6cdcdfddef91a8f8d67cd5a067933c9af5e1d43d/recombee/python-api-client/issues/6 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7153476f622576fb0b567e8d6cdcdfddef91a8f8d67cd5a067933c9af5e1d43d/recombee/python-api-client/issues/6 |
| og:image:alt | Hey there, thanks for the neat library. Do you have any plan to support native async features of Python for the client? e.g. something in the lines of: import asyncio import random from recombee_ap... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ramnes |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/recombee/python-api-client git https://github.com/recombee/python-api-client.git |
| octolytics-dimension-user_id | 19200752 |
| octolytics-dimension-user_login | recombee |
| octolytics-dimension-repository_id | 65002560 |
| octolytics-dimension-repository_nwo | recombee/python-api-client |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 65002560 |
| octolytics-dimension-repository_network_root_nwo | recombee/python-api-client |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width