This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A Python port of [Esprima][1], the JavaScript parser.

Why shouldn’t I use it?

It’s pretty slow – about two orders of magnitude slower to parse a 116k JS file. The code was semi-automatically translated from JavaScript, and it does a lot of string appending, which is fast in JS but slow in Python.

Why should I use it?

Shelling out to a NodeJS process is likely to be a better way to use Esprima from Python. However, writing the interprocess data-marshaling code is a bit annoying, so if you want to do a quick hack on small amounts of data, PyEsprima is a good way to get down to business. The API is exactly the same, so you can easily swap in an interface to the external Node process later on.

Also, since the code is semi-automatically translated using [js2py][2], it’s pretty easy to keep up-to-date. You could even do it yourself. Don’t fear the bit rot!

API

Pretty much the same as Esprima’s / SpiderMonkey’s API:

>>> import pyesprima

>>> print pyesprima.tokenize("1 + 1")
[{'type': 'Numeric', 'value': '1'},
 {'type': 'Punctuator', 'value': '+'},
 {'type': 'Numeric', 'value': '1'}]

>>> pyesprima.parse("1 + 1", loc=True)
{'body': [{'type': 'ExpressionStatement', 'expression': {'operator': '+',
'loc': {'start': {'column': 0, 'line': 1}, 'end': ...

Installing

pip install pyesprima

[1]: http://esprima.org/ [2]: https://github.com/int3/js2py

Release History

Release History

1.0.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pyesprima-1.0.0.tar.gz (21.7 kB) Copy SHA256 Checksum SHA256 Source Jul 2, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting