Skip to main content

An unoffical async API wrapper for the piston code execution engine

Project description

Aio-piston

This is an unoffical Api wrapper for the piston code execution engine

Examples

import aio_piston
import asyncio

async def main():
    async with await aio_piston.Piston() as piston:
        out = await piston.execute('print("hello world")', language="python")
        #execute the code
        out2 = await piston.execute('print(input("what is your name"))', language="python", inputs="bob")
        return out, out2

    #*OR* without a context manager
    piston = await aio_piston.Piston()
    ...
    #do stuff
    ...
    #at the end
    await piston.close()

out, out2 = asyncio.run(main())

print(str(out))
#full output
print(vars(out).keys())
#all the attributes of the response class

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

aio_piston-1.0.0.tar.gz (3.2 kB view hashes)

Uploaded Source

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