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
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.1.2.tar.gz
(8.7 kB
view hashes)
Built Distributions
Close
Hashes for piston_rspy-0.1.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e728f21fc44033a98dcd483c6dabc6d0dc3c288fbe38972461caeba3b70f1dc |
|
MD5 | d3c586bb215b146f79f07d1affcb108f |
|
BLAKE2b-256 | cd14b059ceec48baa5d3a2f1b10fb17507f2856ef2cdd4d454ef65a39b3ee1f2 |
Close
Hashes for piston_rspy-0.1.2-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f995f015d9f1cea9ea221a94083b6126504833847444d3589f68f366b3f2a69f |
|
MD5 | b085e83d43a8c261dfd4b82cba2de7af |
|
BLAKE2b-256 | f4951415974c258ef941bb1f29f813a7ff133ea58938a9f47563f7f4d1e91bb2 |
Close
Hashes for piston_rspy-0.1.2-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2bfd8c615f62a7e8f5e3ab97d138b85ec4039bbb144f5ebd7ed2fa350615555 |
|
MD5 | cf34934578a90a2c8a885c71713ce46b |
|
BLAKE2b-256 | 33f9a8d3efeda0bb855f3114fd996d019737e96dba8e79d609e60fe5b24bd644 |
Close
Hashes for piston_rspy-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2cea1064cc359492701e4f3dcb89ebd99d2bfa97db806f767a15e0a39b98fdf |
|
MD5 | e870439f9e588488e500cfcccbfd9b2d |
|
BLAKE2b-256 | c1ce75a15613c8c33419c138646a42447b8763315841c1224495101666e422d4 |
Close
Hashes for piston_rspy-0.1.2-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ceba6b1f3aaa6731dd94039cdf04e58438499323f28e4810c9258ab5edb4929 |
|
MD5 | 4cb868749c4d7858b584ab04c745b108 |
|
BLAKE2b-256 | 5ed2b43789d8adf3a1b47b7b032184fc0a92b35e01a6d8af6ae4258b7d47f34f |
Close
Hashes for piston_rspy-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4655991fb1c1adb41fe035222235be81f62c8c6c548a66e5ac93375d60517f00 |
|
MD5 | e064333c55e7a74b7490b1c5c619aa19 |
|
BLAKE2b-256 | 658f9e54c82f70c8b7135db9e9cde511f003934cec88bc46001edf8f50c1727d |
Close
Hashes for piston_rspy-0.1.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4928300267484b531ba147c1a374e69b79f69a30cb9f96b5dff42080f61d662 |
|
MD5 | 42897aebf670238be5a14a596f0004af |
|
BLAKE2b-256 | 64f14f8eb51ed935b22c9de3628a33ff934f8a0f038f7c89a4aeed65c0dce721 |
Close
Hashes for piston_rspy-0.1.2-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6191866869c625cef715aa25ac16a2a70a4a8646c292455c1b654a875a31391f |
|
MD5 | ac4b648e6683bd85bd91f1235b321185 |
|
BLAKE2b-256 | d1b89d129b51ca35450e88e4707fb310f9a1b6c33709104d017b9f7fce8dce4f |
Close
Hashes for piston_rspy-0.1.2-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2639496123ba7740bd45908c817298eaa04804c2add3b635ab7c27bff120a00b |
|
MD5 | e2aa7686802d1350a33891cc6ddefbce |
|
BLAKE2b-256 | 9d4126895f0bc81fb462187557f6bfdc07407374c63eeb147e0681afe570ac28 |
Close
Hashes for piston_rspy-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4991e89330fb80dcfac489b1bc62debfebb0702477429d9ba21b1f2a7a48ec66 |
|
MD5 | 786d608d7febdf2da8fbe02864209c01 |
|
BLAKE2b-256 | b0a3f2d49e2058f5faf88dd229bd22cd260e1beb2896f5290563cec1dead2a27 |
Close
Hashes for piston_rspy-0.1.2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab10b8e706bdd6b448eb1af9c13280fe017f7de3fb74221e099732e4a583e470 |
|
MD5 | 459d8273ba80fb740eda37fe45a309c4 |
|
BLAKE2b-256 | ccc9f2d44b1c0140bc33201f8c180a854f4081397b00bfcf03edf6c44bcb09d9 |
Close
Hashes for piston_rspy-0.1.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69b76f2e9015d65202188ed1bfc91936b58042c23bd6a434a145bcbf8f451ce9 |
|
MD5 | 63eeb7715493b0b95853d7cacbf77e92 |
|
BLAKE2b-256 | 83faeb1bf308e5010b5e6de1b0b312a0a7024cde1713082a564ec1215cb3585e |
Close
Hashes for piston_rspy-0.1.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d25de92d47356cd36271df462950cf270b52cbfec80d093d73ce6814a8fbac6b |
|
MD5 | 8b605717facf234f39541576237206ef |
|
BLAKE2b-256 | 47350eba614a343a10446b49434c1e49565d3aac468eff8096400b0642cb1046 |
Close
Hashes for piston_rspy-0.1.2-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 801d255d0f35ba3b1e0af1ba71855a9877de6bd0df540542a2ea34243bf53b17 |
|
MD5 | 76b4f677ee7b5f67a57df06125360b88 |
|
BLAKE2b-256 | a99de1585294e3f91531873a57daa743bef511508355eca0394780f3da3a847b |
Close
Hashes for piston_rspy-0.1.2-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a07c6d20e2e6ef3b5f40e147efc2b2bca5cae8c3ce32ea5ec6237675f915cd0 |
|
MD5 | 3d9b576bda9ab6e8d8766f4767e354bf |
|
BLAKE2b-256 | 93a19649604a4586b9d4b2119a8adb1af8f16b2ec04bf4ffcd6054065b92cef5 |
Close
Hashes for piston_rspy-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d19ca326f8da51fdbf70034d82e9c962c448593f7f48ff0a4d1f40ed631b4ee |
|
MD5 | 84f26478d8cb882bd91dfbd49e490c97 |
|
BLAKE2b-256 | a385b83b6d9ae2cf5892a79d7bc35531c21377945ad5d412f36ba210aa19a217 |
Close
Hashes for piston_rspy-0.1.2-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cccbc5b6e858f6630e57884f3eab5bb540bd6aecea8124b5f3b409c4bbb8ad2a |
|
MD5 | 305c1dc08dab80d6119374c37126a9a4 |
|
BLAKE2b-256 | 8b3c29eef7e062f9ae11e729fef8af959f563c0aba35ff7358b0f0958aa23580 |
Close
Hashes for piston_rspy-0.1.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bce7274492b338a08c9bc65e2821ca1c9b3143cb4e5dfe0c9abcc706fbfadc7c |
|
MD5 | eaac1e985fbdf65340341aae27638197 |
|
BLAKE2b-256 | 3f445f9adae4e603e9c35b59ace47182a66faf5cd88ddb18baf1d6cdad7f266b |
Close
Hashes for piston_rspy-0.1.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c27f8dbd0117b7d6e8f745d4b96023a62380aa77b4ba7c3aab3694636fd0f17 |
|
MD5 | 33f44b4c7d2bd6e6d10d0ac982ea5af7 |
|
BLAKE2b-256 | a373a99d1618441f70cedcad7d5d9e0d23a7887ec6b1b3a76f95bd8cab510289 |
Close
Hashes for piston_rspy-0.1.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44f39d63c8c314dfadfdd19cd114cdc483178a34f8b42f7e146957c3a2976f76 |
|
MD5 | a2256cc9196f6573febac90b7683c6fa |
|
BLAKE2b-256 | 67876fe551a556905453009b34d7e0bfb67f755427869ff671b9b866563e321d |
Close
Hashes for piston_rspy-0.1.2-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee12219580bbf7b989857092925551a22d1d988f04915a284ea8952f612b657b |
|
MD5 | 43a8dcdb43b8fcd67ca30a9ae7540e26 |
|
BLAKE2b-256 | 1be9b98917649a1150c43252abc3501fc8ad1174b7ced7cb747da603e980d623 |
Close
Hashes for piston_rspy-0.1.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad39cc9bc514f6214d4e282abeab7ae1de53440c5f43fdc1d0754b484cb42fbb |
|
MD5 | 9a98a985553f721c2e8476095b3017be |
|
BLAKE2b-256 | 0fdd8b333274afcbb9b18bab7080b2cae682d8eba8f582fa67266418279e5d32 |
Close
Hashes for piston_rspy-0.1.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e97cd090585bf41485305e3a994e2442f33b1dcb67526a4d563232c0ee51866a |
|
MD5 | 54944d735f627fde9761ecda1b0fb0b2 |
|
BLAKE2b-256 | 85f8cd14e535c1ad092b57779b9d78bba3c75a9339d1ad9537a99262a19f5297 |
Close
Hashes for piston_rspy-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1df66a8903746e241d007c5adbee8ce2ce427165c9146de5c1c8455989a63b4b |
|
MD5 | b82f803c11b595aeb15383224c26b0b1 |
|
BLAKE2b-256 | a68295810f8bbce0a8eade4f22b48671f51c6cde688e244bcd67482415c3a6b8 |