Skip to main content

Iterate posts from subreddit asynchronously

Project description

Itereddit

Iterate posts from subreddit. Posts are represented by dataclasses without unnecessary fields. So far, not all types of posts are covered, so I may need help adding new ones: you can just report the post and link in new issue

How to use it, Wapfelka?

Parsing media in the best resolution, for example:

import asyncio

from itereddit import Itereddit

itereddit = Itereddit()


async def main():
    async for i in itereddit:
        if i.media:
            if i.media.media_metadata:
                for m in i.media.media_metadata:
                    print(i.media.media_metadata[m].original.url)
            elif i.media.resolutions:
                print(i.media.resolutions[-1].url)


asyncio.run(main())

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

itereddit-1.0.1.tar.gz (7.9 kB view hashes)

Uploaded Source

Built Distribution

itereddit-1.0.1-py3-none-any.whl (8.3 kB view hashes)

Uploaded Python 3

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