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.0.tar.gz
(11.3 kB
view hashes)
Built Distributions
Close
Hashes for piston_rspy-0.3.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b91df58010b69db3d569205d495675cd4fd05dc0a79015e99c0390bbf1894195 |
|
MD5 | 88d7b9e8c4c760aed98edc355012a3a2 |
|
BLAKE2b-256 | d4e41d409a3b744edf2f1a1213189dd443230bcdf0d7c13dff69bdaeec2b786b |
Close
Hashes for piston_rspy-0.3.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75e22b927b0762213550d66aa9a93dc9f530c6ec682547963dbc6a3f47017a74 |
|
MD5 | 83e7b604bf68ca252a8c6dcac4cb9105 |
|
BLAKE2b-256 | 9c29f3ec64c61ea57116fbeabc79ac0841e49192f4fba2122c153cc53a88b3a0 |
Close
Hashes for piston_rspy-0.3.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f55d669a9092a8429ef34f36627f8188b7b3a4d6f455308713a435cd756d006f |
|
MD5 | b62f51d698c1e613ef23569cd55ba6d7 |
|
BLAKE2b-256 | 427af0bd17e0be137529e2a5d6ed25bb1e58309fce425b5a3cd960de2b60d81f |
Close
Hashes for piston_rspy-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a8228b983279da95e327e5d9639585dce453c828eae029258ed9485b4e4d183 |
|
MD5 | e3b0ca1fd78225a1fd171043d40267eb |
|
BLAKE2b-256 | da07504c2297864274e8e058107415cbd341aeb71ef4fbc84501fe67a5d44d66 |
Close
Hashes for piston_rspy-0.3.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd2d0a736fa55c991584f7db27e76b6464d880f12c187c0d0193e01b1a3c3f34 |
|
MD5 | f3e61b70f1c39b65983cb0bc4acccbbb |
|
BLAKE2b-256 | bff03c561da02ec682286c5dd21a2bc3f53a8fd95bbe69401f4ffd2238acdb85 |
Close
Hashes for piston_rspy-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9478d83fc3628dad8ac2348bbb014590cf874e82ff115b857368d94f06b46168 |
|
MD5 | bc7d9f1e4a9b0a67d1b3c6b336ceadbe |
|
BLAKE2b-256 | 0dd9253991b4fee48a38062576e246a1e0f682cf80e5ccbe8188849d0e7aff75 |
Close
Hashes for piston_rspy-0.3.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a3b6b10a57854caace3926a25db727d8c02933d0409412b7341bab242322834 |
|
MD5 | c5d35fc16ccc4c9529a55094b2c789d3 |
|
BLAKE2b-256 | 385ad457129665414b00efb03d07051c62e19e113b86881f34d636d068420743 |
Close
Hashes for piston_rspy-0.3.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e7381493242583d866a130c55cbbe77d595ccfec449b094b2053d0e67a72b25 |
|
MD5 | 3c253c81824dde3be586844099bc314c |
|
BLAKE2b-256 | d9e7558bbd4d37b0815a7687549d02cbf1801c9f5a8f3857350adee2364fa346 |
Close
Hashes for piston_rspy-0.3.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1b4bf34d6e9900daa5fcea027b2c8ea166894da2248d80798768ca7d3db4577 |
|
MD5 | ff1606f10128d96530033c81604f21e1 |
|
BLAKE2b-256 | 9e5b5dc33f92dd08403b57dcd15d974c336515ce7f843361e99de2246c8b4b70 |
Close
Hashes for piston_rspy-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e99f7c2c85731c6b854b9115f1b834af201f140a408bc7b281b605ba8921341 |
|
MD5 | c0e2b2b29168ef970ab5166bdcc4e62e |
|
BLAKE2b-256 | cef78797f913712cc66bb71b2b78681aa4a7f9f94923bdb95dd6910fca0592a5 |
Close
Hashes for piston_rspy-0.3.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d03ade8837fd509c2eb434d923f80aa5c114e7f46f7e895adee819ae33e3a5a4 |
|
MD5 | 5f60bb712a89137c242bdfea9b104806 |
|
BLAKE2b-256 | 0f13ea7728a0d68b9b26495411ee48ef54590a394844bb5a3d6442655282e28a |
Close
Hashes for piston_rspy-0.3.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcabc24fc54ff64a7f0272b57dbe6b8752799f29d0ecdbe847f8877fdd937cb5 |
|
MD5 | 09671376f5fb82938463161682a8ccf8 |
|
BLAKE2b-256 | cd8c3030b5e1c3905b4b70bdd229d70890a4b360b7a4ae95f06b37ee5a8c677b |
Close
Hashes for piston_rspy-0.3.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67e02acdf12776f6934fcf322228c59124b0f2ea043dc189d434ea6d1a30bde1 |
|
MD5 | 286aa4fddb688fe8f3193465f2cb4797 |
|
BLAKE2b-256 | 77cd5a83b323744d950f11ccfa79019ba616c260e74c597a41c8aaa3bee8e7a1 |
Close
Hashes for piston_rspy-0.3.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7aaff351c5b8767d78281cca8fedc7f5d31557821c9228406a55b60cdd0f3bcb |
|
MD5 | 1de863db01fac62060e5105b502ec3ce |
|
BLAKE2b-256 | f28aab5b78118117dfd35843515891d07f1797d336d89a86d4ab56eb0f1c9f66 |
Close
Hashes for piston_rspy-0.3.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89f24abc34b8a34e5f031f99a3f3bf8080ddd60cb7e0d1d6fd53ec99530d87c3 |
|
MD5 | 51bcbdaaaa8bfa241a9d52dcc70452f3 |
|
BLAKE2b-256 | 30fea2184a7deabe3491792a9f6d9073cfeb4e80fc3c9339b91e6efada7a6588 |
Close
Hashes for piston_rspy-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a13dbcfc1987967c9a1b320ef9fee0aba7702c1c4db6a4f108e2018f8e7074a9 |
|
MD5 | fdcd034d72c7be643352fc6730df9551 |
|
BLAKE2b-256 | 61078d22aa38fddb502894ae19012b72b0ae5acc3695ae79d0c118680536ffb2 |
Close
Hashes for piston_rspy-0.3.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff8e3b10706dbe33a60064090e2bff175d433fdbd9c363b5c611a4fa510be5a1 |
|
MD5 | b7f8a88d23fb352c447dde9ef9179b4e |
|
BLAKE2b-256 | 74333f3b27d0edb43fc909a4fdb63ffa4e2dfc384068ccfe94377c549458e297 |
Close
Hashes for piston_rspy-0.3.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d38019c246594ed72dbbf83e1c1e1b99a4292a1536a688c1b80be25b70f1ae35 |
|
MD5 | 8b9febf038c62a610cf51923b7aba2e0 |
|
BLAKE2b-256 | 64cb54166c929deaf1f9367ab2283d490bc0361904228ddaa0988481031db0c7 |
Close
Hashes for piston_rspy-0.3.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cb3a5f436c08818673d2749a06af0390f8a65d895f6c34a19cafd1ae257f17c |
|
MD5 | e92f81e450d60b8c6f7e65c7e4fe45f2 |
|
BLAKE2b-256 | 777e42a40c23a732a4b58b580213e7bf3a53d11a4c632e4343ea07833bd8d953 |
Close
Hashes for piston_rspy-0.3.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2621afd5d889c64f3ae1677d988554ee6876580d496984f76b040a021d57f338 |
|
MD5 | dda3c0f95f4594ed178bf112f8439d1a |
|
BLAKE2b-256 | dce8d6f528bba7cd71fa24578198dabafa2411d3d89e883f6415684dcc814378 |
Close
Hashes for piston_rspy-0.3.0-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d91a41fd00e6c4641983d0117cbea0869f3c188b684c56eca53a68ded156d4d |
|
MD5 | a6197f858ef7cabb731f36747b7cb9a4 |
|
BLAKE2b-256 | e269d367ba54f7225ea9edaee75029d5470a1dfff5a6cd2226c324a7a5fb81d0 |
Close
Hashes for piston_rspy-0.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2b9b19975cf7b2d7f4940e5666e0697e33ebf29ae29c8bc070ff6a0808ea02f |
|
MD5 | f39abb1ba1c7915bb0d7518245a411b5 |
|
BLAKE2b-256 | 2024988e5ec21d0d64a9a3a02cfdf66b584759f879b8cadb09c75eca5c385a0b |
Close
Hashes for piston_rspy-0.3.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 120589f5a04840c6e1f1f307735db65d9ff8303c72015eb6587f14ee5c697802 |
|
MD5 | 1b2ac4d740890df8c8267dd5f1ed7ea9 |
|
BLAKE2b-256 | a5f1d52bee6d8917c10d97151a0effa2b5cde099c0c821fd25f210eb8ccbd149 |
Close
Hashes for piston_rspy-0.3.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2baa4f8e751c5d0b3d71f95fa5da1dd280372e6233a2da44e137955a770fa7a4 |
|
MD5 | 748c43c00fc86e91796d55451b87264b |
|
BLAKE2b-256 | 89070178aa71b1f5aa6464521342393f27593091537741f219264e9a7457fcb2 |