0.0.11 • Published 1 year ago

solid-py v0.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

solid-py

size size npm pnpm

solid-py


PyRepl.io is a Python interpreter in your browser. Embed interactive Python examples in your documentation, blog posts, presentations and more. Get started for free.

Quickstart

Install solid-py with:

npm i solid-highlight-words
# or
yarn add solid-highlight-words
# or
pnpm add solid-highlight-words

Then, wrap your app in a PythonProvider component.

import { PythonProvider } from "solid-py";

function App() {
  return (
    // Add the provider to your app
    <PythonProvider>
      <Codeblock />
    </PythonProvider>
  );
}

render(<App />, document.getElementById("root"));

Using the usePython hook, you can run code and access both stdout and stderr. For full usage instructions and framework specific guides, see the usage docs.

Documentation

For full documentation, visit elilambnz.github.io/react-py.

Examples

Basic Example

REPL

Interrupting Execution

Using Packages

File System

Custom Modules

Making API Calls

User Input

Data Visualisation

Limitations

Most of the Python standard library is functional, except from some modules. The following modules can be imported, but are not functional due to the limitations of the WebAssembly VM:

  • multiprocessing
  • threading
  • sockets

Learn more about the limitations here.

License

solid-py is available under the MIT License.

Contact

Ryan Aidan - aidanaden

Acknowledgments

This project uses Pyodide, a Python distribution for the browser and Node.js based on WebAssembly.

Contributing

If you're interested in contributing, please read our contributing docs before submitting a pull request.

0.0.10

1 year ago

0.0.11

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago