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.4.0.tar.gz
(12.6 kB
view hashes)
Built Distributions
Close
Hashes for piston_rspy-0.4.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3c694ea3df82ff4873076680fad990cf3682dac86ddcc282e63178728d4f4c5 |
|
MD5 | 11eb5e2e31f6c70df5fc444415e31f06 |
|
BLAKE2b-256 | 63227bb0479409b415443771defd37461f88c5e96888e36bac736dbfbc213f1c |
Close
Hashes for piston_rspy-0.4.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2b0edbb7a16149e1b8932efc0b7e1179aa2866076f6587d2cf18dad5d454e88 |
|
MD5 | d4aca94aab1a1432d1498c3ab9c0c4b9 |
|
BLAKE2b-256 | 69d453bfc84852c9bb310b4e255b3f486188f248ffc55065607906575fdcd1f8 |
Close
Hashes for piston_rspy-0.4.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23bb2accc555ddc29a99d74e9bc1783cf4fc3798b7e44cc12abc0334d6f088c1 |
|
MD5 | f43aeac90be7e891f87a897a939729b5 |
|
BLAKE2b-256 | f2e49c9d0bf96b60ff7a626afdf58e88aeacac427e8e61ecdab590df0e775f7e |
Close
Hashes for piston_rspy-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 985ee35186ba36d92fb3e1079335e0dfdb01561c166b3ae521ba55820bd8d906 |
|
MD5 | 3c6d15357eeeeeeda975e12fc2ae3e17 |
|
BLAKE2b-256 | 5a511db3c4bba3ae453381f563d113fd789146a3912e5993e546eaf8b943d9c8 |
Close
Hashes for piston_rspy-0.4.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a566534b272c1614080f624941bf4a6e09d9029ebf7cc07d100f93cf98a596f7 |
|
MD5 | 025856a13d8779e9cd74ecb9cf2cf3eb |
|
BLAKE2b-256 | 98f2a3efd6aaeeb71743fb696e768e028969b5a6361b743337a4c48c3cf097b8 |
Close
Hashes for piston_rspy-0.4.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 110bdadfc39fa7e78e95971d12731058bda57bab0955aaf16e3d3b8fa8266547 |
|
MD5 | 6b8606248bd7dd0234784bb4824b2db1 |
|
BLAKE2b-256 | 52b86ce52124a1c5e3be67f8df1ba2e28fa55cb844899f4e5c8f00e69b8e491c |
Close
Hashes for piston_rspy-0.4.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 046969529e506ecd16febcf8730ac3b35073c8e014f9367d9b83ec29a7ef3633 |
|
MD5 | 48cec788ba0844fa8d971b7774e9928b |
|
BLAKE2b-256 | 9a6c6cc243a98d79463084828c54a03d12a92cd9b899cb9b892fbb6fc94d4529 |
Close
Hashes for piston_rspy-0.4.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40040502e52ece1c962242cc97322e0083c1cdae3c0e75b91256ba40de78894e |
|
MD5 | 99ee1aec70066c13830f3c2694981e10 |
|
BLAKE2b-256 | 2e1db79032deb32a9d0a6d118363976c3b491c4fe16d48cd105ce0ddb6bc05ec |
Close
Hashes for piston_rspy-0.4.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34f87f0657ef87079259b9a5766cb6a0b1db722faadccbbf6fe8f089c632fb42 |
|
MD5 | 85ed2327348a8399aba02c7235485dad |
|
BLAKE2b-256 | 3506fab6208999d76a7d46a0e081c98007f0eb7fa1d2762d3a64c31b271475b7 |
Close
Hashes for piston_rspy-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e8223e8d9a09a302b22d6be2f645814699569f34e926520381cbf9fc510c66e |
|
MD5 | e64b107584cc786189379f97898b5866 |
|
BLAKE2b-256 | 10b4fdf50520334c980d44d1114399e3ebded78af803fb174b7cc553faecd6da |
Close
Hashes for piston_rspy-0.4.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f4a4f25f7a890b3a45731d390ccb118cf15c4b4d81a8126be60073ed68e8bd9 |
|
MD5 | a558ff971f370b90baa5c0fb759d7f3b |
|
BLAKE2b-256 | 0cee23552326147901c3d56a2a958aecc12c919ceeb61e8346f8bf854d57551f |
Close
Hashes for piston_rspy-0.4.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3307cd7b0bd74cc9a85db6d7c57d74518c8a2e77df685d3fd9a3a61402019180 |
|
MD5 | 100a845d0d253cd18c8f5c6e713766c8 |
|
BLAKE2b-256 | 0b8ef1311a9853a9037faf450702853c7a2a31a8b4d6cea3d7761037c9a46592 |
Close
Hashes for piston_rspy-0.4.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b7fb6fc18c585d095154ef0898945447853b4323a9ac34e62bbdb70c76c315d |
|
MD5 | 72deb281099a7d36c3f7c010b5a18cd8 |
|
BLAKE2b-256 | 53ef725e0f8a0131a3d92554db853f3f5650bab950417ccd94a19d3537278e7e |
Close
Hashes for piston_rspy-0.4.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3d07019f4bd8d19ddd767b351b8c8cfc40a324e790dca7baf1bde8cfd726f53 |
|
MD5 | 66f98d15e5c763921fe05464af9a3940 |
|
BLAKE2b-256 | 4e5f1df8f68d159e80f27e8907aff17e6f83b15e7c634c10756830041b11634d |
Close
Hashes for piston_rspy-0.4.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ff9ad6f8ad0919d96342e6f79aba45d4fec88aa1faa8fecf883e1c270a95ad7 |
|
MD5 | 984843cc7b6f1b568996472793a26198 |
|
BLAKE2b-256 | 1d99f545565894b57884bcf8a9b139ddaa4a352f99ece141f134f4a6b19780f4 |
Close
Hashes for piston_rspy-0.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ebc61b7b62c6d9487903793cf930943a5a27d2f966e8c0f902f0f9e1c675ba3 |
|
MD5 | de637631cea65f9465146b1bdc991e1b |
|
BLAKE2b-256 | 3f418e1bdea8881403cdadb5895799d236a908d3bfeeff243ee189b84a828f5b |
Close
Hashes for piston_rspy-0.4.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c86b5fdb105cb4b0fcf1d18f17d64931273d49a96fdcbb1a0a500106eeddf25 |
|
MD5 | 18df9b570b6dc8ad1ac647f8ac0d893d |
|
BLAKE2b-256 | 5cc8c39e25c0449a2486e361c7f57192263b16650650d25b4c1ccfdf70b4f2d9 |
Close
Hashes for piston_rspy-0.4.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c7ff988f5ce14517e96f370c8e17c4ebf71c236b68ef8b216b0492c62c8987f |
|
MD5 | 8396454fbc58164ea50623353ced63f9 |
|
BLAKE2b-256 | 6b6ce3e00e00a7b9765b0ad6cce6e4e0c0db224f142ddd5ca9ec4618cd719ff1 |
Close
Hashes for piston_rspy-0.4.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b4fa18bafb4a36794a75548bc5f99cc11f8c75fc74732606df4962207eeb1fa |
|
MD5 | 0d147bec7769a0b314c7b56caec5d1e1 |
|
BLAKE2b-256 | ffe159314d7928a74d6826c1201aa3809ba0ba5fdd992f6220e95f0f30ead44f |
Close
Hashes for piston_rspy-0.4.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 026a37c176529d4fffa97376c74138721483a476b622f375d18a201c28a4be86 |
|
MD5 | 1222995627e3a037559d9ccc35df37ec |
|
BLAKE2b-256 | 4c88c749087a110db5c00f0acd5c663f4a6fc1bd6885a8f47ec0805acf17beb9 |
Close
Hashes for piston_rspy-0.4.0-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f0ed4a008812883b93200b69b0e382ef466e3ab58c6fd68368d7c037d1a30fb |
|
MD5 | 9f4834fae32a19d054e24c22767ec5fa |
|
BLAKE2b-256 | 79a296f839ded639664ad99b4c679b09d5bd4930e0532aa4371e0bf0f6d9b454 |
Close
Hashes for piston_rspy-0.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7faacd4f01b9ff7707cd623c5441020c60850cf38ecc68cf7050655ececc7dc1 |
|
MD5 | d432a5dd462271c4239f5b8298c8fd37 |
|
BLAKE2b-256 | be97b8a4a2a0cb2477aa331e10fa412e721e63e2d8ab73fc8159d506f81eb0e5 |
Close
Hashes for piston_rspy-0.4.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbabc8e247fef14f9433f8c69911b65b4a4f481c566a98d9c125c2a272c910a6 |
|
MD5 | 39fe13699db8f662ac4c17fa1a02c3f9 |
|
BLAKE2b-256 | 347e537253dc3987b1e91ccb4b5800f6bb8c10a11eb1dbf669b29f41382a9912 |
Close
Hashes for piston_rspy-0.4.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 870975f293c322e1beca5384da21f0c519ee822b0ac8b476ce7fdfd391c39e74 |
|
MD5 | 65ac214c4327a0c8818f193f32fcbf19 |
|
BLAKE2b-256 | f22efbb4b58954e4db8cee943ce25e0c70accf72488d6324d08ba602420d7375 |