All Projects → tbodt → V8py

tbodt / V8py

Licence: lgpl-3.0
Write Python APIs, then call them from JavaScript using the V8 engine.

Programming Languages

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

Labels

Projects that are alternatives of or similar to V8py

V8Android
A demo APP for embedding V8 engine in Android APP
Stars: ✭ 45 (-88.72%)
Mutual labels:  v8
Fibjs
JavaScript on Fiber (built on Chrome's V8 JavaScript engine)
Stars: ✭ 2,880 (+621.8%)
Mutual labels:  v8
Jk
Configuration as Code with ECMAScript
Stars: ✭ 322 (-19.3%)
Mutual labels:  v8
object-shape
Get a description of a JS object's shape.
Stars: ✭ 24 (-93.98%)
Mutual labels:  v8
Go V8
Go binding for v8
Stars: ✭ 255 (-36.09%)
Mutual labels:  v8
Web Tooling Benchmark
JavaScript benchmark for common web developer workloads
Stars: ✭ 290 (-27.32%)
Mutual labels:  v8
browser-exploitation
A collection of curated resources and CVEs I use for research.
Stars: ✭ 71 (-82.21%)
Mutual labels:  v8
Javascript Idiosyncrasies
A bunch of Javascript idiosyncrasies to beginners.
Stars: ✭ 353 (-11.53%)
Mutual labels:  v8
Javascriptengineswitcher
JavaScript Engine Switcher determines unified interface for access to the basic features of popular JavaScript engines (ChakraCore, Jering.Javascript.NodeJS, Jint, Jurassic, MSIE JavaScript Engine for .NET, NiL.JS, Microsoft ClearScript.V8 and VroomJs). This library allows you to quickly and easily switch to using of another JavaScript engine.
Stars: ✭ 265 (-33.58%)
Mutual labels:  v8
V8.js.cn
V8 官方网站中文翻译
Stars: ✭ 308 (-22.81%)
Mutual labels:  v8
rust rewrite
A programming environment that aims to help people learn how to program in JavaScript, while giving them a tour on how old computers and their limitations used to be.
Stars: ✭ 26 (-93.48%)
Mutual labels:  v8
v8go-polyfills
Add polyfills to rogchap/v8go
Stars: ✭ 25 (-93.73%)
Mutual labels:  v8
Little Javascript Book
Early draft for The Little JavaScript Book
Stars: ✭ 305 (-23.56%)
Mutual labels:  v8
pdjs
JavaScript External for Pure Data based on V8
Stars: ✭ 45 (-88.72%)
Mutual labels:  v8
Memeye
👀 The eye of memory. A lightweight memory monitor and dashboard for Node.js application on development.
Stars: ✭ 332 (-16.79%)
Mutual labels:  v8
Framework
Advanced modding framework for multiplayer modifications
Stars: ✭ 21 (-94.74%)
Mutual labels:  v8
Dvm
Deno Version Manager - Easy way to manage multiple active deno versions.
Stars: ✭ 271 (-32.08%)
Mutual labels:  v8
Deep Into Node
深入理解Node.js:核心思想与源码分析
Stars: ✭ 4,005 (+903.76%)
Mutual labels:  v8
V8eval
Multi-language bindings to JavaScript engine V8
Stars: ✭ 332 (-16.79%)
Mutual labels:  v8
Webrtc Tutorial
📚 WebRTC 中文教程
Stars: ✭ 305 (-23.56%)
Mutual labels:  v8

V8Py

Write Python APIs, then call them from JavaScript using the V8 engine.

.. code-block:: python

>>> from v8py import Context
>>> context = Context()

>>> def print_hello():
...     print 'Hello, world!'
>>> context.expose(print_hello)
>>> context.eval('print_hello()')
Hello, world!

>>> class Greeter(object):
...     def greet(self, thing):
...         print 'Welcome, {}!'.format(thing)
>>> context.expose(Greeter)
>>> context.eval('g = new Greeter()')
>>> context.eval('g.greet("V8Py")')
Welcome, V8Py!

That kind of thing.

Almost everything you'd expect to work just works, including:

  • Functions
  • Classes (including old style classes, because I can)
  • Inheritance (from the last base class, other base classes are treated as mixins)
  • Data descriptors
  • Static methods and class methods
  • Exceptions (they even subclass from Error!)
  • Fully meme-compliant <https://github.com/tbodt/v8py/blob/master/v8py/kappa.h>_

Support

Linux, Mac is supported for both python2 and python3. Windows is also supported, but for python3 only.

Installation

.. code-block:: bash

$ pip install v8py

Heads up: it'll be stuck at "Running setup.py install for v8py" for literally hours. It's downloading and building V8, which is a really big program. If you want to contribute scripts for Travis CI to build and upload wheels for Mac/Linux, please do so.

Misc

There is no documentation of any of this yet. No docstrings. The best place to look to find out how to use it is the tests.

I'm writing this so I can create a really lightweight special-purpose webdriver (no visual rendering, no asynchronous XHRs), and I need some way of implementing the DOM in Python. So there will definitely be enough functionality for that.

If you'd like to use it for something else, by all means go ahead, but you may find something that doesn't quite "just work", or works kind of strangely, or just stuff I forgot to test. If you find anything, please submit an issue. Or, even better, send a pull request.

Last but not least, don't forget to

.. image:: https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg :target: https://saythanks.io/to/tbodt

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].