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.4.9.tar.gz
(9.0 kB
view details)
Built Distributions
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.4.9.tar.gz.
File metadata
- Download URL: pygorse-0.4.9.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
435ef3b08ae78ce7ee71507c82b4636270533308eece4680e38578cc58fba25a
|
|
| MD5 |
ae4b0b8433651b17d7e179d60e496b73
|
|
| BLAKE2b-256 |
75d7f0cb715886a634f24ba841169848149f24908cda84acb7832df518e57845
|
File details
Details for the file pygorse-0.4.9-py3-none-any.whl.
File metadata
- Download URL: pygorse-0.4.9-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49080601e4070499e5ba70bf743b5b57cc6335dc1b025f73a1dc671b6296b1e8
|
|
| MD5 |
331c0b75c189c1f7431ebf4d9e979881
|
|
| BLAKE2b-256 |
2e32c7addcae0aadb5b2617e9f173914e470e5aef0d5a0fae7d0be997fdc726c
|
File details
Details for the file PyGorse-0.4.9-py3-none-any.whl.
File metadata
- Download URL: PyGorse-0.4.9-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
679c45773fb58e54c812ea24c342ce26c3ad7903989e2b03e40057c688399887
|
|
| MD5 |
1de99306f2aaa74c5a4ef669832628fd
|
|
| BLAKE2b-256 |
0530a2e8ad727c360b9e4ae3d17d33948fdde6729f9ce3e1c8020fa6306db39c
|