Skip to main content

V8Py

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

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

Support

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

Installation

$ 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

https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg

Metadata

Release files for v8py 0.9.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for v8py 0.9.15
File Size Uploaded Provenance Actions
v8py-0.9.15.tar.gz 45.7 kB Without provenance Details for v8py-0.9.15.tar.gz

Release files / v8py-0.9.15.tar.gz

Download URL v8py-0.9.15.tar.gz
Size 45.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bb1f601798c27ede694a24a2fb83af7b863adaa7dd684111bc22ff3075014b10
BLAKE2b-256 checksum
How to use checksums
49caa37d8be30f9dce8713e7c90a6a2582dd2b590f1f54d233a2d5965c4b3940
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.14

Security for v8py 0.9.15

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page