Skip to main content

tracemoe-py

PyPI - Python Version PyPI - Downloads PyPI License

A minimal asynchronous API wrapper for trace.moe.

Installation

Python 3.6 or higher is required.

pip install tracemoe-py

Usage

import asyncio

from tracemoe import TraceMoe


async def main():
    async with TraceMoe() as tracemoe:

        # Search by image URL
        results: list = await tracemoe.search('https://XXX/XXX.jpg')
        print(results)

        # Search by image upload
        results: list = await tracemoe.search(open('/home/ichbinleoon/XXX.jpg', 'rb'))
        print(results)

        # Get account info
        info: dict = await tracemoe.me()
        print(info)

asyncio.run(main())

Advanced Usage

import asyncio

import aiohttp

from tracemoe import TraceMoe


async def main():

    # Use an API key
    tracemoe = TraceMoe(api_key='Your API key')

    # Cut black borders
    results: list = await tracemoe.search('https://XXX/XXX.jpg', cut_borders=True)
    print(results)

    # Filter by AniList ID
    results: list = await tracemoe.search('https://XXX/XXX.jpg', anilist_id=11617)
    print(results)

    # Include AniList info
    results: list = await tracemoe.search('https://XXX/XXX.jpg', anilist_info=True)
    print(results)
    
    await tracemoe.close()

    # Use your own aiohttp session
    session = aiohttp.ClientSession()
    tracemoe = TraceMoe(session=session)
    
    # ...
    
    await tracemoe.close()

asyncio.run(main())

Contribute

Contributions are welcome! Feel free to open issues or submit pull requests!

License

MIT © IchBinLeoon

Metadata

Release files for tracemoe-py 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tracemoe-py 1.0.3
File Size Uploaded Provenance
tracemoe-py-1.0.3.tar.gz 4.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tracemoe-py 1.0.3
File Interpreter ABI Platform
tracemoe_py-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 9.8 kB

Release files / tracemoe-py-1.0.3.tar.gz

Download URL tracemoe-py-1.0.3.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
031c3e8a4ad247931f3a2b297d9e506c732a6802c98aa0535d907290dd2c2562
BLAKE2b-256 checksum
How to use checksums
579b241ca478f67775b72b1e303cad760be97afcba95a82945abb83c6d05e48f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release files / tracemoe_py-1.0.3-py3-none-any.whl

Download URL tracemoe_py-1.0.3-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
41491eb7a62449ac374b8daa4b939cf75cb1ff33a47f498543617c6548feeee7
BLAKE2b-256 checksum
How to use checksums
a7f14c5500eabe34f592bb48197e791bd540821247ba28af067c8f7b03810e99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Security for tracemoe-py 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page