Skip to main content

Useful towel-related stuff.

Project description

reddit2md

Turn your favorite reddit post to .md file... That's it.

Description

Put in praw.Submission object and get Markdown file of that post for printing/archiving stuff.

Getting Started

Dependencies

  • Praw
  • pytz (for Posted date timezone stuff)

Installing

  • pip install reddit2md

Quickstart

import praw, reddit2md, settings

reddit = praw.Reddit(
                client_id = settings.credentials['client_id'],
                client_secret = settings.credentials['client_secret'],
                user_agent = settings.credentials['user_agent'],
            )

# reddit.config.decode_html_entities = True # Consider decoding HTML as some of the HTML entities might show up undecoded.

posts = reddit.subreddit('learnpython').hot(limit=5)

for post in posts:
    reddit2md.r2md(post, file_name=post.title ,timezone='Asia/Seoul') # file_name and timezone are both optional.

Before you use

reddit2md does not do any file management. It will actually raise an Exception when the file already exists. It simply writes new file.

Author

Lewis Lee @lewisleedev

Version History

  • 0.1.0
    • Initial Release

License

This project is licensed under the MIT License - see the LICENSE file for details

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

reddit2md-0.2.0.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

reddit2md-0.2.0-py3-none-any.whl (4.7 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