Skip to main content

An official Python wrapper for api.loopy5418.dev

Project description

loopy-ts

The official Python wrapper for api.loopy5418.dev.


Discord Server     Website    



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, required
  • speed: 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:

  • text string, 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, required
  • target: string, required
  • amount: 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:

  • seconds integer, 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

loopypy-1.0.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loopypy-1.0.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file loopypy-1.0.1.tar.gz.

File metadata

  • Download URL: loopypy-1.0.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for loopypy-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d6c5b2a9ed78deeb7435babf5537b8d35cf562e4395c97a26de3a5b39f8ceb0a
MD5 ce504451105f17948822ba73211aed0a
BLAKE2b-256 9f6553ff384fd2f3bff919148ce67198404388f0436ff528925a78c657c79bef

See more details on using hashes here.

File details

Details for the file loopypy-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: loopypy-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for loopypy-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c47121d429dd017273aa046b9de9f701a13c7b7743a0fc4bc762dc2ccd6f04a
MD5 674d4d8c30cf376930b0d3141f4b1883
BLAKE2b-256 2e239653e282eb33e01a565ec3515caf60db0f3ff55994d7141a7ea53988b122

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page