Skip to main content

The second generation of IcodeYoudao API framework.

Project description

icodeapi, the The second generation of IcodeYoudao API framework.

More Powerful and Faster than TuringAPI and TuringIO.
icodeapi is easy to use, and it supports for sync and async.

from icodeapi import *
import asyncio
cookie = input('Enter cookie: ')
syncAPI = IcodeAPI(cookie = cookie)
print(syncAPI.updateIntro('hello, icodeapi!'))
asyncAPI = AsyncIcodeAPI(cookie = cookie)

async def main(api : AsyncIcodeAPI):
    await api.login()
    print(await api.updateIntro('hello, async icodeapi!'))
    await api.closeClient()

asyncio.run(main(asyncAPI))

Use icodeapi to build your server

import icodeapi
from icodeapi import server
cookie = input("Enter cookie: ")
api = icodeapi.AsyncIcodeAPI(cookie = cookie)
Server = server.IcodeServer(api = api)
@Server.CheckMessage()
async def AutoReply(userId, bot):
    try:
        await bot.fastReply(userId, 'Hello world!')
    except AssertionError:
        pass
    except:
        print('Unknown Error')
server.RunServer(Server)

Use pip to install

pip install icodeapi

Documentation
Github

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

icodeapi-1.4.0.tar.gz (22.4 kB view hashes)

Uploaded Source

Built Distribution

icodeapi-1.4.0-py3-none-any.whl (22.5 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