dartpy library

dartpy is a library that allows dart to call out to python code

For a simple python script inline you can do the following:

void main(List<String> args) {
 dartpyc.Py_Initialize();
 final python = '''
 from time import time, ctime
 print("Today is", ctime(time()))
 ''';
 final pystring = python.toNativeUtf8();
 dartpyc.PyRun_SimpleString(pystring.cast<Int8>());
 malloc.free(pystring);
 print(dartpyc.Py_FinalizeEx());
}

For a more complex script that you don't want inline you can do this:

void main() {
 // initializes the python runtime
 pyStart();
 try {
   // imports a python module
   final pyModule = pyimport('multiply');
   // gets a function within that module
   final pFunc = pyModule.getFunction('multiply');
   // calls the function and gets the result
   final result = pFunc([1, 2]);
   print(result); // Should print 3
 } on DartPyException catch (e) {
   print(e);
   // Cleans up memory
   pyCleanup();
   exit(1);
 }
 // Cleans up memory
 pyCleanup();
 exit(0);
}

Constants

CO_ASYNC_GENERATOR → const int
CO_CELL_NOT_AN_ARG → const int
CO_COROUTINE → const int
CO_FUTURE_ABSOLUTE_IMPORT → const int
CO_FUTURE_ANNOTATIONS → const int
CO_FUTURE_BARRY_AS_BDFL → const int
CO_FUTURE_DIVISION → const int
CO_FUTURE_GENERATOR_STOP → const int
CO_FUTURE_PRINT_FUNCTION → const int
CO_FUTURE_UNICODE_LITERALS → const int
CO_FUTURE_WITH_STATEMENT → const int
CO_GENERATOR → const int
CO_ITERABLE_COROUTINE → const int
CO_MAXBLOCKS → const int
CO_NESTED → const int
CO_NEWLOCALS → const int
CO_NOFREE → const int
CO_OPTIMIZED → const int
CO_VARARGS → const int
CO_VARKEYWORDS → const int
ENABLE_IPV6 → const int
F_ALT → const int
F_BLANK → const int
F_LJUST → const int
F_SIGN → const int
F_ZERO → const int
FUTURE_ABSOLUTE_IMPORT → const String
FUTURE_ANNOTATIONS → const String
FUTURE_BARRY_AS_BDFL → const String
FUTURE_DIVISION → const String
FUTURE_GENERATOR_STOP → const String
FUTURE_GENERATORS → const String
FUTURE_NESTED_SCOPES → const String
FUTURE_PRINT_FUNCTION → const String
FUTURE_UNICODE_LITERALS → const String
FUTURE_WITH_STATEMENT → const String
FVC_ASCII → const int
FVC_MASK → const int
FVC_NONE → const int
FVC_REPR → const int
FVC_STR → const int
FVS_HAVE_SPEC → const int
FVS_MASK → const int
HAVE_ACOSH → const int
HAVE_ADDRINFO → const int
HAVE_ALARM → const int
HAVE_ALLOCA_H → const int
HAVE_ASINH → const int
HAVE_ATANH → const int
HAVE_BROKEN_SEM_GETVALUE → const int
HAVE_BUILTIN_ATOMIC → const int
HAVE_CHFLAGS → const int
HAVE_CHOWN → const int
HAVE_CHROOT → const int
HAVE_CLOCK → const int
HAVE_CLOCK_GETRES → const int
HAVE_CLOCK_GETTIME → const int
HAVE_CLOCK_SETTIME → const int
HAVE_COMPUTED_GOTOS → const int
HAVE_CONFSTR → const int
HAVE_COPYSIGN → const int
HAVE_CTERMID → const int
HAVE_CTERMID_R → const int
HAVE_CURSES_FILTER → const int
HAVE_CURSES_H → const int
HAVE_CURSES_HAS_KEY → const int
HAVE_CURSES_IMMEDOK → const int
HAVE_CURSES_IS_TERM_RESIZED → const int
HAVE_CURSES_RESIZE_TERM → const int
HAVE_CURSES_RESIZETERM → const int
HAVE_CURSES_SYNCOK → const int
HAVE_CURSES_TYPEAHEAD → const int
HAVE_CURSES_USE_ENV → const int
HAVE_CURSES_WCHGAT → const int
HAVE_DECL_ISFINITE → const int
HAVE_DECL_ISINF → const int
HAVE_DECL_ISNAN → const int
HAVE_DECL_RTLD_DEEPBIND → const int
HAVE_DECL_RTLD_GLOBAL → const int
HAVE_DECL_RTLD_LAZY → const int
HAVE_DECL_RTLD_LOCAL → const int
HAVE_DECL_RTLD_MEMBER → const int
HAVE_DECL_RTLD_NODELETE → const int
HAVE_DECL_RTLD_NOLOAD → const int
HAVE_DECL_RTLD_NOW → const int
HAVE_DEV_PTMX → const int
HAVE_DEVICE_MACROS → const int
HAVE_DIRENT_D_TYPE → const int
HAVE_DIRENT_H → const int
HAVE_DIRFD → const int
HAVE_DLFCN_H → const int
HAVE_DLOPEN → const int
HAVE_DUP2 → const int
HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH → const int
HAVE_DYNAMIC_LOADING → const int
HAVE_ERF → const int
HAVE_ERFC → const int
HAVE_ERRNO_H → const int
HAVE_EXECV → const int
HAVE_EXPM1 → const int
HAVE_FACCESSAT → const int
HAVE_FCHDIR → const int
HAVE_FCHMOD → const int
HAVE_FCHMODAT → const int
HAVE_FCHOWN → const int
HAVE_FCHOWNAT → const int
HAVE_FCNTL_H → const int
HAVE_FDOPENDIR → const int
HAVE_FINITE → const int
HAVE_FLOCK → const int
HAVE_FORK → const int
HAVE_FORKPTY → const int
HAVE_FPATHCONF → const int
HAVE_FSEEKO → const int
HAVE_FSTATAT → const int
HAVE_FSTATVFS → const int
HAVE_FSYNC → const int
HAVE_FTELLO → const int
HAVE_FTIME → const int
HAVE_FTRUNCATE → const int
HAVE_FUTIMENS → const int
HAVE_FUTIMES → const int
HAVE_GAI_STRERROR → const int
HAVE_GAMMA → const int
HAVE_GCC_ASM_FOR_X64 → const int
HAVE_GCC_UINT128_T → const int
HAVE_GETADDRINFO → const int
HAVE_GETC_UNLOCKED → const int
HAVE_GETENTROPY → const int
HAVE_GETGRGID_R → const int
HAVE_GETGRNAM_R → const int
HAVE_GETGROUPLIST → const int
HAVE_GETGROUPS → const int
HAVE_GETHOSTBYNAME → const int
HAVE_GETITIMER → const int
HAVE_GETLOADAVG → const int
HAVE_GETLOGIN → const int
HAVE_GETNAMEINFO → const int
HAVE_GETPAGESIZE → const int
HAVE_GETPEERNAME → const int
HAVE_GETPGID → const int
HAVE_GETPGRP → const int
HAVE_GETPID → const int
HAVE_GETPRIORITY → const int
HAVE_GETPWENT → const int
HAVE_GETPWNAM_R → const int
HAVE_GETPWUID_R → const int
HAVE_GETSID → const int
HAVE_GETTIMEOFDAY → const int
HAVE_GETWD → const int
HAVE_GRP_H → const int
HAVE_HSTRERROR → const int
HAVE_HYPOT → const int
HAVE_IF_NAMEINDEX → const int
HAVE_INET_ATON → const int
HAVE_INET_PTON → const int
HAVE_INITGROUPS → const int
HAVE_INTTYPES_H → const int
HAVE_KILL → const int
HAVE_KILLPG → const int
HAVE_KQUEUE → const int
HAVE_LANGINFO_H → const int
HAVE_LCHFLAGS → const int
HAVE_LCHMOD → const int
HAVE_LCHOWN → const int
HAVE_LGAMMA → const int
HAVE_LIBDL → const int
HAVE_LIBREADLINE → const int
HAVE_LINKAT → const int
HAVE_LOCKF → const int
HAVE_LOG1P → const int
HAVE_LOG2 → const int
HAVE_LONG_DOUBLE → const int
HAVE_LONG_LONG → const int
HAVE_LSTAT → const int
HAVE_LUTIMES → const int
HAVE_MADVISE → const int
HAVE_MAKEDEV → const int
HAVE_MBRTOWC → const int
HAVE_MEMORY_H → const int
HAVE_MKDIRAT → const int
HAVE_MKFIFO → const int
HAVE_MKFIFOAT → const int
HAVE_MKNOD → const int
HAVE_MKNODAT → const int
HAVE_MKTIME → const int
HAVE_MMAP → const int
HAVE_NCURSES_H → const int
HAVE_NET_IF_H → const int
HAVE_NICE → const int
HAVE_OPENAT → const int
HAVE_OPENPTY → const int
HAVE_PATHCONF → const int
HAVE_PAUSE → const int
HAVE_POLL → const int
HAVE_POLL_H → const int
HAVE_POSIX_SPAWN → const int
HAVE_POSIX_SPAWNP → const int
HAVE_PREAD → const int
HAVE_PREADV → const int
HAVE_PROTOTYPES → const int
HAVE_PTHREAD_H → const int
HAVE_PTHREAD_KILL → const int
HAVE_PTHREAD_SIGMASK → const int
HAVE_PUTENV → const int
HAVE_PWRITE → const int
HAVE_PWRITEV → const int
HAVE_READLINKAT → const int
HAVE_READV → const int
HAVE_REALPATH → const int
HAVE_RENAMEAT → const int
HAVE_RL_APPEND_HISTORY → const int
HAVE_RL_CATCH_SIGNAL → const int
HAVE_RL_COMPLETION_APPEND_CHARACTER → const int
HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK → const int
HAVE_RL_COMPLETION_MATCHES → const int
HAVE_RL_COMPLETION_SUPPRESS_APPEND → const int
HAVE_RL_PRE_INPUT_HOOK → const int
HAVE_RL_RESIZE_TERMINAL → const int
HAVE_ROUND → const int
HAVE_SCHED_GET_PRIORITY_MAX → const int
HAVE_SCHED_H → const int
HAVE_SEM_GETVALUE → const int
HAVE_SEM_OPEN → const int
HAVE_SENDFILE → const int
HAVE_SETEGID → const int
HAVE_SETEUID → const int
HAVE_SETGID → const int
HAVE_SETGROUPS → const int
HAVE_SETHOSTNAME → const int
HAVE_SETITIMER → const int
HAVE_SETLOCALE → const int
HAVE_SETPGID → const int
HAVE_SETPGRP → const int
HAVE_SETPRIORITY → const int
HAVE_SETREGID → const int
HAVE_SETREUID → const int
HAVE_SETSID → const int
HAVE_SETUID → const int
HAVE_SETVBUF → const int
HAVE_SHM_OPEN → const int
HAVE_SIGACTION → const int
HAVE_SIGALTSTACK → const int
HAVE_SIGFILLSET → const int
HAVE_SIGINFO_T_SI_BAND → const int
HAVE_SIGINTERRUPT → const int
HAVE_SIGNAL_H → const int
HAVE_SIGPENDING → const int
HAVE_SIGRELSE → const int
HAVE_SIGWAIT → const int
HAVE_SNPRINTF → const int
HAVE_SOCKADDR_SA_LEN → const int
HAVE_SOCKADDR_STORAGE → const int
HAVE_SOCKETPAIR → const int
HAVE_SPAWN_H → const int
HAVE_SSIZE_T → const int
HAVE_STAT_TV_NSEC2 → const int
HAVE_STATVFS → const int
HAVE_STD_ATOMIC → const int
HAVE_STDARG_PROTOTYPES → const int
HAVE_STDINT_H → const int
HAVE_STDLIB_H → const int
HAVE_STRDUP → const int
HAVE_STRFTIME → const int
HAVE_STRING_H → const int
HAVE_STRINGS_H → const int
HAVE_STRLCPY → const int
HAVE_STRSIGNAL → const int
HAVE_STRUCT_PASSWD_PW_GECOS → const int
HAVE_STRUCT_PASSWD_PW_PASSWD → const int
HAVE_STRUCT_STAT_ST_BIRTHTIME → const int
HAVE_STRUCT_STAT_ST_BLKSIZE → const int
HAVE_STRUCT_STAT_ST_BLOCKS → const int
HAVE_STRUCT_STAT_ST_FLAGS → const int
HAVE_STRUCT_STAT_ST_GEN → const int
HAVE_STRUCT_STAT_ST_RDEV → const int
HAVE_STRUCT_TM_TM_ZONE → const int
HAVE_SYMLINKAT → const int
HAVE_SYNC → const int
HAVE_SYS_EVENT_H → const int
HAVE_SYS_FILE_H → const int
HAVE_SYS_IOCTL_H → const int
HAVE_SYS_KERN_CONTROL_H → const int
HAVE_SYS_LOCK_H → const int
HAVE_SYS_MMAN_H → const int
HAVE_SYS_PARAM_H → const int
HAVE_SYS_POLL_H → const int
HAVE_SYS_RANDOM_H → const int
HAVE_SYS_RESOURCE_H → const int
HAVE_SYS_SELECT_H → const int
HAVE_SYS_SOCKET_H → const int
HAVE_SYS_STAT_H → const int
HAVE_SYS_STATVFS_H → const int
HAVE_SYS_SYS_DOMAIN_H → const int
HAVE_SYS_SYSCALL_H → const int
HAVE_SYS_TIME_H → const int
HAVE_SYS_TIMES_H → const int
HAVE_SYS_TYPES_H → const int
HAVE_SYS_UIO_H → const int
HAVE_SYS_UN_H → const int
HAVE_SYS_UTSNAME_H → const int
HAVE_SYS_WAIT_H → const int
HAVE_SYS_XATTR_H → const int
HAVE_SYSCONF → const int
HAVE_SYSEXITS_H → const int
HAVE_TCGETPGRP → const int
HAVE_TCSETPGRP → const int
HAVE_TEMPNAM → const int
HAVE_TERM_H → const int
HAVE_TERMIOS_H → const int
HAVE_TGAMMA → const int
HAVE_TIMEGM → const int
HAVE_TIMES → const int
HAVE_TM_ZONE → const int
HAVE_TMPFILE → const int
HAVE_TMPNAM → const int
HAVE_TRUNCATE → const int
HAVE_UNAME → const int
HAVE_UNISTD_H → const int
HAVE_UNLINKAT → const int
HAVE_UNSETENV → const int
HAVE_UTIL_H → const int
HAVE_UTIME_H → const int
HAVE_UTIMENSAT → const int
HAVE_UTIMES → const int
HAVE_UUID_UUID_H → const int
HAVE_WAIT3 → const int
HAVE_WAIT4 → const int
HAVE_WAITID → const int
HAVE_WAITPID → const int
HAVE_WCHAR_H → const int
HAVE_WCSCOLL → const int
HAVE_WCSFTIME → const int
HAVE_WCSXFRM → const int
HAVE_WMEMCMP → const int
HAVE_WORKING_TZSET → const int
HAVE_WRITEV → const int
HAVE_X509_VERIFY_PARAM_SET1_HOST → const int
HAVE_ZLIB_COPY → const int
MAX_CO_EXTRA_USERS → const int
METH_CLASS → const int
METH_COEXIST → const int
METH_FASTCALL → const int
METH_KEYWORDS → const int
METH_NOARGS → const int
METH_O → const int
METH_STACKLESS → const int
METH_STATIC → const int
METH_VARARGS → const int
MVWDELCH_IS_EXPRESSION → const int
NOWAIT_LOCK → const int
PTHREAD_SYSTEM_SCHED_SUPPORTED → const int
Py_am_aiter → const int
Py_am_anext → const int
Py_am_await → const int
PY_BIG_ENDIAN → const int
Py_CLEANUP_SUPPORTED → const int
PY_COERCE_C_LOCALE → const int
PY_CTF_ALNUM → const int
PY_CTF_ALPHA → const int
PY_CTF_DIGIT → const int
PY_CTF_LOWER → const int
PY_CTF_SPACE → const int
PY_CTF_UPPER → const int
PY_CTF_XDIGIT → const int
Py_DTSF_ADD_DOT_0 → const int
Py_DTSF_ALT → const int
Py_DTSF_SIGN → const int
Py_DTST_FINITE → const int
Py_DTST_INFINITE → const int
Py_DTST_NAN → const int
PY_DWORD_MAX → const int
Py_EQ → const int
Py_eval_input → const int
Py_file_input → const int
PY_FORMAT_SIZE_T → const String
Py_func_type_input → const int
Py_GE → const int
Py_GT → const int
Py_HASH_ALGORITHM → const int
Py_HASH_CUTOFF → const int
Py_HASH_EXTERNAL → const int
Py_HASH_FNV → const int
Py_HASH_SIPHASH24 → const int
Py_HUGE_VAL → const double
Py_INVALID_SIZE → const int
PY_INVALID_STACK_EFFECT → const int
Py_LE → const int
PY_LITTLE_ENDIAN → const int
PY_LLONG_MAX → const int
PY_LLONG_MIN → const int
Py_LT → const int
PY_MAJOR_VERSION → const int
Py_MATH_E → const double
Py_MATH_El → const double
Py_MATH_PI → const double
Py_MATH_PIl → const double
Py_MATH_TAU → const double
PY_MICRO_VERSION → const int
PY_MINOR_VERSION → const int
Py_mod_create → const int
Py_mod_exec → const int
Py_mp_ass_subscript → const int
Py_mp_length → const int
Py_mp_subscript → const int
Py_NAN → const double
Py_nb_absolute → const int
Py_nb_add → const int
Py_nb_and → const int
Py_nb_bool → const int
Py_nb_divmod → const int
Py_nb_float → const int
Py_nb_floor_divide → const int
Py_nb_index → const int
Py_nb_inplace_add → const int
Py_nb_inplace_and → const int
Py_nb_inplace_floor_divide → const int
Py_nb_inplace_lshift → const int
Py_nb_inplace_matrix_multiply → const int
Py_nb_inplace_multiply → const int
Py_nb_inplace_or → const int
Py_nb_inplace_power → const int
Py_nb_inplace_remainder → const int
Py_nb_inplace_rshift → const int
Py_nb_inplace_subtract → const int
Py_nb_inplace_true_divide → const int
Py_nb_inplace_xor → const int
Py_nb_int → const int
Py_nb_invert → const int
Py_nb_lshift → const int
Py_nb_matrix_multiply → const int
Py_nb_multiply → const int
Py_nb_negative → const int
Py_nb_or → const int
Py_nb_positive → const int
Py_nb_power → const int
Py_nb_remainder → const int
Py_nb_rshift → const int
Py_nb_subtract → const int
Py_nb_true_divide → const int
Py_nb_xor → const int
Py_NE → const int
Py_PRINT_RAW → const int
PY_RELEASE_LEVEL → const int
PY_RELEASE_LEVEL_ALPHA → const int
PY_RELEASE_LEVEL_BETA → const int
PY_RELEASE_LEVEL_FINAL → const int
PY_RELEASE_LEVEL_GAMMA → const int
PY_RELEASE_SERIAL → const int
Py_single_input → const int
PY_SIZE_MAX → const int
Py_sq_ass_item → const int
Py_sq_concat → const int
Py_sq_contains → const int
Py_sq_inplace_concat → const int
Py_sq_inplace_repeat → const int
Py_sq_item → const int
Py_sq_length → const int
Py_sq_repeat → const int
PY_SSIZE_T_MAX → const int
PY_SSIZE_T_MIN → const int
PY_SSL_DEFAULT_CIPHERS → const int
PY_STDIOTEXTMODE → const String
PY_TIMEOUT_MAX → const int
Py_tp_alloc → const int
Py_tp_base → const int
Py_tp_bases → const int
Py_tp_call → const int
Py_tp_clear → const int
Py_tp_dealloc → const int
Py_tp_del → const int
Py_tp_descr_get → const int
Py_tp_descr_set → const int
Py_tp_doc → const int
Py_tp_finalize → const int
Py_tp_free → const int
Py_tp_getattr → const int
Py_tp_getattro → const int
Py_tp_getset → const int
Py_tp_hash → const int
Py_tp_init → const int
Py_tp_is_gc → const int
Py_tp_iter → const int
Py_tp_iternext → const int
Py_tp_members → const int
Py_tp_methods → const int
Py_tp_new → const int
Py_tp_repr → const int
Py_tp_richcompare → const int
Py_tp_setattr → const int
Py_tp_setattro → const int
Py_tp_str → const int
Py_tp_traverse → const int
Py_TPFLAGS_BASE_EXC_SUBCLASS → const int
Py_TPFLAGS_BASETYPE → const int
Py_TPFLAGS_BYTES_SUBCLASS → const int
Py_TPFLAGS_DEFAULT → const int
Py_TPFLAGS_DICT_SUBCLASS → const int
Py_TPFLAGS_HAVE_FINALIZE → const int
Py_TPFLAGS_HAVE_GC → const int
Py_TPFLAGS_HAVE_STACKLESS_EXTENSION → const int
Py_TPFLAGS_HAVE_VERSION_TAG → const int
Py_TPFLAGS_HEAPTYPE → const int
Py_TPFLAGS_IS_ABSTRACT → const int
Py_TPFLAGS_LIST_SUBCLASS → const int
Py_TPFLAGS_LONG_SUBCLASS → const int
Py_TPFLAGS_METHOD_DESCRIPTOR → const int
Py_TPFLAGS_READY → const int
Py_TPFLAGS_READYING → const int
Py_TPFLAGS_TUPLE_SUBCLASS → const int
Py_TPFLAGS_TYPE_SUBCLASS → const int
Py_TPFLAGS_UNICODE_SUBCLASS → const int
Py_TPFLAGS_VALID_VERSION_TAG → const int
PY_ULLONG_MAX → const int
Py_UNICODE_REPLACEMENT_CHARACTER → const int
Py_UNICODE_SIZE → const int
PY_VERSION → const String
PY_VERSION_HEX → const int
PyCF_ALLOW_TOP_LEVEL_AWAIT → const int
PyCF_COMPILE_MASK → const int
PyCF_DONT_IMPLY_DEDENT → const int
PyCF_MASK → const int
PyCF_MASK_OBSOLETE → const int
PyCF_ONLY_AST → const int
PyCF_SOURCE_IS_UTF8 → const int
PyCF_TYPE_COMMENTS → const int
PyLong_BASE → const int
PYLONG_BITS_IN_DIGIT → const int
PyLong_MASK → const int
PyLong_SHIFT → const int
PYOS_STACK_MARGIN → const int
PySet_MINSIZE → const int
PYTHON_ABI_STRING → const String
PYTHON_ABI_VERSION → const int
PYTHON_API_STRING → const String
PYTHON_API_VERSION → const int
PYTHREAD_INVALID_THREAD_ID → const int
PyTrash_UNWIND_LEVEL → const int
PyWrapperFlag_KEYWORDS → const int
SIZEOF__BOOL → const int
SIZEOF_DOUBLE → const int
SIZEOF_FLOAT → const int
SIZEOF_FPOS_T → const int
SIZEOF_INT → const int
SIZEOF_LONG → const int
SIZEOF_LONG_DOUBLE → const int
SIZEOF_LONG_LONG → const int
SIZEOF_OFF_T → const int
SIZEOF_PID_T → const int
SIZEOF_PTHREAD_KEY_T → const int
SIZEOF_PTHREAD_T → const int
SIZEOF_PY_HASH_T → const int
SIZEOF_PY_UHASH_T → const int
SIZEOF_SHORT → const int
SIZEOF_SIZE_T → const int
SIZEOF_TIME_T → const int
SIZEOF_UINTPTR_T → const int
SIZEOF_VOID_P → const int
SIZEOF_WCHAR_T → const int
STDC_HEADERS → const int
SYS_SELECT_WITH_SYS_TIME → const int
TIME_WITH_SYS_TIME → const int
TRACEMALLOC_FINALIZED → const int
TRACEMALLOC_INITIALIZED → const int
TRACEMALLOC_NOT_INITIALIZED → const int
VA_LIST_IS_ARRAY → const int
WAIT_LOCK → const int
WINDOW_HAS_FLAGS → const int
WITH_DECIMAL_CONTEXTVAR → const int
WITH_DOC_STRINGS → const int
WITH_DTRACE → const int
WITH_DYLD → const int
WITH_NEXT_FRAMEWORK → const int
WITH_PYMALLOC → const int

