All Projects → zhengrenzhe → PyChakra

zhengrenzhe / PyChakra

Licence: MIT License
🔥✨🚀Python binding to Microsoft Chakra JavaScript Engine.

Programming Languages

python
139335 projects - #7 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to PyChakra

Chakracore
ChakraCore is an open source Javascript engine with a C API.
Stars: ✭ 8,600 (+31751.85%)
Mutual labels:  runtime, chakra, chakracore
Corium
Corium is a modern scripting language which combines simple, safe and efficient programming.
Stars: ✭ 18 (-33.33%)
Mutual labels:  runtime
component-runtime
Talend Component Kit (implementation repository)
Stars: ✭ 22 (-18.52%)
Mutual labels:  runtime
AppRun
AppDir runtime components
Stars: ✭ 19 (-29.63%)
Mutual labels:  runtime
JqueryDataTablesServerSideDemo
Jquery DataTables with Asp.Net Core server side multi column sorting and searching Demo Project.
Stars: ✭ 43 (+59.26%)
Mutual labels:  runtime
cabasa
Haxe Framework for WebAssembly
Stars: ✭ 30 (+11.11%)
Mutual labels:  runtime
ChakraSharp
Mono/.NET bindings for ChakraCore
Stars: ✭ 13 (-51.85%)
Mutual labels:  chakra
SharpLoader
🔮 [C#] Source code randomizer and compiler
Stars: ✭ 36 (+33.33%)
Mutual labels:  runtime
substrate-tcr
A Parity Substrate runtime implementation of a simple Token Curated Registry (TCR)
Stars: ✭ 45 (+66.67%)
Mutual labels:  runtime
maps-app-dotnet
Your organization's suite of cross platform mapping apps built with the ArcGIS Runtime SDK for .NET
Stars: ✭ 20 (-25.93%)
Mutual labels:  runtime
data-collection-ios
Mobile data collection app using the iOS Runtime SDK.
Stars: ✭ 24 (-11.11%)
Mutual labels:  runtime
dxx
Windows Kernel Driver with C++ runtime
Stars: ✭ 128 (+374.07%)
Mutual labels:  runtime
ts-browser
🦄 Compile (in worker threads) and run TypeScript in the browser via <script type='text/typescript'>
Stars: ✭ 49 (+81.48%)
Mutual labels:  runtime
CJMethodLog
Objective-C 函数日志监听系统,可监听任意类,任意类的任意方法的调用日志。
Stars: ✭ 26 (-3.7%)
Mutual labels:  runtime
typesentry
Python 2.7 & 3.5+ runtime type-checker
Stars: ✭ 19 (-29.63%)
Mutual labels:  runtime
aegis-host
This is the ÆGIS federated application host. Federated components are independently deployable, written by multiple teams in multiple languages, and loaded from multiple repos and network locations at runtime, yet capable of running together in a single process or as distributed components in the ÆGIS application fabric.
Stars: ✭ 197 (+629.63%)
Mutual labels:  runtime
openjdk-runtime
Google Cloud Platform OpenJDK Docker image
Stars: ✭ 58 (+114.81%)
Mutual labels:  runtime
purity-ui-dashboard
Purity UI Dashboard - Free and Open Source Chakra UI Dashboard
Stars: ✭ 253 (+837.04%)
Mutual labels:  chakra
ph-commons
Java 1.8+ Library with tons of utility classes required in all projects
Stars: ✭ 23 (-14.81%)
Mutual labels:  runtime
therapi-runtime-javadoc
Read Javadoc comments at run time.
Stars: ✭ 50 (+85.19%)
Mutual labels:  runtime

PyChakra

Github Build Status LICENSE VERSION DL

PyChakra is a Python binding to Microsoft Chakra(v1.11.16) Javascript engine.

Chakra is a modern JavaScript engine for Microsoft Edge, it support 96% ES6 feature, Complete info see https://kangax.github.io/compat-table/es6/

Installation

pip install PyChakra

Usage

from PyChakra import Runtime

# create runtime instance
runtime = Runtime()

# eval JavaScript code
runtime.eval("(() => 2)();") # (True, 2)
runtime.eval("(() => a)();") # (False, "ReferenceError: 'a' is not defined")

# set or get variable
runtime.set_variable("foo", "'bar'") # True
runtime.get_variable("foo") # 'bar'

API

eval(js_string)

Eval JavaScript code string.

Parameters:

  • js_string: str: JavaScript code string

Returns: (is_successful: bool, result: any)

  • is_successfully: indicates whether JavaScript is running successfully.
  • result:
    • if s is True, result is the JavaScript running return value.
    • if is_successfully is False and result is string, result is the JavaScript running exception.
    • if is_successfully is False and result is number, result is the chakra internal error code. see(github)

set_variable(variable_name: str, variable_value: any)

Set variable in global scope.

Parameters:

  • variable_name: str: JavaScript variable name.
  • variable_value: str: JavaScript variable value in Python str.

Returns: same as eval

get_variable(variable_name: str)

Get variable in global scope.

Parameters:

  • variable_name: str: JavaScript variable name.

Returns: variable_value: str

  • if returns value is None, it indicates there is no variable_name in the global scope.

Supports

  • Python2 >= 2.7
  • Python3 >= 3.4

Platform

  • macOS x64
  • Linux x64
  • Windows x86/x64 (tested on Windows 10 x64, Python 3.7)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].