Python SDK for gorse recommender system
Project description
PyGorse
Python SDK for gorse recommender system.
Install
- Install from PyPI:
pip install PyGorse
- Install from source:
git clone https://github.com/gorse-io/PyGorse.git
cd PyGorse
pip install .
Usage
Create a client by the entrypoint and api key.
from gorse import Gorse
client = Gorse('http://127.0.0.1:8087', 'api_key')
client.insert_feedbacks([
{ 'FeedbackType': 'star', 'UserId': 'bob', 'ItemId': 'vuejs:vue', 'Timestamp': '2022-02-24' },
{ 'FeedbackType': 'star', 'UserId': 'bob', 'ItemId': 'd3:d3', 'Timestamp': '2022-02-25' },
{ 'FeedbackType': 'star', 'UserId': 'bob', 'ItemId': 'dogfalo:materialize', 'Timestamp': '2022-02-26' },
{ 'FeedbackType': 'star', 'UserId': 'bob', 'ItemId': 'mozilla:pdf.js', 'Timestamp': '2022-02-27' },
{ 'FeedbackType': 'star', 'UserId': 'bob', 'ItemId': 'moment:moment', 'Timestamp': '2022-02-28' }
])
client.get_recommend('bob', n=10)
The Python SDK implements the async client as well:
from gorse import AsyncGorse
client = AsyncGorse('http://127.0.0.1:8087', 'api_key')
await client.insert_feedbacks([
{ 'FeedbackType': 'star', 'UserId': 'bob', 'ItemId': 'vuejs:vue', 'Timestamp': '2022-02-24' },
{ 'FeedbackType': 'star', 'UserId': 'bob', 'ItemId': 'd3:d3', 'Timestamp': '2022-02-25' },
{ 'FeedbackType': 'star', 'UserId': 'bob', 'ItemId': 'dogfalo:materialize', 'Timestamp': '2022-02-26' },
{ 'FeedbackType': 'star', 'UserId': 'bob', 'ItemId': 'mozilla:pdf.js', 'Timestamp': '2022-02-27' },
{ 'FeedbackType': 'star', 'UserId': 'bob', 'ItemId': 'moment:moment', 'Timestamp': '2022-02-28' }
])
await client.get_recommend('bob', n=10)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pygorse-0.5.0.tar.gz
(8.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygorse-0.5.0.tar.gz.
File metadata
- Download URL: pygorse-0.5.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3f95534117dc11c7e1dd03544cec67e17e22405564fd7e96b2d07b130f5f9a2
|
|
| MD5 |
5d9f97ea21886f1cbbba740edafc100e
|
|
| BLAKE2b-256 |
9bd1541a63fa1ffdb9dabf14d8fda792d240da51f427bd2ba917155e104da92a
|
File details
Details for the file pygorse-0.5.0-py3-none-any.whl.
File metadata
- Download URL: pygorse-0.5.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8767522583b9c20fa2a5c2fb7bf67381b8cb670802678f063d04af7d1a769a39
|
|
| MD5 |
f86c77a1553e3b82d1588f3c50c23578
|
|
| BLAKE2b-256 |
d9d438464b36547d71e32bd6789cf6b26fbeb711e24a8a4d7e30927dc7ddac68
|