Minimal, modern embedded V8 for Python.
Project description
Minimal, modern embedded V8 for Python.
Free software: ISC license
Features
Unicode support
Thread safe
Re-usable contexts
Binary object is Python agnostic
MiniRacer can be easily used by Django or Flask projects to minify assets, run babel or compile CoffeeScript.
Examples
py_mini_racer is straightforward to use:
>>> from py_mini_racer import py_mini_racer
>>> ctx = py_mini_racer.MiniRacer()
>>> ctx.eval('1+1')
2
>>> ctx.eval("var x = {company: 'Sqreen'}; x.company")
u'Sqreen'
>>> print ctx.eval(u"'\N{HEAVY BLACK HEART}'")
❤
>>> ctx.eval("var fun = () => ({ foo: 1 });")
>>> ctx.call("fun")
{u'foo': 1}
Variables are kept inside of a context:
>>> ctx.eval("x.company")
u'Sqreen'
[1,2,3].map(n => n + 1);
Compatibility
PyMiniRacer is only compatible with Python 2.7 at the moment. Python 3 support is on its way.
Binary builds availability
The PyMiniRacer binary builds have been tested on x86_64 with: * OSX 10.11 * Ubuntu >= 14.04 * Debian >= 8 * CentOS >= 7
It should work on any Linux with a libc >= 2.17.
Installation
We built Python wheels (prebuilt binaries) for OSX 64 bits and Linux 64 bits - most recent distributions. You need pip >= 1.4 and setuptools >= 0.8.
$ pip install py-mini-racer
Build
You can build v8 with the command:
$ python setup.py build_v8
You can also build the ctype extension:
$ python setup.py build_ext
Which automatically builds v8.
You can generate a wheel with the command:
$ python setup.py bdist_wheel
which builds v8, the extension, and generates a wheel.
Tests
If you want to run the tests, you need to build V8 first, then launch:
$ python setup.py test --addopts tests
Credits
Built with love by Sqreen.
PyMiniRacer is inspired by mini_racer, built for the Ruby world by Sam Saffron.
Tools used in rendering this package:
Todo
Lower libc version needed. Export V8 version. Fix circular structures export.
History
0.1.1 (2016-08-02)
Fix sdist distribution.
0.1.0 (2016-08-01)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_mini_racer-0.1.1.tar.gz.
File metadata
- Download URL: py_mini_racer-0.1.1.tar.gz
- Upload date:
- Size: 323.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a22a5d77814987327fb82acfb38cc7a24a552bed639bf2072a22bd85481a21a2
|
|
| MD5 |
e8695f6333503ad229883aeca39528cf
|
|
| BLAKE2b-256 |
347b267dc4934d774c59c1024afa8af8c90da813e1917af606a7a62281f30f52
|
File details
Details for the file py_mini_racer-0.1.1-cp35-cp35m-macosx_10_11_x86_64.whl.
File metadata
- Download URL: py_mini_racer-0.1.1-cp35-cp35m-macosx_10_11_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.5m, macOS 10.11+ x86-64
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af77d8613ffce6f5633ac8c7e68db417c82bd1447090305d9cfd391a779f67ad
|
|
| MD5 |
17bb372ff1609a8395e711872f107e3b
|
|
| BLAKE2b-256 |
4ecd338b6b85103170243b77bb76a3a85de12172b9644ba2d9f8964435f0a236
|
File details
Details for the file py_mini_racer-0.1.1-cp27-cp27mu-manylinux1_x86_64.whl.
File metadata
- Download URL: py_mini_racer-0.1.1-cp27-cp27mu-manylinux1_x86_64.whl
- Upload date:
- Size: 5.0 MB
- Tags: CPython 2.7mu
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c46c5a1279bdf3df1b7fdb99e73bd29aa591c2c4e955babbe0d1aa16bd37950b
|
|
| MD5 |
26c57dc28587fe6d3ca59d070e41af29
|
|
| BLAKE2b-256 |
128b86b6d3e4de96f7849fd0c5355667461ae32b163f9276aa077db3bc249e20
|
File details
Details for the file py_mini_racer-0.1.1-cp27-cp27m-macosx_10_11_x86_64.whl.
File metadata
- Download URL: py_mini_racer-0.1.1-cp27-cp27m-macosx_10_11_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 2.7m, macOS 10.11+ x86-64
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52d808334cc2ba28046d2dfb18039ad7b894039c52a035407c3cd8f31dfc2922
|
|
| MD5 |
fc2db7b4463bdf6a890fe0f192661ed8
|
|
| BLAKE2b-256 |
3a4f9ad69453e3c8cb0108074563b037b18cdfc81320fa05c7fb5c30fb208bde
|