Skip to main content

An unoffical API wrapper for tio.run

Project description

Async-Tio

This is a simple unofficial async Api-wrapper for tio.run

Installation

$ pip install async_tio

Examples

import asyncio
import async_tio

async def main():

    async with await async_tio.Tio() as tio:
        print(tio.languages) #list of all supported languages

        #execute the code
        return await tio.execute("print('hello world')", language="python3")

    #Or you can do
    tio = await async_tio.Tio() #instantiate a Tio object
    ...
    #do stuff
    ...
    #at the end
    await tio.close()

output = asyncio.run(main())

print(str(output)) #the formatted output along with the stats
print(int(output)) #returns the exit status

print(vars(output).keys())
# dict_keys(['token', 'output', 'stdout', 'real_time', 'user_time', 'sys_time', 'cpu_usage', 'exit_status'])
# all the attributes of the response object

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

async_tio-1.0.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file async_tio-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: async_tio-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.9

File hashes

Hashes for async_tio-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 643175fd7fe538443952ed31c44fd285d56061659975e5fc3244d8e11ec26351
MD5 b09fb61e6ee463484bf70080fccac677
BLAKE2b-256 5f630ca99cb2e02d7f3342658c7a40a0f87a5a24d283a244082e5d6f1831c3e5

See more details on using hashes here.

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