Skip to main content

pydevrant

Unofficial Python wrapper for the public devRant API.

Based on the unofficial wrapper made by “danillouz” (here) and API docs from “abhn” (here).

From the official site: devRant is a fun community for developers to share and bond over their successes and frustrations with code, tech, and life as a programmer. devRant is built by just one developer (devRant: [@dfox](https://www.devrant.io/users/dfox) Twitter: [@dfoxinator](https://twitter.com/DFoxinator)) and one designer (devRant: [@trogus](https://www.devrant.io/users/trogus) Twitter: [@tim_rogus](https://twitter.com/tim_rogus)) working on this project nights and weekends.

Installation

Install using pip

pip install pydevrant

List of features

Currently, you can:

  • Get user ID

  • Get rants

  • Get a rant with comments

  • Search rants

  • Get user profile

  • Login with username/password

  • Post a rant

  • Vote a rant

  • Vote a comment

(Note: search results are JSON-formatted data)

Example

Post a rant

from pydevrant import *

client = Auth()
user = client.login("USERNAME", "PASSWORD")

#first argument is body (string)
#second argument is tags (string, make sure comma seperated)
#third argument is type (int, 1 for rant, 5 for collab)

client.post("this is my rant, do you like it?", "swift, react, js", 1)

Vote a rant/comment

#first argument is type (rant/comment)
#second argument is RANT_ID
#third argument is value. (+1 for upvote, -1 for downvote)
#(can only be +1 or -1. server rejects requests if any other data)

client.vote("rant", 1292812, +1)    #for voting on a rant
client.vote("comment", 1372121, +1)    #for voting on a comment

Find the top rants but limit the results to just one

from pydevrant import *
from pprint import pprint #just for nice output on terminal

elem = RantParser()
result = elem.get_rants(sort="top",limit=1)

pprint(result)

The output will be something like this (some parts removed for brevity):

{'news': {'action': 'grouprant',
          'body': 'Bad data loss story?',
          'footer': "Add tag 'wk98' to your rant",
          'headline': 'Weekly Group Rant',
          'height': 100,
          'id': 132,
          'type': 'intlink'},
 'rants': [{'attached_image': '',
            'created_time': 1474486614,
            'edited': True,
            'id': 194632,
            'num_comments': 155,
            'rc': 1,
            'rt': 1,
            'score': 2672,
            'tags': [],
            'text': 'It appears his main client had gone nuts with him because '
                    'they wanted him to make an internet toolbar (think '
                    "Ask.com) and he politely informed them toolbars doesn't "
                    "really exist anymore and it wouldn't work on things like "
                    'modern browsers or mobile devices.\n'
                    ....
                    ',
            'user_avatar': {'b': 'f99a66',
                            'i': 'v-18_c-3_b-3_g-m_9-1_1-2_16-13_3-5_8-2_7-2_5-2_12-2_6-11_10-9_2-42_15-11_11-4_4-2.jpg'},
            'user_avatar_lg': {'b': 'f99a66',
                               'i': 'v-18_c-1_b-3_g-m_9-1_1-2_16-13_3-5_8-2_7-2_5-2_12-2_6-11_10-9_2-42_15-11_11-4_4-2.png'},
            'user_id': 103918,
            'user_score': 4909,
            'user_username': 'peaam',
            'vote_state': 0}],
 'set': '5ac3b0a97b094',
 'settings': [],
 'success': True,
 'wrw': 98}

Metadata

Release files for pydevrant 0.21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydevrant 0.21
File Size Uploaded Provenance Actions
pydevrant-0.21.tar.gz 4.3 kB Without provenance Details for pydevrant-0.21.tar.gz

Release files / pydevrant-0.21.tar.gz

Download URL pydevrant-0.21.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
13be7cf21091aa59209a6b2419fd73dc00162bd4aeb403c09292cf442a28b4c7
BLAKE2b-256 checksum
How to use checksums
8363600aba441ecd17183224eecdc60f6eb7caebf075f1aad15ff93f4fcf650c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pydevrant 0.21

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page