An official Python wrapper for api.loopy5418.dev
Project description
About
loopypy is a wrapper for api.loopy5418.dev made in Python.
It's easy for people that don't know how to make HTTP requests.
Setup
First install the package with
pip install loopypy
Then paste this into you app.py (or whatever you call it!)
import loopypy
# Or you can just do
# from 'loopypy' import setApiKey, getApiKey, ai
loopypy.setApiKey("Secret!")
# You can get your api key at our server
# https://discord.gg/ZwK2W7GxhA
# Open AI
ask = loopy.ai("Hello, how are you! What's the weather in New York?")
print(ask.response)
# After running check your terminal!
# It should say something like:
# "Hello! I'm just a program, so I
# don't have feelings, but I'm here to help you.
# I don't have real-time data on the weather.
# For the most accurate and current weather
# information in New York, please check a
# reliable weather website or app."
Function List
| Name | Description | API Key |
|---|---|---|
setApiKey(key) |
Sets the API key for automated gathering later on. | x |
getApiKey() |
Returns the API key | Required |
ai(prompt, speed) |
Uses the /openai/text endpoint to generate text from ChatGPT. | Required |
owoify(text) |
Owoifies the text and returns it | Optional |
emojify(text) |
Turns the text into regional indicators in Discord format. | Optional |
qr(data) |
Turns the given data into a QR code and returns the image buffer. | Required |
currency(base, target, amount) |
Converts one currency to another. | Required |
seconds_to_time(seconds) |
Converts given seconds into formatted time (HH:MM:SS) | Optional |
pick(*args) |
Picks an option off of the given ones. | Optional |
ascii_art(text) |
Returns multiline ascii art off of the given text. | Optional |
Coming Soon |
More functions are coming soon. |
Function Usages
setApiKey(key)
Sets the API key for later use. Required for most endpoints.
Syntax:
key: string, required
Example Usage:
import loopypy
loopypy.setApiKey("xxxxx-xxxxxx-xxxxx-xxxxx")
print(loopypy.getApiKey()) # Prints the key you set
getApiKey()
Retrieves and returns the current API key.
Example Usage:
import loopypy
loopypy.setApiKey("xxxxx-xxxxxx-xxxxx-xxxxx")
print(loopypy.getApiKey()) # Prints the key you set
ai(prompt, speed)
Uses the /openai/text endpoint to generate text from ChatGPT.
Syntax:
prompt: String, requiredspeed: Integer, optional, defaults to 1. (0: large, 1: balanced, 2: fast)
Children:
.response.model.prompt.success
Example Usage:
import loopypy
loopypy.setApiKey("xxxxx-xxxxxx-xxxxx-xxxxx")
ask = loopypy.ai("What's the capital of France?")
print(f"Response: {ask.response}")
print(f"Model: {ask.model}")
owoify(text)
Owoifies the text and returns it.
Syntax:
text: string, required
Example Usage:
import loopypy
print(loopypy.owoify("Hello!"))
emojify(text)
Turns the text into regional indicators in Discord format.
Syntax:
textstring, required
Example Usage:
import loopypy
print(loopypy.emojify("Hello")) # Prints the key you set
qr(data)
Turns the given data into a QR code and returns the image buffer.
Syntax:
data: string, required
Example Usage:
import loopypy
loopypy.setApiKey("xxxxx-xxxxxx-xxxxx-xxxxx")
buffer = loopypy.qr("Hello!") # get image buffer
with open("image.png", "wb") as f:
f.write(buffer)
print("QR Code image saved to file!")
currency(base, target, amount)
Converts one currency to another.
Syntax:
base: string, requiredtarget: string, requiredamount: integer, required
Children:
.rate.converted.success
Example Usage:
import loopypy
loopypy.setApiKey("xxxxx-xxxxxx-xxxxx-xxxxx")
cur = loopypy.currency("USD", "EUR", 1)
print(f"Converted Money: {cur.converted}")
print(f"Rate: {cur.rate}")
seconds_to_time(seconds)
-# This function will soon be changed to fit the children system. E.g. print(seconds_to_time.seconds)
Converts given seconds into formatted time (HH:MM:SS)
Syntax:
secondsinteger, required
Example Usage:
import loopypy
seconds = 260 # is 4 minutes and 20 seconds
print(loopypy.seconds_to_time(seconds)) # prints 00:04:20
pick(*args)
Picks one of the given options.
Syntax:
args: multiple objects, required
Example Usage:
import loopypy
print(loopypy.pick("Hello", "Hi", 1, 5)) # Outputs one of the options.
ascii_art(text)
Generates multiline ascii art.
Syntax:
text: string, required
Example Usage:
import loopypy
print(loopypy.ascii_art("Hello")) # Prints the multiline ascii text
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file loopypy-1.0.6.tar.gz.
File metadata
- Download URL: loopypy-1.0.6.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
743bab0cce8a1da9fe2dbd0089f49f8908808edc4a1de1dc688be4f5878976fc
|
|
| MD5 |
73e37708040e4e8c41659f497461b209
|
|
| BLAKE2b-256 |
c2b9462013590f44b2e3a3f3071c12b544a1ee36e72b2becbb8759c9423600ce
|
File details
Details for the file loopypy-1.0.6-py3-none-any.whl.
File metadata
- Download URL: loopypy-1.0.6-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05317ee5d4871854e02c31078e178b359e2a95fd7dc45f1b6e51a377c2d0cf10
|
|
| MD5 |
56ad0fbb1401e8f5974d5195c6d1a8d1
|
|
| BLAKE2b-256 |
143920cb7051460a310a72fcf04cebb79ac3456cc157c81f7fc00325ffba7fdc
|