Python bindings for piston_rs.
Project description
piston_rspy
Python bindings for piston_rs
.
What is piston_rspy
piston_rspy provides Python users the ability to interact with the Piston code execution engine, but behind the scenes it is powered by piston_rs, a Rust library designed for the same purpose.
Getting started
piston_rspy officially supports Python versions 3.7, 3.8, 3.9, and 3.10. For an in depth look at the API, check out the documentation!
Installation
pip install piston_rspy
Usage
Fetching the available runtimes from Piston.
import asyncio
import piston_rspy
async def main() -> None:
client = piston_rspy.Client()
runtimes = await client.fetch_runtimes()
print(runtimes)
if __name__ == "__main__":
asyncio.run(main())
Executing python code via Piston.
import asyncio
import piston_rspy
async def main() -> None:
file = piston_rspy.File(
name="main.py",
content="for i in range(10): print(i)",
)
executor = piston_rspy.Executor(
language="python",
version="3.10",
files=[file],
)
client = piston_rspy.Client()
response = await client.execute(executor)
print(f"Language: {response.language} v{response.version}")
if response.compile:
print(f"Compilation:\n{response.compile.output}")
print(f"Output:\n{response.run.output}")
if __name__ == "__main__":
asyncio.run(main())
The builder flow that is used in piston_rs
is available in
piston_rspy
as well.
import asyncio
import piston_rspy
async def main() -> None:
client = piston_rspy.Client()
response = await client.execute(
piston_rspy.Executor()
.set_language("python")
.set_version("3.10")
.add_file(
piston_rspy.File(
name="main.py",
content="for i in range(10): print(i)",
)
)
)
print(f"Language: {response.language} v{response.version}")
if response.compile:
print(f"Compilation:\n{response.compile.output}")
print(f"Output:\n{response.run.output}")
if __name__ == "__main__":
asyncio.run(main())
License
piston_rspy is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
piston_rspy-0.3.1.tar.gz
(11.5 kB
view hashes)
Built Distributions
Close
Hashes for piston_rspy-0.3.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49641c91242dc1e2935e390688af07e94a0818c434a833420d150b8f42c366aa |
|
MD5 | a1730a286f212cab26bcb8203de8eb21 |
|
BLAKE2b-256 | a3dddd98ea90766f9dbc23cbd91a497a8b55ef7e6e5df9989b6da899f269a66a |
Close
Hashes for piston_rspy-0.3.1-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d0691294bbf47d79a89a9570d0c92ca14d85f8a986696ffd3b255e648cdfbff |
|
MD5 | b65698ae7586b2272cb7e19c81990f92 |
|
BLAKE2b-256 | 39c95fceb1e9fe4c1299ae87c188e0eb348e2bff85560588f24e0504a77f6165 |
Close
Hashes for piston_rspy-0.3.1-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9085369736d379e169dad1753aa031002cc5e78af9f9586dc210c4e9933df960 |
|
MD5 | 20567b821476d46bcb5914cab4d833a0 |
|
BLAKE2b-256 | 1ae3ecd573cfe3dcb339dd7ef5d261938a69ea957818b49be7257ab832fdc0ef |
Close
Hashes for piston_rspy-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea9bc1a863b11169af04c7d5e600fcd6edd1454692797dd2ea83c8142da8baa5 |
|
MD5 | 793c1dde0bec95901c906ce1bc750fa4 |
|
BLAKE2b-256 | 6cc84de87ae3b637c098e3bae45f83a99da42f658d08a15e0b87948d38377434 |
Close
Hashes for piston_rspy-0.3.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdb221d62e530130c6222c7638d561284a3c41bf45004792fa8bc76abf039f4f |
|
MD5 | 0736cc9a29703571574d1fae0c052695 |
|
BLAKE2b-256 | e0e1a499e0bbff1ba8fdd52871549e921e7501f2036eba239db1201a3dcfb5b2 |
Close
Hashes for piston_rspy-0.3.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d438b8589e1acbea3bae8cd9f4cf72481b5752297ca3b7282fc3e7037f4d8063 |
|
MD5 | de1c0b8a724da431d1accb76c42085f0 |
|
BLAKE2b-256 | f102fe074fb7c5db86280b86b6b7d65298df388472e270d5198ffcf45b766967 |
Close
Hashes for piston_rspy-0.3.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71bbfdc6a434ef999214bb64fc43128c1622895fdc9eacec022822bcc6d4da09 |
|
MD5 | 31acf609c67c0be9831df7edca579831 |
|
BLAKE2b-256 | 2514f115d8d6c994c7864bde91f56f7529014a74fa394018607d8b722c65bcf0 |
Close
Hashes for piston_rspy-0.3.1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d24e05908341e2032441f68792e0bc03c224b27f7850e463616e7d838f235318 |
|
MD5 | 7c9d45e8ca0ddc18af9567beb56ad15f |
|
BLAKE2b-256 | 9f18f59eac1a77b0118b1680d3bc403f7f0654ef3fe8a2d69a73838bea30db0c |
Close
Hashes for piston_rspy-0.3.1-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a6f8f0a6d7c1f32563d1a258e7fae6f155a334c047ff37d03b91dd86a5aae17 |
|
MD5 | d565ad509a7c5070e318c0522c2939fe |
|
BLAKE2b-256 | 1c94deda5cd847ca32fe055ee9d8ce4490931bf2b6c7c4338f740d62d8c8072a |
Close
Hashes for piston_rspy-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cda6f9a1fa4915bdfae80575371fac1286d3d2859cc7033bd5055f3605d9527 |
|
MD5 | 4a3f58ba4f2c2413d7d5c621639fb249 |
|
BLAKE2b-256 | 2eb43bfdc65aec3dff4abd458978221035ed5d9393491b72c586152647a85f38 |
Close
Hashes for piston_rspy-0.3.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd11ef91e37c83151f890332eb308fc108215e50c9fdfa142399ab14b9a396ab |
|
MD5 | 3e1046dc8c57ea17adb9a4d519c6d63a |
|
BLAKE2b-256 | 937d3d23492d97555c4f8cee7ac584fe2e5475d1fab80b3ac082c8b9cfb284dd |
Close
Hashes for piston_rspy-0.3.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5c4492fecbfd9d7960bb6c00ffe608eb35da3c82111564b91028e7971461b1d |
|
MD5 | 1a1a167e24b0e140cda1107b1f4ff01a |
|
BLAKE2b-256 | cfcc603304420c4f8e69e9956fb919f826c116f3f1dd1d735eba61a3981b884d |
Close
Hashes for piston_rspy-0.3.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5b71b8c7fee6efaf2b0e9325d41651251d9f81787f9e525e6a10ba7f1ee1894 |
|
MD5 | c78856c661be63c2e637a61683f9dc09 |
|
BLAKE2b-256 | 50afab27b61dcfe50334cb4f54e5f2cb144a532d836e7277837d7cf2614d900c |
Close
Hashes for piston_rspy-0.3.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a08cce75bf2f3d4fe9cec5c1f299c323d3e9f90f630d996610c43b0749dc4b1 |
|
MD5 | 2933cffa9653af486c49f8275a49438f |
|
BLAKE2b-256 | 020e417be7ab4e5e1763268dad39b2ce2cc47f9d8683e677efe5e90e74fa95ae |
Close
Hashes for piston_rspy-0.3.1-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b08fda286ad53e46e0c3de83291d5f3785ddb5daaad4039bf456bab44ffec48 |
|
MD5 | 999b2ea83da3a7fe2286ea5445036be0 |
|
BLAKE2b-256 | 95c9eb7e073abb90d212643101d5535114b435780df2b8f65578782fad497b0c |
Close
Hashes for piston_rspy-0.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1775c7f23c583f12df1a885844e68daa6930b44066c816f3e3de73810197a1a5 |
|
MD5 | 15f34828d326bcdc938475cfa0de0d80 |
|
BLAKE2b-256 | 8d11aa016e16b11e1b66ef1d0f9704f8f13e1652a5366608af9832ee56adae92 |
Close
Hashes for piston_rspy-0.3.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89d09e8a8aea2ada640d5a48fac11cb0f57b4f9737a02526e442f610a1ff8e4b |
|
MD5 | ab38b1161e3b46f37147382771a366a7 |
|
BLAKE2b-256 | 05e4a8e1741f3e072eb087bfb63c79c4c24add70e01265fc2c328dc3aaa7050c |
Close
Hashes for piston_rspy-0.3.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7df2cc3d874f16c585e3b25b75fd137af78c60c5ebc66ab31479a2cfffb8bb15 |
|
MD5 | 9585459934e7d90abb8842887db9ca6b |
|
BLAKE2b-256 | 51b9912f4e0e7330e3754373e119ae72efef4c90ba4d82e225b8fafa549f640e |
Close
Hashes for piston_rspy-0.3.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9adb8ea6082c124fa3cf959cf86adad05823ced9bde63d6f115491b34a2baf95 |
|
MD5 | 570eacb5bf10869d88535402293b0428 |
|
BLAKE2b-256 | 9d6fb93394758bc97548543966c01ecafc2434b7656b3fdda2c8c03bc203a3bd |
Close
Hashes for piston_rspy-0.3.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f2a4ed4876f72b23a5daf173c61aba0cfae68708d897b438c2d22f936bc62f1 |
|
MD5 | eb8125b9519e225c25d69df52b029eaa |
|
BLAKE2b-256 | 12b430e2676dfb1f6a3faa252010893c8dd48b0c854cdc8ffa6dacf9f8984745 |
Close
Hashes for piston_rspy-0.3.1-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9f22befb48070f5d824b76ba0aa46da34f3887bce4a6b5841f844a6be2eea3e |
|
MD5 | 4666f28430b1ca8cf04e7510c4a3b408 |
|
BLAKE2b-256 | 0341862e1ef5c5596355bfd9510437bc02b51c335b56643213e8eabf70971e93 |
Close
Hashes for piston_rspy-0.3.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4d7136863a7686dc1e49173fbf822b1a8ccdae78ec450a22fa22efefec73737 |
|
MD5 | aaf745583832649403c6902eec2f87a8 |
|
BLAKE2b-256 | dee42b574c2cf12eae2ccf27109a79f757fdc69f3acb9a5d444ec1d93fc00707 |
Close
Hashes for piston_rspy-0.3.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cf58bfe570e101c93a034a6ca67d1b757d8b8cf0e3c0c0e8452b959524ff4ac |
|
MD5 | 5c512a244616e7b8fb922b2280f361c8 |
|
BLAKE2b-256 | 59150a4e8d6a66e17d558093f2e379f1cf4275cf397edb1006cca92bea4aa1f7 |
Close
Hashes for piston_rspy-0.3.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91c469430b2e95749c24d1748b9ee1c7d67082e08389e33187dffa27a06f5036 |
|
MD5 | 96e47582ef0c035196f36f4a36c69c43 |
|
BLAKE2b-256 | 05b05c60a0ea4465faa37a4b1ed72805e7b7630a325838ee87931d4f751c205e |