Skip to main content

Fully asynchronous trace.moe API wrapper

Project description

AioMoe

Fully asynchronous trace.moe API wrapper

Installation

You can install the stable version from PyPI:

$ pip install aiomoe

Or get it from github:

$ pip install https://github.com/FeeeeK/aiomoe/archive/refs/heads/master.zip

Usage

Get info about your account

import asyncio
from aiomoe import AioMoe

tm = AioMoe() # or AioMoe(token="xxxxxxxx")

async def main():
    me = await tm.me()
    print(me)
    print(f"Used quota: {me.quota_used}/{me.quota}")

asyncio.run(main())

The output will be like this:

User(error=None, id='your ip', priority=0, concurrency=1, quota=1000, quota_used=0)
Used quota: 0/1000

Search anime

import asyncio
from aiomoe import AioMoe

tm = AioMoe()

async def main():
    image = "https://i.imgur.com/Xrb06w5.png"
    search_results = await tm.search(file_source=image, anilist_info=True)
    print(search_results.result[0].anilist.title.romaji)
    # 'Steins;Gate 0'

asyncio.run(main())

You can pass a link to an image, bytes or file-like object (io.BytesIO)

    with open("image.png", "rb") as file:
        search_results = await tm.search(file)

And use additional parameters such as:

  • anilist_info - Return an Anilist object instead of anilist id
  • cut_borders - Cut out black borders from screenshots
  • anilist_id - Filter results by anilist id

See Also

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Released under the MIT license.

Copyright by FeeeeK.

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

aiomoe-1.0.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiomoe-1.0.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file aiomoe-1.0.1.tar.gz.

File metadata

  • Download URL: aiomoe-1.0.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.8.10 Windows/10

File hashes

Hashes for aiomoe-1.0.1.tar.gz
Algorithm Hash digest
SHA256 52238dc9072cdd4eb6faf8f3ea8ba403d14bab5f93d2c53101f6b68b7786251c
MD5 6d457964732a62b1740c82bae5312151
BLAKE2b-256 f7ede3378d9e1d1f41ae34ff40e436ee165d17f0c3beb3578c4d52d591e1a40a

See more details on using hashes here.

File details

Details for the file aiomoe-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: aiomoe-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.8.10 Windows/10

File hashes

Hashes for aiomoe-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e00c609469c38ddf6f7b187cca0a85d452933d86902d0d99ac44e133e1c8bab7
MD5 1649abe2ba48f892141a0617019a9885
BLAKE2b-256 5cce35b11cc8b131c90d882019a529160c93e5030523b12c789587d1b03bee6f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page