Skip to main content

A Python wrapper for the Snoonotes API

Project description

PySnooNotes

PyPI PyPI license Python Version

Python wrapper for the Snoonotes API

Supported Features:

  1. Fetch notes for a particular user
  2. Fetch Subreddit Notes - Caching implemented
  3. Add notes for a user
  4. Removing usernotes for a user

Depends On:

requests==2.23.0

Usage:

Imports

To use in your python project, use:

from pysnoonotes.core import SnooNotes

Sample Usage

Authenticate using a Reddit account that can add usernotes and a user_key for that account that can be generated from "https://snoonotes.com/#!/userkey". The generated key is sent via PM to your reddit account.

sn = SnooNotes("username", "user_key")
  1. Returns a dictionary with usernames and their associated usernotes:
notes_for_username = sn.get_notes_for_user("username")
notes_for_usernames12 = sn.get_notes_for_user(["username1", "username2"])
  1. Returns notes supported in that particular subreddit:
subreddit_notes = sn.get_notes_for_subreddit("subreddit")

NOTE: This function caches queries using a pickle file to ./caches directory to prevent repeated API requests. By default it automatically updates caches once a day. However, using use_cache=False, you can manually trigger a call that bypasses cache (this call will also update the cache)

  1. Add a new usernote for the user under a subreddit with a custom note and a link to the comment/post:
sn.add_note_for_user("username", "note_type_id", "subreddit", "Reason for note", "www.reddit.com/r/subreddit/123abc/.../123abc")
  1. Delete a usernote for a given username, given a note_id.
sn.delete_note_for_user("username","note_id")

The above is also summarized in the sample.py script

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

pysnoonotes-1.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

pysnoonotes-1.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file pysnoonotes-1.1.0.tar.gz.

File metadata

  • Download URL: pysnoonotes-1.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for pysnoonotes-1.1.0.tar.gz
Algorithm Hash digest
SHA256 224a27feb5dd8db0b3ba5d49064310b76d1f620d8dc531c3d09e79ae9fc1b85b
MD5 51ec70d4b272701934d380acea92f465
BLAKE2b-256 9f66ba89823573a99f77e5e889d0f3f8db68c20314b255aef65a32c8a24586ea

See more details on using hashes here.

File details

Details for the file pysnoonotes-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pysnoonotes-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for pysnoonotes-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4007190fa7ff7be76a2f126a071f821b6b11400d5a32d593a2b8c9faedcc87ff
MD5 5fdf0811d7d832674eae5b0df8dd5abe
BLAKE2b-256 20a8af3de0067cff3ad077d6f4b97e91f95d9c238ce021e8912bde8fe38c6e6d

See more details on using hashes here.

Supported by

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