Skip to main content

Reddit and python, made simple.

Project description

py-reddit

A package that can be used to get reddit submissions, and their various attributes. The package supports both synchronous and asynchronous development. I am more familiar with synchronous programming, but have tried my best at making a good asynchronous implementation. The package is written in Python 3.10, and uses requests and aiohttp as its main dependencies.

Updates will be coming soon, thank you for viewing this package, please consider using it.

Version - 1.1.10

Socials - KING7077 - GitHub

Installation methods:

pip3 install py-reddit

py -3 -m pip install py-reddit

python3 -m pip install py-reddit

Example usage:

import reddit

client = reddit.Client('agent', 'key')

subreddit = client.Subreddit('top', 'subreddit-here') # supports 'top', 'new' or 'hot' mode of submissions

print(subreddit.selftext(0)) #gets the selftext of the first post here

Asynchronus client:

import reddit
import asyncio

client = reddit.AsyncClient('agent', 'key')


async def main():
    subreddit = await client.Subreddit('top', 'subreddit-here') # supports 'top', 'new' or 'hot' mode of submissions
    print(await subreddit.selftext(0))

asyncio.run(main())

The package is still under active development

CHANGELOG

March 28, 2022

Small changes to the README. - 1.1.10

March 28, 2022

You no longer need to use __call__ (Found a way to use async __init__) - 1.1.9

March 16, 2022

Changes to the async client usage (Need to use __call__()) - 1.1.8

March 16, 2022

License changes - 1.1.7

February 21, 2022

Just changing package DIRs - 1.1.6

February 21, 2022

Just changing package DIRs - 1.1.5

February 21, 2022

You can now specify the number of posts you want to fetch in Client.Subreddit() and AsyncClient.Subreddit(). For example:

import reddit

subreddit = reddit.Client('agent', 'key').Subreddit('top', 'memes', 100) # To fetch 100 posts. If a limit is not specified, it defaults to 25

Similar for the Async Client

limit does not follow a zero index, but all the methods under Subreddit() follow zero index. This may be changed sooner or later

​- 1.1.4

February 20, 2022

Bettered the asynchronous implementation of the project. Much faster now. Renamed Client.Subreddit.url to Client.Subreddit.post_url, the same change for the asynchronous client - 1.1.3

February 19, 2022

Minor changes to the description of the project - 1.1.2

February 19, 2022

Minor changes to the description of the project - 1.1.1

February 19, 2022

The project actually works now - 1.1.0

February 18, 2022

Minor changes to make the project more usuable - 1.0.6

February 18, 2022

Minor changes to make the project more usuable - 1.0.5

February 18, 2022

Minor changes to make the project more usuable - 1.0.4

February 18, 2022

Minor changes to make the project more usuable - 1.0.3

February 18, 2022

Minor changes to the description of the project - 1.0.2

February 18, 2022

Initial release - 1.0.1

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

py-reddit-1.1.10.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

py_reddit-1.1.10-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file py-reddit-1.1.10.tar.gz.

File metadata

  • Download URL: py-reddit-1.1.10.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.0

File hashes

Hashes for py-reddit-1.1.10.tar.gz
Algorithm Hash digest
SHA256 77caaaa2375bf6112adb8f0d2597961f6c6336bee3fe963ae3fdd8df14860d85
MD5 3ee8ea1335be881d8774a83cd49c0f43
BLAKE2b-256 1f472af61fe1dcce69306588f4e3bfb43c60aeaf565e79271b016129a50f1cdb

See more details on using hashes here.

File details

Details for the file py_reddit-1.1.10-py3-none-any.whl.

File metadata

  • Download URL: py_reddit-1.1.10-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.0

File hashes

Hashes for py_reddit-1.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 c2acfc89a1399b822891aaf60f1174936058aacee98c318220570efd4f53d94f
MD5 fb49e5f4c5f2d683c58fed867fe4e1e4
BLAKE2b-256 8f429289734a3d5add72e871b79cefcff8c02f165feece8acae60d2b53d43d7a

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