Skip to main content

prsaw2

Simple python API wrapper for the Random Stuff API.

  • Easy to use

  • Wraps the entire API

  • Supports both async and sync

  • Supports v2, v3 and v4 version of API

  • PyPi Package

  • Documentation

Installation

Installation can be done easily using the python package manager pip

pip install prsaw2

Quickstart

Firstly make sure to get the API key from here

Here are few examples to get you started.

Getting AI response

import prsaw2

client = prsaw2.Client(key='api-key-here')

response = client.get_ai_response("Hi there")
client.close()  # Not necessary
print(response)

Getting random joke

import prsaw2

client = prsaw2.Client(key='api-key-here')

response = client.get_joke(type="any")
client.close()  # Not necessary
print(response.joke)

Getting random image

import prsaw2

client = prsaw2.Client(key='api-key-here')

response = client.get_image(type="any")
client.close()
print(response)

Async Support

The library also supports async usage.

import prsaw2
import asyncio

client = prsaw2.AsyncClient(key="api-key-here")

async def coro():
  response = await client.get_ai_response("Hello world")
  await client.close()  
  print(response)

loop = asyncio.get_event_loop()
loop.run_until_complete(coro())

Metadata

Release files for prsaw2 0.42

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

Source distribution (sdist)

Source distribution for prsaw2 0.42
File Size Uploaded Provenance Actions
prsaw2-0.42.tar.gz 5.3 kB Without provenance Details for prsaw2-0.42.tar.gz

Built distribution (wheel)

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

Total release size: 10.4 kB

Release files / prsaw2-0.42.tar.gz

Download URL prsaw2-0.42.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
38d1bd402d3d909d5f8483ba9dd8211f910b83f3d0f7268965f5ece69fc2a855
BLAKE2b-256 checksum
How to use checksums
9447ead42f4df0f2e1403afa89443a162deb619ac5105ebc3403719906ccf907
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.6

Release files / prsaw2-0.42-py3-none-any.whl

Download URL prsaw2-0.42-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb7d37ab2fd596b952c29788cc63d630d902fcc1e96eead39e7d1513a21cd761
BLAKE2b-256 checksum
How to use checksums
374ae9d0ab8e3a8329d963395f21313619f8b13d70cae33bf708d415ac0feae5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.6

Security for prsaw2 0.42

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