An asynchronous wrapper for interacting with the Dhravya API
Project description
DhravyaPy
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
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 dhravyapy.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 dhravyapy.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 see the examples directory.
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
dhravyapy-0.0.6.tar.gz
(8.3 kB
view details)
Built Distribution
File details
Details for the file dhravyapy-0.0.6.tar.gz
.
File metadata
- Download URL: dhravyapy-0.0.6.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.3 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c10e1680b7c8fb2b922fdcd4b16f773539223e05846994fbd2aaddce4549bcab |
|
MD5 | 99e1a7112d02b3eb3188974789a25a46 |
|
BLAKE2b-256 | 50a8550944a678bb330e0c2289d0be60f3f1f244d0ad89444219ae8adb1d4794 |
File details
Details for the file dhravyapy-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: dhravyapy-0.0.6-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.3 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32238f86a5e8bb3173ff6d4a2e74698f74f6e67738370ae6d14cb79787d9d529 |
|
MD5 | 4277ce86fa910890e20183e3215b9df5 |
|
BLAKE2b-256 | bffd6eb473cbf9a4da192cccf3ad0ae2ba7e330dd5f6c07025ab3353f3dfba1b |