Properties

dartpyc DartPyC
Dynamic library
no setter
pyInitialized bool
Checks whether the python runtime was initialized
no setter
pyLibLocation String?
A variable to override the python dynamic library location on your computer
getter/setter pair

Functions

pyCleanup() → void
Cleans up the memory of the loaded modules
pyConvertBackDynamic(Pointer<PyObject> result) Object?
Convers a python object back to a dart representation
pyConvertDynamic(Object? o) PyObjAllocated<NativeType>
Converts a Dart object to the python equivalent
pyErrOccurred() bool
Checks whether an exception occured in python
pyImport(String module) DartPyModule
Loads a python module
pyStart() → void
Initializes the python runtime
pythonDylib() String

Typedefs

allocfunc = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<_typeobject>, Py_ssize_t)>>
binaryfunc = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<PyObject>, Pointer<PyObject>)>>
blkcnt_t = __darwin_blkcnt_t
blksize_t = __darwin_blksize_t
descrgetfunc = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<PyObject>, Pointer<PyObject>, Pointer<PyObject>)>>
descrsetfunc = Pointer<NativeFunction<Int Function(Pointer<PyObject>, Pointer<PyObject>, Pointer<PyObject>)>>
destructor = Pointer<NativeFunction<Void Function(Pointer<PyObject>)>>
dev_t = __darwin_dev_t
digit = Uint32
FILE = __sFILE
fpos_t = __darwin_off_t
freefunc = Pointer<NativeFunction<Void Function(Pointer<Void>)>>
getattrfunc = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<PyObject>, Pointer<Char>)>>
getattrofunc = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<PyObject>, Pointer<PyObject>)>>
getbufferproc = Pointer<NativeFunction<Int Function(Pointer<PyObject>, Pointer<Py_buffer>, Int)>>
getiterfunc = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<PyObject>)>>
getter = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<PyObject>, Pointer<Void>)>>
gid_t = __darwin_gid_t
hashfunc = Pointer<NativeFunction<Py_hash_t Function(Pointer<PyObject>)>>
initproc = Pointer<NativeFunction<Int Function(Pointer<PyObject>, Pointer<PyObject>, Pointer<PyObject>)>>
inquiry = Pointer<NativeFunction<Int Function(Pointer<PyObject>)>>
iternextfunc = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<PyObject>)>>
lenfunc = Pointer<NativeFunction<Py_ssize_t Function(Pointer<PyObject>)>>
mode_t = __darwin_mode_t
newfunc = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<_typeobject>, Pointer<PyObject>, Pointer<PyObject>)>>
objobjargproc = Pointer<NativeFunction<Int Function(Pointer<PyObject>, Pointer<PyObject>, Pointer<PyObject>)>>
objobjproc = Pointer<NativeFunction<Int Function(Pointer<PyObject>, Pointer<PyObject>)>>
off_t = __darwin_off_t
pthread_key_t = __darwin_pthread_key_t
Py_buffer = bufferinfo
Py_hash_t = Py_ssize_t
Py_ssize_t = ssize_t
Py_tracefunc = Pointer<NativeFunction<Int Function(Pointer<PyObject>, Pointer<_frame>, Int, Pointer<PyObject>)>>
Py_tss_t = _Py_tss_t
Py_UCS4 = Uint32
Py_UNICODE = WChar
PyAddrPair = _addr_pair
PyArena = _arena
PyCapsule_Destructor = Pointer<NativeFunction<Void Function(Pointer<PyObject>)>>
PyCFunction = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<PyObject>, Pointer<PyObject>)>>
PyInterpreterState = _is
PyLongObject = _longobject
PyObject = _object
PyOS_sighandler_t = Pointer<NativeFunction<Void Function(Int)>>
PyThread_type_lock = Pointer<Void>
PyThreadState = _ts
PyTypeObject = _typeobject
PyWeakReference = _PyWeakReference
releasebufferproc = Pointer<NativeFunction<Void Function(Pointer<PyObject>, Pointer<Py_buffer>)>>
reprfunc = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<PyObject>)>>
richcmpfunc = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<PyObject>, Pointer<PyObject>, Int)>>
setattrfunc = Pointer<NativeFunction<Int Function(Pointer<PyObject>, Pointer<Char>, Pointer<PyObject>)>>
setattrofunc = Pointer<NativeFunction<Int Function(Pointer<PyObject>, Pointer<PyObject>, Pointer<PyObject>)>>
setter = Pointer<NativeFunction<Int Function(Pointer<PyObject>, Pointer<PyObject>, Pointer<Void>)>>
ssize_t = __darwin_ssize_t
ssizeargfunc = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<PyObject>, Py_ssize_t)>>
ssizeobjargproc = Pointer<NativeFunction<Int Function(Pointer<PyObject>, Py_ssize_t, Pointer<PyObject>)>>
ternaryfunc = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<PyObject>, Pointer<PyObject>, Pointer<PyObject>)>>
time_t = __darwin_time_t
traverseproc = Pointer<NativeFunction<Int Function(Pointer<PyObject>, visitproc, Pointer<Void>)>>
uid_t = __darwin_uid_t
unaryfunc = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<PyObject>)>>
vectorcallfunc = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<PyObject> callable, Pointer<Pointer<PyObject>> args, Size nargsf, Pointer<PyObject> kwnames)>>
visitproc = Pointer<NativeFunction<Int Function(Pointer<PyObject>, Pointer<Void>)>>
wrapperfunc = Pointer<NativeFunction<Pointer<PyObject> Function(Pointer<PyObject> self, Pointer<PyObject> args, Pointer<Void> wrapped)>>

Exceptions / Errors

DartPyException
A dart exception wrapping a python exception