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.1.3.tar.gz
(11.2 kB
view hashes)
Built Distributions
Close
Hashes for piston_rspy-0.1.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac60a707dc73a20610fb8a267f0c7778f0faf8ddaf8a78932f5598c87d801cb0 |
|
MD5 | f70ea0614aa8520df6a905ebabf0e8a3 |
|
BLAKE2b-256 | c80598c8bc768accfdbea45ac5fe9353459e413c8ddfc8ca814c004426c3d8a2 |
Close
Hashes for piston_rspy-0.1.3-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d1de8c22975dc78293ec7c589563dba4de5763312310a09a7247d8013e13d1b |
|
MD5 | 63fff1ba104e0365bf48c3066bfa3c22 |
|
BLAKE2b-256 | 0eac1a313c15e5508ca592eb156802019480a2b48bcfdb6a34421ca7ef139bf3 |
Close
Hashes for piston_rspy-0.1.3-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7319f2173a8d067bf436bcbc720dfafec5ae51618120ab52d9670687166f828f |
|
MD5 | 59cba8641c12c02d2ca34975541f8c56 |
|
BLAKE2b-256 | 062110c98d99b944fdf683310b08441bd7df1dac8a28221278d5ab2f8411cb4e |
Close
Hashes for piston_rspy-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc4127e58ad2070073347f7421de2f352422bd6c9b2a7d70a4960442c0d0584f |
|
MD5 | bac3065bf8a9e3576ba38ceeaf20eee8 |
|
BLAKE2b-256 | eb12ad154bde023cbca71b60d53367a623e2ef9353bb91b6c25bad3981be0fa7 |
Close
Hashes for piston_rspy-0.1.3-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66820dff75e558e5ff7757d7be5189ca65b1c7877e6465ba2619c3f089c88df2 |
|
MD5 | 157aa76a1e6ea487e000a6a4a2af7cc5 |
|
BLAKE2b-256 | db33f19437ee4f98ae671c7cf5adfea3d63f7fb44a11be5df7899cc489131896 |
Close
Hashes for piston_rspy-0.1.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ef420c087627e5facda225ab222337abfdf826bd38b749e871438ca00f9a6a7 |
|
MD5 | 7d90fc8d25ee35479ad8b86fbda8e4f5 |
|
BLAKE2b-256 | f59f079902a0d7bfb770e221e3bb224a0ab9692f93433ee6689b2beb2dc98aae |
Close
Hashes for piston_rspy-0.1.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbe1bf28ab708b0d5a0df05eed04be81e91c8f7df5e2bfa6e22cae044c46ec93 |
|
MD5 | 101ae0e330e0085b8cd0f1b6eefe2bc6 |
|
BLAKE2b-256 | 59e43cb96f3503f975046ebdb525f9899c5b4465b543c4a31ef8e2f6a38cdf3e |
Close
Hashes for piston_rspy-0.1.3-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b32d71e23f7c8b960a2385f8a6b455f629ba2c26ad7a835fe95b66085acb9ac1 |
|
MD5 | 18e6a92759b92e5bcb70306d42c4db0f |
|
BLAKE2b-256 | bebf348e1ef73c7bd4953292dbcf716151fcee283746b9f5cd3f050fef6b18e6 |
Close
Hashes for piston_rspy-0.1.3-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e57ace2a352e254c747aaef20c4eb95db7897e93f78adb1746575a87167877b6 |
|
MD5 | d6eafa54f423b15aed012f9829039d34 |
|
BLAKE2b-256 | 909e93931eda37d45e8eccdbaff85c86a3f32b8525020cf3851c713a376d9c9c |
Close
Hashes for piston_rspy-0.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8861636ebd4c9b1613089b71f651a2768fedd62f8a1fff63c750209a94de2b33 |
|
MD5 | bad3c7a89c636aa6833853de3aff546e |
|
BLAKE2b-256 | e15fdc3b4d9e80f6870ebdbd5dfa7e7800126d4af381f5a2235380657ecdada6 |
Close
Hashes for piston_rspy-0.1.3-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bba74cb1c75be86e29153f37cdeb45c545b0a35f41babca593a058e6b37aa42 |
|
MD5 | 08f5ed43e2ce5d19b470f091ce1c54e0 |
|
BLAKE2b-256 | 61ea07bbf609ace353393e45bd6c49a068ff14db86c775ebee74bfcefde38a7f |
Close
Hashes for piston_rspy-0.1.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7602c1cc0996022f0925e8b71f3311e8adcc114b72bf3a3180ad25e2bf9bd2f |
|
MD5 | 27707ea5521c4b5e88d1b70827451e37 |
|
BLAKE2b-256 | cc6602dd850cb9257eea65dc9bc29bfee3d72d46a4fcdbf91e10af59fda8fc65 |
Close
Hashes for piston_rspy-0.1.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4090378c7dc72986fb588fb90b3263d6f6337931702f464a99f71d13574a7b3 |
|
MD5 | dad07789a90c6c776ea3c48b3361c434 |
|
BLAKE2b-256 | 85a8afcff6fef7277ad68e56fc3b60c16ef4394f9c2dcc99d694137d95791bf4 |
Close
Hashes for piston_rspy-0.1.3-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dbcb9a091561a6a30a0b313b4ead40a16757e3e7f462b29446c034ee4c25591 |
|
MD5 | 81c4a2c094d24a74b5815e574834eadb |
|
BLAKE2b-256 | d27d84c626ce461f9993fa1ad9d7b7841a07e0bbb535fd63bebb2c423965ffcd |
Close
Hashes for piston_rspy-0.1.3-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae3f23eb74a2a7441f4b5e45b6de6e044961fe531d7953f8144d3733deb1c031 |
|
MD5 | cb1e637fd70c9d862a2fc3df2030b608 |
|
BLAKE2b-256 | f58db7b7da9c10496ba32fb9437fbf8bf20ad735f2c0ac561f05d50c6453e597 |
Close
Hashes for piston_rspy-0.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db248b102b0074683ac455394fa3a7ea5bdfad038806a63b0ee79e40d369667f |
|
MD5 | c728a3bf70e9fad652169eae46c3e70e |
|
BLAKE2b-256 | 1d6400813e6325bb35c794245821247bdd750d595072e38d4a089c22c24f0b59 |
Close
Hashes for piston_rspy-0.1.3-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9daa8978fd19ef2b2541acbed09d461041989b9ac34145f3f6e8422eb0e95787 |
|
MD5 | 355f1a3e255f7049cb69670082afec8f |
|
BLAKE2b-256 | d6d4d2cafb2f63da532651458d542b2c47b8d329bf1290f934acd51fcd0f459d |
Close
Hashes for piston_rspy-0.1.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e652ee8a70d08aa71d1c38bf82a612a03dd9be2a0fa76fcf52e1d67fdcd3560e |
|
MD5 | b2c44ef001b644aced78fae6cacc923b |
|
BLAKE2b-256 | 99c99b307f7f8c8c279a7b087812ad4c27bd128932df769c97d5a8fda8b1b9ce |
Close
Hashes for piston_rspy-0.1.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f75d6eb6ab81ca6478b5767497ea98d910bd6b9093a0eddb6b942effac83fcf |
|
MD5 | a23f0fdaf278d2b385622a309f5428e1 |
|
BLAKE2b-256 | 22f5bbfb0f842e0e293a85a1eefb392b62f6222a6dd853b584196e5723d903a3 |
Close
Hashes for piston_rspy-0.1.3-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79e76568627ce4e8485f70f0b43c387a8f6ab339b7f0d1277205732531158bdf |
|
MD5 | da536c47b0f260b5a88862d41f5be073 |
|
BLAKE2b-256 | 08c7d6610f7802eefc7ab9cce85a187ce3fdd3bb31060815dd6ae470f3cc6c96 |
Close
Hashes for piston_rspy-0.1.3-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90f80aff519a700b88f41db3f30efd9da16a3eb76c6c69ab5bd5830408a93b41 |
|
MD5 | 99875621f8064c16fca96c17435d6c76 |
|
BLAKE2b-256 | 3fbb7210745e388161dc3a4842db95fab328f87cbf09c8101eb55082779eb2cb |
Close
Hashes for piston_rspy-0.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e179a0bbc9242210867262e2f7eaac3f01dc36850b3620d01b264e49a089ef8 |
|
MD5 | 5de73131f29cb3fe598d7eb6157295a8 |
|
BLAKE2b-256 | 117aaa7056180676ee0e7931aebedb8e57765f609d6ed11b09ecbe6135b300e0 |
Close
Hashes for piston_rspy-0.1.3-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47fa15529302b5a6ccf822ceb115be3643585ff9e67c05c90abca7043041ab05 |
|
MD5 | de5232f5af65c246bc52d0f637fa562d |
|
BLAKE2b-256 | cbe21023af9ce3e74d7f8594e21af8666c9cc6a64fc55ad77c78af93aef8d415 |
Close
Hashes for piston_rspy-0.1.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0ba94d9f7e9dcc2edd7e96c41611e601007fbf4c055243c43d4be6d713fe57e |
|
MD5 | a88545f5faee85d379a9e73daf0fa2bc |
|
BLAKE2b-256 | d897002b235ccd8b438cee3893615194e74b6af18b9693d74da574a9a1d84907 |