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.0.tar.gz
(8.6 kB
view hashes)
Built Distributions
Close
Hashes for piston_rspy-0.1.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e9ec5340f282f9bf2809482d0d4f72b97381a7fbd44bab15059faf6f303f531 |
|
MD5 | 3d2e73f21eace9be49da4de41b7900b9 |
|
BLAKE2b-256 | d726312462b27c4094d7576645b61b82dcdcf71c2d67026499310adb899dffbc |
Close
Hashes for piston_rspy-0.1.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a48879c629f58cc9d19707238ae2dfd0acf5f0e1c7fa549d046ebd9eb8b0d41e |
|
MD5 | d463776d48e3dc96b069061cf77b706f |
|
BLAKE2b-256 | bac9dddbf25dd9a2e49fd3ced047e6c243c63e0447846011d464ed1adb65ea46 |
Close
Hashes for piston_rspy-0.1.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5e47541998e2351e9be9ddb2e589db069172ed5238513ef58ed461c2cd22799 |
|
MD5 | 3c55e8b6d9a8d324e2ef7f2555844eca |
|
BLAKE2b-256 | 4d2d4f696f579da698125fc8b240d095cb09d703f5da0f4b7b75dd49dc7cac09 |
Close
Hashes for piston_rspy-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29478bdf8729303e7dabe2a895c2fb053086e3d2d5cd67dcb27ed77baf3f6de8 |
|
MD5 | c89fda953fbf6406201075f3fc16910d |
|
BLAKE2b-256 | 64b029da6ec3b4fa68d628642001170ccf5b84bc04b6477836c2d8d953a18274 |
Close
Hashes for piston_rspy-0.1.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36c86eeefcf929677d994082753b0371cd60bc213ad39f8da0f9d0d964671baf |
|
MD5 | 37a5752e28d0a7fa473dc30e3f0f8fda |
|
BLAKE2b-256 | 361023e07a3b972f6b4f9de86fa4816308f7f23aa3a6a0323f52ecf4af805a29 |
Close
Hashes for piston_rspy-0.1.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecc983540de95ad1415b98b9225c860973aca49e05368efda5197abc87b6db5a |
|
MD5 | 5163cc647265972750d9e6834bf9d1cf |
|
BLAKE2b-256 | 4f813d25a2766f9b63ff5976729761e85393f0c7702cb750521bc78908ee4434 |
Close
Hashes for piston_rspy-0.1.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c9dd67e9d78678dae4d9a47dc66f350426c387de46f965bbf33c2ac53961d14 |
|
MD5 | 809a4d66e959742f0b61c531ec0cd479 |
|
BLAKE2b-256 | 6a1aa681f0ca866323f081116da46612fb5c1e52b5759cbb9856142a8b28444b |
Close
Hashes for piston_rspy-0.1.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c6dff53b21f3b3bcb4c5342807a51279d2ddff6c8ba9f9e892f5b58afc516eb |
|
MD5 | 32fec0b77024854effbb4f8313f16f32 |
|
BLAKE2b-256 | f03e786b43d6befbf0be2492ad843061621105c3ad0cd446fe59f1f7815d79dc |
Close
Hashes for piston_rspy-0.1.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ded33bdf0bffa0f19c096cc174305d4302bee4605313d095afbded5234209fb5 |
|
MD5 | 36025b62e9566519c8d2491dcee80751 |
|
BLAKE2b-256 | 12dd8421597904d8bdab55f92ff070f17751d8197420ea39c2262134f8b50bec |
Close
Hashes for piston_rspy-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f83ab5873c1a06063769a9ba9702661da208158c3757a06c654c3a2e392d78c3 |
|
MD5 | 70011f228f5cc2a93d484aec0241df3f |
|
BLAKE2b-256 | 8520ad45312384db7655ddbc777d2220c2f50f1df3f550ce1f0657268e19f461 |
Close
Hashes for piston_rspy-0.1.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4269a038400726bf9ce274e9770c2921e2fc61b2936758330f6b152c8a666fe9 |
|
MD5 | 39a7c2fc8ec96bd9d4744fda8c1fc681 |
|
BLAKE2b-256 | a81504c59118ba2940e863a92a2835a8f957fe94a7e74a4668a460d1c743b7d5 |
Close
Hashes for piston_rspy-0.1.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76e87a92bc94c46695ab99b8187394be6f24027577f30f71ea4f1771a2cfba23 |
|
MD5 | 6192c7ef81bc38113a0cb7178fecb89e |
|
BLAKE2b-256 | 7a32076031cd236bae9c636c5dea542563608b38e6922825971f7a38eb460b57 |
Close
Hashes for piston_rspy-0.1.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9280918d431f1daf3447a87f657111abcabca55ed4d92789c3b397ba3cb88973 |
|
MD5 | 85421fe28b8ba124eb5f68c8e0b6d0d2 |
|
BLAKE2b-256 | 473189c0515cfcf6641404a003581b2ccecdbfa2a71b42746d5c4cb7d913c8c6 |
Close
Hashes for piston_rspy-0.1.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86c01cfad69261c582f10f49fc5ff89ce2d3479ef5f014241cf295d2dbbff01c |
|
MD5 | f6e342398999e9edbc2540aec31888c2 |
|
BLAKE2b-256 | d7d7b65fbaab385a0cec559661dfc735763d95cb71aab86e41ee85f6d7ef35a5 |
Close
Hashes for piston_rspy-0.1.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df9dc339496467a35e16f73546d4b0de833d49e5961365cf700590f0c2f79ba9 |
|
MD5 | 58499669aad7de1eb1b04d0bbbd0f6cf |
|
BLAKE2b-256 | 25cf465d3d0eb160279b4396b41a94c1ab79ca08e146f4961a8dee9ff75398f5 |
Close
Hashes for piston_rspy-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e909ac19555d1fc7c9b628674ef9c3b707c05fe5958cefb5b69d142f2c450b26 |
|
MD5 | 6bd38b7cef84c64877ed08ff6226ef26 |
|
BLAKE2b-256 | c7c853157c5cd8ff521e9124606de7d071fe52b93c6a6953760a00edf37294dc |
Close
Hashes for piston_rspy-0.1.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b514a494fafb895107763c63fb1b98b6c930f7f75da6bf2d0d703cdc8448c6e1 |
|
MD5 | b4022926e8c7d62a4ff74c3621afb866 |
|
BLAKE2b-256 | 290ad380b7853d49d7f6e123d7ff9dd9374ad6b432f565c0e9e501249efcfa88 |
Close
Hashes for piston_rspy-0.1.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15bbb1008230658ea7a822ef9ac57c761ce3280deac501ce8e0fac12dab836c8 |
|
MD5 | 9dd32a29669e71254733b953fda1a096 |
|
BLAKE2b-256 | 2066250410e7cbda2760b4aa9fff26a4f30a1ded73ace8a69805feefca0dd000 |
Close
Hashes for piston_rspy-0.1.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bd21ad0721408c46bb244074ecf9bd953c8799343e0418c9e6e974062ad7592 |
|
MD5 | 40b518efe5239cf102c2c7ae1c5e44ca |
|
BLAKE2b-256 | 786a9d0545099b8479732765f71eedeb42cf6e4b3bf32d7247b279b4401f19b0 |
Close
Hashes for piston_rspy-0.1.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92566a2c77077c8e0eb3e96f1f176be2638ada21949b3f764853db1008c1f327 |
|
MD5 | bc6dd27af2214e56c8ac3b418cda25e9 |
|
BLAKE2b-256 | 2efd0990a084f46533e8f8565de3ef256b44575d8f2f272505b805fba1d3d197 |
Close
Hashes for piston_rspy-0.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 822b8fcf5a5638232463a5248c3df0b44f6ab80ce3d8e112ee37cc2fc9e9dfad |
|
MD5 | 35ccd4a8ff98ede09ed76c324d5e848f |
|
BLAKE2b-256 | 3acfbcca70b305db5ee54558938d40ee24a1a9fb17a5368a5959938f81f34bc0 |
Close
Hashes for piston_rspy-0.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe760a27f5f6a5417d94e60e9802a628a37f2d6d2f9cfd2cbeddd0fe959f5db8 |
|
MD5 | dd7089c5e911213ca040f42b7ad2055b |
|
BLAKE2b-256 | 6ac0adfe5d3726d7208842a80e8a9064d189a7e4bbe77d4f0790c84633dd27c5 |
Close
Hashes for piston_rspy-0.1.0-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f364bf522785649f6b80e56961309d240fa1d47ce3bfa93074cb366d5bcfe8ce |
|
MD5 | ac5bdc36b2dbad22dcce4d9c32393d6a |
|
BLAKE2b-256 | 5bb6f802d59aa09868fcb0550647cbcc3481987a99f1f656675a41e025e1e748 |
Close
Hashes for piston_rspy-0.1.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb053a49e59c715f84f0710386eb2f7a8fdf9cbe2e79190409d7cb4289118630 |
|
MD5 | abc020a30e2cd4d00a60504d6f50f5ea |
|
BLAKE2b-256 | 2320652e7b98b3ab4c1b123440bbf4e474a068092224bc5aca286d4a7cb08ccf |