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, 3.10, and 3.11.
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.1.tar.gz
(12.6 kB
view hashes)
Built Distributions
Close
Hashes for piston_rspy-0.4.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab02bd05c021b63ad885787d3d4e67fc7f1ba7ae6aac38df0bafdd285670c3b9 |
|
MD5 | 8c9d66dfde06c8373c844c22d8c6c7df |
|
BLAKE2b-256 | c5e4928717db697e4289f27d30bf1474f10cdd01092b46aecedf0d1b050532ee |
Close
Hashes for piston_rspy-0.4.1-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05ea6718de7df2d90ddb2f7953f06c96c212a1f2649d122960d1ce8d19c5ca1b |
|
MD5 | 4492555a4cd7a72bbc994912547ffdfc |
|
BLAKE2b-256 | 4e7ed5dc46f6609a7f14dfa1aa898a6757501964b6816e6ee62375d0bfd2cc4a |
Close
Hashes for piston_rspy-0.4.1-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c395013b0869e84035a7b251888244a647b8a93c0f030086c2c4a1b8c1889118 |
|
MD5 | db0c3450e29e877d0834b6f047cc9f22 |
|
BLAKE2b-256 | bf317abfd610dcb597b166c453770cdde8250b4d4fd51ead0120e4466d47af21 |
Close
Hashes for piston_rspy-0.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20b61d1c915105404ceb5ddc15d1949c6b370ea38b246514aa412804ba62d11e |
|
MD5 | e9b672a96dab1c5305217167b5d6acba |
|
BLAKE2b-256 | 2e0043855d7fbc3eb35dc100294d7e4fe66ed4e3e85d2183cb72db1c41ab15bf |
Close
Hashes for piston_rspy-0.4.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d4b54155c3be5bf7b86c906a7504309d965bbaf292ebd94a50dd197b7d9739a |
|
MD5 | 57b2b02b759f87f8617151644de0863d |
|
BLAKE2b-256 | f74e2db5279200d91b11486ee12a589ad22b63b1ec09e1231eac072a727107c7 |
Close
Hashes for piston_rspy-0.4.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a90a5cf8b7f1fcc27edf0fca6b74383a74a546928f55d788a73e4142cd071a82 |
|
MD5 | bd65e38baaaab1afe6fbe453468d1b92 |
|
BLAKE2b-256 | bb30ff2e9117acee4d43b0cfd524ae43a4bab2d4b4ea0232f1c4943c6c3c750f |
Close
Hashes for piston_rspy-0.4.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a12a97279a2133b51186d1a7fe89caad4138eaa3de29a053ed7310272c92965 |
|
MD5 | 7a2c837eaf2f04cb7d7c98805fd2bcaf |
|
BLAKE2b-256 | c2a6d2b87dc4f2a908daf4e00fb4556d8ed0db839ec9d0166caf4e8d47812377 |
Close
Hashes for piston_rspy-0.4.1-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e95c539c491206370e00c6269e7096b8326f51ef7f84e70a981e9cb847bd39cf |
|
MD5 | 341f1d950ace1b5ae73ccd30ab959706 |
|
BLAKE2b-256 | 2a8454d5a7176ce30f525d66ca8fcbcf5c350577093b867fa9b1fab7a50c071b |
Close
Hashes for piston_rspy-0.4.1-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce4366714f5ef7fc776e37d3f2bf154dd372ff3427c290dda4e44d1d6202132f |
|
MD5 | 05cb9b95b1685d832116ab952d4e159f |
|
BLAKE2b-256 | 71fc092f697de19831f0e359b96f687158c9df7d72306ff1483a4795860ae63b |
Close
Hashes for piston_rspy-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccb75233b8fe71cb0bcd89f178b9a4658d1f5d23c5f4c7b6768632daaddc66c1 |
|
MD5 | c042a2ad04d3463fe06fe22f70e4c198 |
|
BLAKE2b-256 | 035392f93bc38973e2054e5782424a834d8aeffadc5cb52a8c3c5553773419de |
Close
Hashes for piston_rspy-0.4.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 137ab581d210fc2f5deb8bfe6820bfd679bce4ec1b4f415fa77c2ecadc69972c |
|
MD5 | 03ae122c6831895436dffc0b4981ea35 |
|
BLAKE2b-256 | 2bbad8f25c59bbc001ea6e755a964a3deb651bf29faea2be87f2ca7ef4a18349 |
Close
Hashes for piston_rspy-0.4.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3828ee5a5b38607b14eb18f2875d2e425f4086cdb8ea800decc05729ac2d3555 |
|
MD5 | d0bd6ca70ee4a1dfdd72d2d4cd7accab |
|
BLAKE2b-256 | ccc675a10968343db75bc3fc3ccd6020f85665f1b5ccedb949f63218b2bfe3fd |
Close
Hashes for piston_rspy-0.4.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a6a8b765bba7607fcab0cdcef1d304e6455d36a973e28c5202430a2aa468de3 |
|
MD5 | c14a8328ee56113831bca2c32f00acd6 |
|
BLAKE2b-256 | c1b3f4ff0da66e21dc111676de26e3439a964d84709a437070a93ceb215bdce1 |
Close
Hashes for piston_rspy-0.4.1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fcd71af00e135b68dd8e81336d9c8c3779f8d11c175068d7413170d83360e2d |
|
MD5 | d425d5fa0be3417290fae8ac01439beb |
|
BLAKE2b-256 | bbcfd12ecb24f237b62eef06401049c36c0158848e112b9f2cbceb8de9ee957f |
Close
Hashes for piston_rspy-0.4.1-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08deaffe6dc49a3a5a4bce6b12f82fca37961360573de626931ce0cbb4ae385a |
|
MD5 | 68996c76bb8a4474585db08923471411 |
|
BLAKE2b-256 | 99db63f61028814206ff72ab1a89b8448da56fc2b9b011cc76b6e8c42b4ce769 |
Close
Hashes for piston_rspy-0.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d7a294026b74f0ef3cc3f975fc86afaf7b30e470af3065653dca98247299794 |
|
MD5 | b15786c25961ecdb620a09e28fcd5923 |
|
BLAKE2b-256 | e3fe5bda88f213afb513db16eca9262eab78b08b74aa98e01223001b4ee18760 |
Close
Hashes for piston_rspy-0.4.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5cfc6acd16b0158987ef19b999d73bd48467af1e2ca7e9f951c64305208f49d |
|
MD5 | e7e2cf1fdb201728601b9582fe9ef898 |
|
BLAKE2b-256 | bb77037f6830c1c2f4783d7ff778d7e5def45943ca06c86f54db0ffe614e0ece |
Close
Hashes for piston_rspy-0.4.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b35d40ab6bce5f8542f19b4e22cdb02048397444597438d13f8d1447589bf338 |
|
MD5 | 81cfeda5b5cd16ab5a60abebab97fee1 |
|
BLAKE2b-256 | 0215ba7ae178109d660b88ddff6067df3e1970ea9816c99de49081abdcf28ab1 |
Close
Hashes for piston_rspy-0.4.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 414e27d5e1d6c224efe6b01c5f189f6f0feed1c48837535fe9a9aa9502c21091 |
|
MD5 | 0b4d2d546cea023f63187d368ed3db51 |
|
BLAKE2b-256 | 6b5611b155f7dec73c4df0b94d444826f0f2dd41b1097a582bc10249e30fdec7 |
Close
Hashes for piston_rspy-0.4.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a13800db75918bd84d2d03fae4bec94b24daaf497eb0e181855033404fe8c812 |
|
MD5 | a02139cb43a335f5a05e27e949394ab1 |
|
BLAKE2b-256 | 8369b37c2f678432dd74181b57a884b18b531da96eb0027648ee7fe7d01deb93 |
Close
Hashes for piston_rspy-0.4.1-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89c0c08becc2f45352e59c2f8795d6121557f9abc80f3186b84f555472246db0 |
|
MD5 | bfd975c8108054b4d57e3f04999f56f2 |
|
BLAKE2b-256 | 03e133e216a12ef95046bbb8fbaf449c65e2258de5f736c02423c352f306b98a |
Close
Hashes for piston_rspy-0.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9594d96280cf354baee3a6a224d7a8ae09c47bbddb5a371047bac73beb1cb3f6 |
|
MD5 | 72e2ebdbe9759158cc64ea78c63767b4 |
|
BLAKE2b-256 | 686a63cbb3b697d10ca41add9e954be10f5608356599e966730b762ff486fe29 |
Close
Hashes for piston_rspy-0.4.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9eeafcc3b77a9cf2c0b87a091e5a5652946eee2aeb3e117f56c96fbaa8ec7554 |
|
MD5 | 9fdf57020e0ffcefb931007fedca60cb |
|
BLAKE2b-256 | 17bfe867edb97d7beda7e133092a99bc7a912337fbef0005c5a583ad0eca01a6 |
Close
Hashes for piston_rspy-0.4.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7f0a9f0b14e6385211b384bb014082edeb5b45f3861ae84dc0f84bf02d8505e |
|
MD5 | 233cec4d0d08af9fc32f67239de8c53a |
|
BLAKE2b-256 | 5496c22e52b6208e85f55763bf074393286fd5d474b31bf15c48dee4be46c44d |
Close
Hashes for piston_rspy-0.4.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d48dd96062f75243d75b682d96e7da6881532775eb011806248c40321e1f0db |
|
MD5 | 10aa691942183a5b0690a2b54a7229b5 |
|
BLAKE2b-256 | 2462d9a39871946f1b5fa06913d5bbb319c62272786d2e2d8fa6db7943abfee3 |
Close
Hashes for piston_rspy-0.4.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fea275579853575ecb9397ce7798c16e99ea6094c45f6041bf9c7b40b9a44629 |
|
MD5 | 27cd674faca14a1949516248d07518df |
|
BLAKE2b-256 | 3f5edc9ec46c9166240373cbc0709023cc938077beebac71f7b72f4f9cdb5fde |
Close
Hashes for piston_rspy-0.4.1-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa866fa1d2c41fc552e511bb0ddac9a4f4873fb5470533eda3f531dac0dd263f |
|
MD5 | 9a92c3436376aaff601ad293473eebdf |
|
BLAKE2b-256 | 1475549416069b4eae30a7261e065cc7ad68e96689c32c3881663ed6b2c23b9d |
Close
Hashes for piston_rspy-0.4.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b7e93e79b6f729a288bb92e5973290a1a5e82865ea7885e7eb4753c12ac7cd6 |
|
MD5 | 3bc1250232a6a8ea1a400a2d24bb8838 |
|
BLAKE2b-256 | 699ef3a50d44d031e164a4db9f164ba8258f49d1ca29f33b2bc63b3016385690 |
Close
Hashes for piston_rspy-0.4.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8ba5b3064f5e7d5799c603316e62e7acb0d634aa1de228de23f78a819e68cba |
|
MD5 | fc347feaf6d019aa6b3986993c5e7fdd |
|
BLAKE2b-256 | 05f6bd7e27236e68df9b5693852a48e50a490a4e108773d39ccb5c1892d423f2 |
Close
Hashes for piston_rspy-0.4.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6539fd8a581023051105068dcab52adb26fd08b45fa37fa856c7cc482e4b6001 |
|
MD5 | 950acaa1dc78fbeac4aba3c9b5b06718 |
|
BLAKE2b-256 | 20cf7d86789cb88710aad2f6b72557e7e089d8e386f5c91c0d7ae9ffef179c47 |