Skip to main content

A modern Python library

Project description

bridgeit

An experimental hack to run other languages than python in solve.it.com.

Requirements

Installation

!pip install -U bridgeit

How it Works

BridgeIt enables running non-Python languages in SolveIt notebooks through a three-step process:

  1. Compiler Installation: Automatically installs language compilers and toolchains (e.g., evcxr for Rust, Mojo via pixi)

  2. Kernelspec Registration: Registers Jupyter kernelspecs that define how to execute each language

  3. Cell Magic Binding: Creates IPython cell magics (e.g., %%rust, %%mojo) that bridge notebook cells to the installed kernels

When you use %%rust or %%mojo, BridgeIt sends your code to the appropriate kernel for execution and displays the results inline.

Usage

Quick Start

import bridgeit

# Show available commands
bridgeit.help()

# List supported languages
bridgeit.langs()

Rust Example

# Install Rust kernel
bridgeit.install("rust")

# Activate Rust magic
bridgeit.use("rust")
%%rust
fn main() {
    println!("Hello from Rust 🦀");
}
main()
%%rust
let value = 21;
println!("{}", value * 2);

Mojo Example

# Install Mojo kernel
bridgeit.install("mojo")

# Activate Mojo magic
bridgeit.use("mojo")
%%mojo
fn main():
    print("Hello from Mojo 🔥")
main()
%%mojo
alias value = 10
print(value * 3)

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bridgeit-0.1.0.tar.gz (93.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bridgeit-0.1.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file bridgeit-0.1.0.tar.gz.

File metadata

  • Download URL: bridgeit-0.1.0.tar.gz
  • Upload date:
  • Size: 93.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bridgeit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 12b2ed1a26124c10998f3c06b4b8649b67902e43e7664245350c05bd410d6a5b
MD5 f9245b67923ec42e80b74cb609b3962c
BLAKE2b-256 fa5949306af6cf1d44aa8d797de2ce870d349d440a083db2558b5f7be59374a2

See more details on using hashes here.

File details

Details for the file bridgeit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bridgeit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bridgeit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba824637a1086bc9e4b22220141d0df675266049dd1037d196f4fe55d8d77513
MD5 7b27e736319d07fcb4928026381b8a43
BLAKE2b-256 c38f2d23bef1d79f2837f7e32997e4b968b191da31e4f3f75fa3068154a640e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page