Easy to use API Wrapper for somerandomapi.ml.
Project description
Overview
somerandomapi is an API Wrapper for some-random-api.ml
Examples
Asynchronous
from somerandomapi import Animal
import asyncio
async def main():
async with Animal.dog as resp:
print(
f"Fact: {resp.fact}",
f"Image: {resp.image}",
sep="\n"
)
asyncio.run(main())
Synchronous
from somerandomapi import Animal
with Animal.dog as resp:
print(
f"Fact: {resp.fact}",
f"Image: {resp.image}",
sep="\n"
)
Easy, isn't it?
Documentation
I am not completely happy with the docs and its still being fixed but its pretty usable, click here to check it.
Note
- Not all endpoints has been added yet. However those will be added soon. (95% Completed.)
I will not add it to Pypi until I add support for all the endpoints. Follow the steps listed below to use it.It has been added.
How to install
- Manual
- First clone the repository.
- Install the packages listed in requirements.txt
py -m pip install -r requirements.txt
- Copy the folder somerandomapi to where you want to use it.
- You may then use the wrapper by importing
somerandomapi.
- Pypi
py -m pip install somerandomapiml- That's it.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
somerandomapiml-1.0.2.tar.gz
(7.4 kB
view details)
File details
Details for the file somerandomapiml-1.0.2.tar.gz.
File metadata
- Download URL: somerandomapiml-1.0.2.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab0cd6ee7e85f9a7011f94b5cdbba8ab63eb0e1c3d66a6f24cb8f14d3c45f68d
|
|
| MD5 |
be0f6443177d8afd84b249a014e1c9dc
|
|
| BLAKE2b-256 |
ce6573bccc878ef229fa3acadfabd4d70471cfe9ba8a1c5deb8a5c134b1500f6
|