Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sambhav/pykarma
A python API wrapper for Karma Decay
https://github.com/sambhav/pykarma
api decay karma python reddit wrapper
Last synced: 30 days ago
JSON representation
A python API wrapper for Karma Decay
- Host: GitHub
- URL: https://github.com/sambhav/pykarma
- Owner: sambhav
- License: mit
- Created: 2017-09-02T22:10:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-23T12:55:19.000Z (about 6 years ago)
- Last Synced: 2024-11-14T05:45:21.029Z (about 1 month ago)
- Topics: api, decay, karma, python, reddit, wrapper
- Language: Python
- Homepage: https://pypi.python.org/pypi/pykarma
- Size: 4.88 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pykarma
Unofficial Python API wrapper for [karmadecay.com](http://karmadecay.com)## Usage
```python
from pykarma import find# Fetch only the submission URLs of the matches
results = find("http://i.imgur.com/OOFRJvr.gifv")
for result in results:
print(result)# Fetch matches within a specific subreddit
results = find("http://i.imgur.com/OOFRJvr.gifv", subreddit="example")
for result in results:
print(result)# Fetch matches within multiple subreddits
results = find("http://i.imgur.com/OOFRJvr.gifv", subreddit=["example", "bottesting"])
for result in resultS:
print(result)# Fetch complete details about the matches
results = find("http://i.imgur.com/OOFRJvr.gifv", fetch_praw=True)
for result in results:
print(result.url)
print(result.score)```
You can also combine `fetch_praw` and `subreddit` to get submission objects on a specific subredditThe API returns a [PRAW Submission Object](http://praw.readthedocs.io/en/latest/code_overview/models/submission.html).
Read the [PRAW documentation](http://praw.readthedocs.io/en/latest/code_overview/praw_models.html) to learn how to use it.## Installation
* From pip:
pip install pykarma
* From source:
git clone https://github.com/samj1912/pykarma
python setup.py install