Skip to main content

dart_monty 0.120.1 copy "dart_monty: ^0.120.1" to clipboard
dart_monty: ^0.120.1 copied to clipboard

Script your Dart/Flutter app with sandboxed Python — runtime extensions, Flutter glue, and FFI/WASM asset loading on top of dart_monty_core.

dart_monty #

dart_monty

CI Pages codecov

dart_monty runs restricted Python from Dart and Flutter on native and web platforms. It adds stateful runtimes, Dart host functions, extensions, event streams, and OS-call policy to the pool and session primitives supplied by dart_monty_core.

Installation #

dart pub add dart_monty

Or add to pubspec.yaml:

dependencies:
  dart_monty: ^0.120.1

Quick start #

import 'package:dart_monty/dart_monty.dart';

Future<void> main() async {
  final runtime = await MontyRuntime.start();
  try {
    await runtime.execute('x = 41').result;
    final value = await runtime.execute('x + 1').result;
    print(value.dartValue); // 42
  } finally {
    await runtime.dispose();
  }
}

See Choosing an API for the runtime and direct session tradeoffs.

Platform support #

The Dart VM and Flutter native targets use the prebuilt native worker that dart_monty_core downloads from its GitHub release at build time. Browser targets need core's Web Worker and WASM assets plus cross-origin isolation headers. See Installation and Deployment and Bundling for setup.

Documentation #

The public declarations are listed in lib/dart_monty.dart.

License #

The package uses the MIT License.

6
likes
140
points
212
downloads

Documentation

API reference

Publisher

verified publisherenfoldsystems.com

Weekly Downloads

Script your Dart/Flutter app with sandboxed Python — runtime extensions, Flutter glue, and FFI/WASM asset loading on top of dart_monty_core.

Repository (GitHub)
View/report issues
Contributing

Topics

#python #sandbox #interpreter #dart

License

MIT (license)

Dependencies

dart_monty_core, meta, path, signals_core, struct_log

More

Packages that depend on dart_monty