Skip to content

eeriemyxi/somerandomapi-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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?

I am not completely happy with the docs and its still being fixed but its pretty usable, click here to check it.

Note

  • I added support for all endpoints except binary and base64 because Python has built-in libraries for those operations which are faster. However, if someone makes a good pull request for it, I will merge it.

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.

About

Easy to use API Wrapper for somerandomapi.ml.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published