Skip to main content

API Wrapper around Chimu.moe API for both synchronous and asynchronous purposes.

Project description

ChimuAPI Python Wrapper

API Wrapper around Chimu.moe API for both synchronous and asynchronous purposes.

What is it for?

I made this wrapper for Python devs so they can easly access Chimu.moe API both async and sync.

Allowing more people to use it!

Synchronous Example

import ChimuApi as chimu

def main():

    api = chimu.ChimuAPI()

    sets = api.get_set(1)

    for mapa in sets.ChildrenBeatmaps:

        print(f"{mapa.BeatmapId} [{mapa.DiffName}]")

    print(sets.Creator)

def download():

    api = chimu.ChimuAPI()

    file_bytes = api.download_file(1, key_here, state_here)

    with open("map.osz", "wb") as filea:
        filea.write(file_bytes)

main()
download()

Asynchronous Example

import ChimuApi as chimu
import asyncio

async def main():

    api = chimu.AsyncChimuAPI()

    sets = await api.get_set(1)

    for mapa in sets.ChildrenBeatmaps:

        print(f"{mapa.BeatmapId} [{mapa.DiffName}]")

    print(sets.Creator)

async def download():

    api = chimu.AsyncChimuAPI()

    file_bytes = await api.download_file(1, key_here, state_here)

    with open("map.osz", "wb") as filea:
        filea.write(file_bytes)

asyncio.run(main())
asyncio.run(download())

Contribution

If you feel like you want to help/fix/change something in this package, just create Issue or Pull Request on GitHub and I'll review it.

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

ChimuApi-0.1.5.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

ChimuApi-0.1.5-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

Supported by

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