Skip to main content

devRantSimple

A simple devRant api wrapper for the lazy people

Installation

First, get it from pip

pip install devRantSimple

Then, import the library

import devRantSimple as dRS

That's it!

Usage

These are the avalible functions and vars:

import devRantSimple as dRS

# Rant Types
# These are passed in to some functions to specify what data you want returned
dRS.RantType.algo   # Algo
dRS.RantType.top    # Top
dRS.RantType.recent # Recent

# Invalid Response
# This is a string returned by some functions when something goes wrong.
# It is always a smart idea to check if the thing returned by the function you are using is equal to this
# If it is, you messsed up somewhere. (or the api changed)
dRS.InvalidResponse

# Functions
dRS.getUserId("<username>")   # Get a user id from a username (returns an int)
dRS.userExists("<username>")  # Check to see if a user exists with this username (returns a bool)

dRS.getRant(dRS.RantType.<type>, <n>) # Get the n'th rant from list <type> 
# Example return data for these parameters: (dRS.RantType, 1):
# {'id': 1604103, 'text:': "Oh yeah. Hey guys. 2 things. \nFirst off. Forgot to say. Officially got a job. Finally. So thank you for all the help/advice and patience with my depressive rants!! \n\nI'm in a new chapter of my life now so thanks. \n\nAnd secondly. \n\nI FUCKING HATE MY JOB", 'score': 66, 'username': 'al-m'}

dRS.getUserRant("<username>", <n>)  # Get the n'th most recent rant posted by <username>
# Example return data for these parameters: ("ewpratten", 1):
# {'text': 'I wonder..\n\nDo the new devduck capes say "devrant.com" on the back? Or do they still say "devrant.io"', 'score': 20, 'tags': ['devrant', 'i wonder'], 'id': 1600704}

More functions, data, and info will come soon.

Example

This is an example script that gets every rant posted by a user (one at a time) and prints it to the screen:

import devRantSimple ad dRS

username = "ewpratten

prevdata = ""
i = 0
while prevdata != dRS.InvalidResponse:
	prevdata = dRS.getUserRant(username, i)["text"]
	print(prevdata)
	i+=1

Release files for devRantSimple 2.2

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

Source distribution (sdist)

Source distribution for devRantSimple 2.2
File Size Uploaded
devRantSimple-2.2.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for devRantSimple 2.2
File Interpreter ABI Platform
devRantSimple-2.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.3 kB

Release files / devRantSimple-2.2.tar.gz

Download URL devRantSimple-2.2.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e6ef72278f2772cec6dbf4ac86e30b43579e20c9bcd980acee5907186430774b
BLAKE2b-256 checksum
How to use checksums
390abd9ff6e227b9d916e16a57656c026837af6cb1eb377d2eb4460c7869ab19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4

Release files / devRantSimple-2.2-py3-none-any.whl

Download URL devRantSimple-2.2-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2981b9e1a1ba608e4546354b75afc80cd062c1d804485d34a84cf0f182704bf
BLAKE2b-256 checksum
How to use checksums
2ee95bba48b5ae8c5e5c7fad086984baa70a71217eff6773ef74a0390d83c4d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4

Release history Release notifications | RSS feed

This release

2.2 This release

2 release files

2.1

2 release files

2.0

2 release files

1.11

2 release files

1.10

2 release files

1.9

2 release files

1.8

2 release files

1.7

2 release files

1.6

2 release files

1.5

2 release files

1.4

2 release files

1.2

2 release files

1.1

2 release files

1.0

2 release files

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