This is a python wrapper for "the best api in the world"

Overview

This is a python wrapper for my api

api_url = "https://api.dhravya.me/"

This wrapper now has async support, its basically the same except it uses asyncio

Features:

  • Generate a qr code for text, url, image, or basically anything, in many different, fancy formats
  • OCR: Get text from an image or an image URL
  • Meme: Smartly get a meme from any topic (sourced from reddit)
  • Basic generators are:
    • compliment: returns a compliment
    • would you rather: returns a would you rather question
    • joke: Returns a (bad) joke

Getting started

  • Install the package from pypi
pip install dhravyaAPI

Dependency: requests

pip install --upgrade requests

Usage and examples

Sync(normal)

>>> # Get an 8ball response
>>> from dhravyaapi import DhravyaAPI
>>> dhravyaapi = DhravyaAPI() # Create a new instance of the API
>>> response = dhravyaapi.eightball()

For OCR:

>> # Or, if you have a url: >>> text = dhravyaapi.ocr(url="https://i.imgur.com/sdfsfXyYsf8Q.jpg")">
>>> from dhravyaapi import DhravyaAPI
>>> dhravyaapi = DhravyaAPI()
>>> text = dhravyapi.ocr(image=BytesIO(open("1u8om0jymh581.jpg", "rb").read()))
>>> # Or, if you have a url:
>>> text = dhravyaapi.ocr(url="https://i.imgur.com/sdfsfXyYsf8Q.jpg")

To get a Meme:

>> # Note that this returns a dictionary if url_only is False">
>>> from dhravyaapi import DhravyaAPI
>>> dhravyaapi = DhravyaAPI()
>>> meme = dhravyaapi.meme(topic="memes")
>>> # Note that this returns a dictionary if url_only is False

To generate a qr code:

>> # Note that this returns an image object that can be saved to a file">
>>> from dhravyaapi import DhravyaAPI
>>> dhravyaapi = DhravyaAPI() # Create a new instance of the API
>>> qr_code= dhravyaapi.qrcode(query="Hello, World!", drawer=1, mask=1)))
>>> # Note that this returns an image object that can be saved to a file

Basic generators:

>>> from dhravyaapi import DhravyaAPI
>>> dhravyaapi = DhravyaAPI()
>>> compliment = dhravyaapi.compliment()
>>> from dhravyaapi import DhravyaAPI
>>> dhravyaapi = DhravyaAPI()
>>> wyr = dhravyaapi.wyr()
>>> from dhravyaapi import DhravyaAPI
>>> dhravyaapi = DhravyaAPI()
>>> joke = dhravyaapi.joke()

Async usage:

Its basically the same as synchronised version, except you need to await every call. example:

QR code:

from dhravyaAPI import AsyncClient
import asyncio
client = AsyncClient(loop=asyncio.get_event_loop())
async def do_stuff():
  qr_code = await client.qrcode(query="This is an example", drawer=3)
  # Do whatever you want with the qr code
asyncio.get_event_loop().run_until_complete(do_stuff())

Meme example:

from dhravyaAPI import AsyncClient
import asyncio
client = AsyncClient(loop=asyncio.get_event_loop())
async def get_meme():
  meme = await client.meme(topic:"python")
  print(meme)
asyncio.get_event_loop().run_until_complete(get_meme())
You might also like...
A simple Python wrapper for the archive.is capturing service

archiveis A simple Python wrapper for the archive.is capturing service. Installation pipenv install archiveis Python Usage Import it. import archi

Ark API Wrapper in Python
Ark API Wrapper in Python

Pythark Ark API Wrapper in Python. Built with Python Requests Installation Pythark uses Arky to create a new transaction, if you want to use this feat

Bitstamp API wrapper for Python

NOTICE: THIS REPOSITORY IS NO LONGER ACTIVELY MAINTAINED It is highly unlikely that I will respond to PRs and questions about usage. This library was

An API wrapper for Discord written in Python.

discord.py A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Modern Pythonic API using asyn

Python wrapper for eBay API

python-ebay - Python Wrapper for eBay API This project intends to create a simple python wrapper around eBay APIs. Development and Download Sites The

A thin Python Wrapper for the Dark Sky (formerly forecast.io) weather API

Dark Sky Wrapper This is a wrapper for the Dark Sky (formerly forecast.io) API. It allows you to get the weather for any location, now, in the past, o

:globe_with_meridians: A Python wrapper for the Geocodio geolocation service API

Py-Geocodio Python wrapper for Geocodio geocoding API. Full documentation on Read the Docs. If you are upgrading from a version prior to 0.2.0 please

Python wrapper for the GitLab API

Python GitLab python-gitlab is a Python package providing access to the GitLab server API. It supports the v4 API of GitLab, and provides a CLI tool (

Unofficial Python wrapper for official Hacker News API

haxor Unofficial Python wrapper for official Hacker News API. Installation pip install haxor Usage Import and initialization: from hackernews import H

Releases(1.0)
Owner
Dhravya Shah
Hi, I'm Dhravya (aka SpaceDoggo) ! 👋 I am a 16 year old interested in software development. I am mainly specialised in Python automation, discord bots, De
Dhravya Shah
Discord-Wrapper - Discord Websocket Wrapper in python

This does not currently work and is in development Discord Websocket Wrapper in

null 3 Oct 25, 2022
A wrapper for slurm especially on Taiwania2 (HPC CLI)A wrapper for slurm especially on Taiwania2 (HPC CLI)

TWCC-slurm-wrapper A wrapper for slurm especially on Taiwania2 (HPC CLI). For Taiwania2 (HPC CLI) usage, please refer to here. (中文) How to Install? gi

Chi-Liang, Liu 5 Oct 7, 2022
Aws-lambda-requests-wrapper - Request/Response wrapper for AWS Lambda with API Gateway

AWS Lambda Requests Wrapper Request/Response wrapper for AWS Lambda with API Gat

null 1 May 20, 2022
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python Reddit API Wrapper Development 3k Dec 29, 2022
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python Reddit API Wrapper Development 3k Dec 29, 2022
Volt is yet another discord api wrapper for Python. It supports python 3.8 +

Volt Volt is yet another discord api wrapper for Python. It supports python 3.8 + How to install [Currently Not Supported.] pip install volt.py Speed

Minjun Kim (Lapis0875) 11 Nov 21, 2022
A python Discord wrapper made in well, python.

discord.why A python Discord wrapper made in well, python. Made to be used by devs who want something a bit more, general. Basic Examples Sending a me

HellSec 6 Mar 26, 2022
A wrapper for aqquiring Choice Coin directly through a Python Terminal. Leverages the TinyMan Python-SDK.

CHOICE_TinyMan_Wrapper A wrapper that allows users to acquire Choice Coin directly through their Terminal using ALGO and various Algorand Standard Ass

Choice Coin 16 Sep 24, 2022
Actively maintained, pure Python wrapper for the Twitter API. Supports both normal and streaming Twitter APIs.

Twython Twython is a Python library providing an easy way to access Twitter data. Supports Python 3. It's been battle tested by companies, educational

Ryan McGrath 1.9k Jan 2, 2023
A simple Python wrapper for the Amazon.com Product Advertising API ⛺

Amazon Simple Product API A simple Python wrapper for the Amazon.com Product Advertising API. Features An object oriented interface to Amazon products

Yoav Aviram 789 Dec 26, 2022