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.2.tar.gz
(11.7 kB
view hashes)
Built Distributions
Close
Hashes for piston_rspy-0.3.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37188a743d56b5507fe745a3846332d313809a0610de433e56eb04c28b84dcc9 |
|
MD5 | 1dd0b6e4395ea558364188cecc447198 |
|
BLAKE2b-256 | 7f537e170ad4fb16fc866ee5147c7d23ee1db03efa1e33aea68dc861ca11a3de |
Close
Hashes for piston_rspy-0.3.2-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43eea6ea7d623d39536926115b3ff2245c0bbd5ad7060e2de2a4d79d5f053706 |
|
MD5 | 48997968506bd86d479f143e9237c50f |
|
BLAKE2b-256 | 08ce99b7389b12bafcb0f318cddd76014b1976d86da54ac79890cb6e1089882f |
Close
Hashes for piston_rspy-0.3.2-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c882707954d8096f3fa383ccbc8ebe58d7722974832de7444f53ce8c9668010e |
|
MD5 | d47e8a55f5f3b71fbad47f3b6478db49 |
|
BLAKE2b-256 | 9027b47998a8de20915f6bc28529bbdbbdbb056c6683edda7cc0b952ed331ab1 |
Close
Hashes for piston_rspy-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99bbff5718113faad83b722c74ed00b5673fac4e453bea5b9828c783801a239c |
|
MD5 | bcacf0ac365af3b988cc7de57e8ceac4 |
|
BLAKE2b-256 | f3029243cf4967a40a84637f30d7bf0a31cdbd636a126b201292fdab0476e68f |
Close
Hashes for piston_rspy-0.3.2-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 429881575a69687f8c903908e9790666f5e202682855b5a5c65feed742caa6fa |
|
MD5 | 3909284899fffe9dd43da0a3ca47ff16 |
|
BLAKE2b-256 | 7b51c0161a2b1bd5707d985cad82e6592cfe49525cee7391092bbbd47497517a |
Close
Hashes for piston_rspy-0.3.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d069ae307743159af2e7bbb19d31e6c48fd9766e15fea090162c1a3f130e7f0 |
|
MD5 | 87619fad053fdbd173b1b7fcc2a93ba6 |
|
BLAKE2b-256 | ab9d2a7ef5d6b64a7324ec778e23ce272a911f401d0eb83b21b17eb87a2b89da |
Close
Hashes for piston_rspy-0.3.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 352eb05f7f0892b9a1d96980203d73305343e1bb2a8340c5b24f28b233e63f97 |
|
MD5 | f3172f71aae1e1daf02795389219e706 |
|
BLAKE2b-256 | f18bb1cae39c75afe3879c2413d1b50612c5a55e95003b179f89b54118602bdd |
Close
Hashes for piston_rspy-0.3.2-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7a9d6bc1773e0b62a46ba34ac73b984dd30fb0e09f87ad73dc1fcf76bb40f24 |
|
MD5 | 20860211a76e8155bdf7aece2fe33552 |
|
BLAKE2b-256 | e945ceeafc8562a42d771587eb948ec4913863b262f1625a79c40485b91aa8bc |
Close
Hashes for piston_rspy-0.3.2-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57a3c472c184faf8ef6cb4ce8689e7c6207dbf18f1c1b3ede8ac983068d78a31 |
|
MD5 | 957bac7872c66a5041427e5c7d7eaa15 |
|
BLAKE2b-256 | 583790d5497b77d1b729b57c6d891ef9ec00ea0219228b796affc5ea034d92a1 |
Close
Hashes for piston_rspy-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fca5e8ba87a89db8ed7a478dc25ab4d08846f184e694617d212b96960eba03e |
|
MD5 | 10a4179314f2f46f1c72fdbe3e3ca0bf |
|
BLAKE2b-256 | 01e2340f5798d4ef6403c9f083bae5887d5c65ae92ac6ef55aece9c5b1b94b84 |
Close
Hashes for piston_rspy-0.3.2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf2575434c6f8fa977b8afffee1e2fdaca56188cf8991700b951353a87b84ce7 |
|
MD5 | b88ecfd176177c787828462ceb1ce704 |
|
BLAKE2b-256 | ecf607f8802d44ecdcb5e86f912c4dfdd0c60e6349276900fac34c9c2c16b678 |
Close
Hashes for piston_rspy-0.3.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd282672f667d7b30d0a05533eb8cfc474b343625f6ce18b9652353a520f6ed3 |
|
MD5 | 3fca40e2e36761148e4cfe0905fe5fd6 |
|
BLAKE2b-256 | f51d30a589cb52204b5df7c0aa7da1769ec3932f57160b503b54efef452b2f10 |
Close
Hashes for piston_rspy-0.3.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97b2a5919b1e2f9d083fdd19ca1cfaf81aceb83c87c57770089b48dcf04bc1be |
|
MD5 | 8fc81e1a9e063ba640f6ecc43a87733d |
|
BLAKE2b-256 | 39dfe08b1d37af9ac52e95e89f71403a8da82b1e0baaed5a67875e46ec6d4c03 |
Close
Hashes for piston_rspy-0.3.2-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec838560a7d2b3bc0b95cd01af3b91c83935be1e445a577028bf7ba1140785f3 |
|
MD5 | eec67273ac27d8d9aa3e2e756065a908 |
|
BLAKE2b-256 | 04be3b70abb87220905e8b67374bdc44b5f5561a07f13f77134397e8e7003bbc |
Close
Hashes for piston_rspy-0.3.2-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5f13067c45ccefb35bf32d3e40d91300847922a21270ef5ca1c6a3ca253181d |
|
MD5 | 76f45341023eee2d10c953827a9a9ea9 |
|
BLAKE2b-256 | 650fd4faa2d7c5686ddc2ab2bf4d35c735f1e8c968fbd3df7de5f0dd2c5ecebb |
Close
Hashes for piston_rspy-0.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85617f4d834c2179c91ce82f6a52110a1e3fd30cdbf115345ef04a2b94f90aed |
|
MD5 | e2f2d2a3dd0081141dd90208b4892ede |
|
BLAKE2b-256 | 18132e360b1997f1172e4c040708cbec01f5f8bb91d7f509ef7903c8fc85dcd4 |
Close
Hashes for piston_rspy-0.3.2-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0be920239496a1ea7d9944575e8012958ada17da1f9c81f735f7e832c8552360 |
|
MD5 | 8875e85ebb9689091a9a771b0eef1714 |
|
BLAKE2b-256 | 3b1e0f80a814381a95a6b6b051b8adcb4ea9ae827bb09ba7566c89a4dae3143c |
Close
Hashes for piston_rspy-0.3.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd4fb8c23ae2e9cafbe6eebe49260442e4faf53e7ae8f8558a376bf98aa00b39 |
|
MD5 | 8a423a2ea84c4a80716707653e26adfb |
|
BLAKE2b-256 | f51f7fd3d144efa8e03d28bac074b1e695045a1d87a12e0c13a59173b362c6b6 |
Close
Hashes for piston_rspy-0.3.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec51dcdb4a170581a95388e958c956617cb99bf9f642b0b726542d65b748cfcf |
|
MD5 | 6cf8dfb1e84bd94d4605fb7669a9ec6c |
|
BLAKE2b-256 | fa29f7595f5666e9c7fab7351f3a680b3567f73982f49d9d4d44dbe8daf4bc74 |
Close
Hashes for piston_rspy-0.3.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b216bccd9d458c9c2f82f290e83476b76201fba7865ee80fd67683d5e1d8bd38 |
|
MD5 | 09ba5f66ca59b02025c55f6a066be2ac |
|
BLAKE2b-256 | 6cf6d127b16b545fc4b130698fb665097985dba2b20fa1fc3cac6b985c589a15 |
Close
Hashes for piston_rspy-0.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07e8b67d29fcd290ef3fc45fb8201e061466ce160f0181ee3ab43b986bcd1d45 |
|
MD5 | 1e054b03d6608c373c0e2262e365aa96 |
|
BLAKE2b-256 | 28f5925d21297d436251598a086f411568814ecbbfc41197df347ac0f27d828d |
Close
Hashes for piston_rspy-0.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6037aac1495f702f0e87a270ed845b3cc803959ad1bb7179c4db43828cb15cd0 |
|
MD5 | f6b53f8fe99ad1eb19a4429c34e18317 |
|
BLAKE2b-256 | bce6b2140174e19f506166960317001ee9aac100092aabb7f6bfc67db6c521aa |
Close
Hashes for piston_rspy-0.3.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a033f03d8c28098c9ea94a56453e4ed27a6da4532c522b18ea5027fc8d619fa |
|
MD5 | a5f52f9c92e8a8fb238ecccf39d2eb0f |
|
BLAKE2b-256 | 912eedce530da2426d1bf2034be614e85a21155e5a447071c3762466e3606418 |
Close
Hashes for piston_rspy-0.3.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21cd64eee5396a8c979344668a848036029108138d0294c57da730f9548b3502 |
|
MD5 | 773b9d4f757e561f85d269f55ed627ee |
|
BLAKE2b-256 | eb890723abf9e4e78ba1541950e201d1463177bce73f1b4d50aeb38961bd44f1 |