Skip to content

Commit

Permalink
added readme and fix PEP8 Warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mmshivesh committed Jul 18, 2020
1 parent 2e548a4 commit 0171f45
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# PySnooNotes

Python wrapper for the Snoonotes API

## Currently Supported Features:

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

## Not Supported Currently

1. Removing usernotes

## Usage

### Imports

To use in your python project, use:

`from SnooNotes.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")`

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"])`

Returns notes supported in that particular subreddit:

`subreddit_notes = sn.get_notes_for_subreddit("subreddit")`

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")`


The above is also summarized in the `sample.py` script
2 changes: 1 addition & 1 deletion sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
subreddit_notes = sn.get_notes_for_subreddit("subreddit")

# Add a new usernote to the user under the subreddit with a note with a link to the comment/post.
sn.add_note_for_user("username","note_type", "subreddit","Reason for note", "www.reddit.com/r/subreddit/123jks/.../jkas12")
sn.add_note_for_user("username", "note_type", "subreddit", "Reason for note", "www.reddit.com/r/subreddit/123jks/.../jkas12")

0 comments on commit 0171f45

Please sign in to comment.