Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.
/ dhravyapy Public archive

An asynchronous API wrapper for the DhravyaAPI

License

Notifications You must be signed in to change notification settings

27Saumya/dhravyapy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deprecated [API no longer exists]

DhravyaPy is a basic, asynchronous wrapper for the DhravyaAPI

DhravyaPy works with Python 3.8+

Features

  • Easy to use OOP design
  • Get random jokes
  • Get random topics
  • Generate images and memes
  • And much more!

Installation

To install the library through PyPi use:-

pip install dhravyapy

To install the development version(using git):-

pip install git+https://github.com/27Saumya/dhravyapy

Examples

To get a random joke

import dhravyapy
import asyncio

async def main():
    joke = await dhravya.Fun.joke()
    print(joke)


if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

To generate a qrcode

import dhravyapy
import asyncio

async def main():
    # the text of the qrcode(can be links or just normal text)
    text = "https://api.dhravya.me" 
    qrcode = await dhravya.Image.qrcode(text)
    # saving the image of the qrcode
    await qrcode.save("qrcode.png")


if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

For more examples check out the examples directory.