https://github.com/tom-the-bomb/async-tio
A simple unofficial, asynchronous API wrapper for https://tio.run in python
https://github.com/tom-the-bomb/async-tio
async python tio
Last synced: about 2 months ago
JSON representation
A simple unofficial, asynchronous API wrapper for https://tio.run in python
- Host: GitHub
- URL: https://github.com/tom-the-bomb/async-tio
- Owner: Tom-the-Bomb
- License: mit
- Created: 2021-05-02T19:30:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-07T21:36:59.000Z (about 1 year ago)
- Last Synced: 2025-07-31T19:45:37.699Z (2 months ago)
- Topics: async, python, tio
- Language: Python
- Homepage: https://pypi.org/project/async-tio
- Size: 42 KB
- Stars: 10
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Async-TIO
This is a simple unofficial async Api-wrapper for [tio.run](https://tio.run/#)
## Installation (PyPI)
```bash
py -m pip install async_tio
```## Install Latest
```bash
py -m pip install git+https://github.com/Tom-the-Bomb/async-tio.git
```## Basic Example
```py
# assuming you are already inside an async environment and have already imported everything
# to instantiate:
#
# - It is recommended to have a global class if you are going to run `execute()` more than 1 time throughout the program
#
# - Alternatively you can use the async context manager if it's a one time use:
# `async with async_tio.Tio() as tio: ...`
tio = async_tio.Tio() # Optional 'loop' and 'session' kwargs etc. if needed# to execute
output = await tio.execute("print('')", language="python3") # pass in additional optional kwargs if neededprint(str(output)) # the formatted output along with the stats
print(output.stdout) # the output by itself
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 you can access
```