PRSAW 0.4.0
PRSAW, an acronym for Python Random Stuff API Wrapper, is a wrapper for the Random Stuff API.
PyPI: https://pypi.org/project/prsaw/
Installation
You can install released versions of prsaw from the Python Package Index with pip or a similar tool:
Stable Release: pip install prsaw
Working Version: pip install git+https://github.com/CodeWithSwastik/prsaw.git
Example Usage (No API KEY)
# import the module
from prsaw import RandomStuff
# initiate the object
rs = RandomStuffV2()
# get a response from an endpoint
response = rs.get_ai_response("How are you?")
print(response)
# close the object once done (recommended)
rs.close()
Example async usage (With an API key)
# import the module
from prsaw import RandomStuff
# initiate the object with async mode
api_key = "Your API Key"
rs = RandomStuff(async_mode = True, api_key = api_key)
# get a joke
joke = await rs.get_joke()
print(joke)
# close the session
await rs.aclose()
Plans
If you've purchased a premium plan you can pass that as a paramater to RandomStuffV3 or RandomStuffV4
plan = "Can be pro/biz/mega/ultra"
rs = RandomStuffV4(api_key = api_key, plan=plan)
Server (V4)
You can specify the server in RandomStuffV4 if you want
server = "Can be primary/backup/unstable"
rs = RandomStuffV4(api_key = api_key, server=server)
Misc
You can also pass dev_name, bot_name and ai_language as paramaters to RandomStuffV3 or RandomStuffV4.
Functions available
The current list of asynchronous functions available are:
# endpoints
await get_joke(_type) # Refer to https://api.pgamerx.com/endpoints
await get_image(_type) # for all the endpoints
await get_ai_response(msg)
# others
await aclose() # closes the object
Important Links
- Register API key - Click Here
- Documentation/Endpoints - Click Here
Metadata
Release files for prsaw 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| prsaw-0.4.0.tar.gz | 4.8 kB | Without provenance | Details for prsaw-0.4.0.tar.gz |
Release files / prsaw-0.4.0.tar.gz
| Download URL | prsaw-0.4.0.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a6cf9516829d67d1d81274990cf26a51dbe0aacfb1c95e697c40cfcd0ead379
|
|
BLAKE2b-256 checksum How to use checksums |
3fc2bfb3ee30541a147cc05d0f206cbb33bf23165d7dbc10d5e9dbabd2f083d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.10.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.8.5
|
Security for prsaw 0.4.0
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.