Skip to main content

Python SDK for gorse recommender system

Project description

PyGorse

CI

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


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)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pygorse-0.4.9-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

PyGorse-0.4.9-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

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

Hashes for pygorse-0.4.9.tar.gz
Algorithm Hash digest
SHA256 435ef3b08ae78ce7ee71507c82b4636270533308eece4680e38578cc58fba25a
MD5 ae4b0b8433651b17d7e179d60e496b73
BLAKE2b-256 75d7f0cb715886a634f24ba841169848149f24908cda84acb7832df518e57845

See more details on using hashes here.

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

Hashes for pygorse-0.4.9-py3-none-any.whl
Algorithm Hash digest
SHA256 49080601e4070499e5ba70bf743b5b57cc6335dc1b025f73a1dc671b6296b1e8
MD5 331c0b75c189c1f7431ebf4d9e979881
BLAKE2b-256 2e32c7addcae0aadb5b2617e9f173914e470e5aef0d5a0fae7d0be997fdc726c

See more details on using hashes here.

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

Hashes for PyGorse-0.4.9-py3-none-any.whl
Algorithm Hash digest
SHA256 679c45773fb58e54c812ea24c342ce26c3ad7903989e2b03e40057c688399887
MD5 1de99306f2aaa74c5a4ef669832628fd
BLAKE2b-256 0530a2e8ad727c360b9e4ae3d17d33948fdde6729f9ce3e1c8020fa6306db39c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page