{"id":13484292,"url":"https://github.com/doloopwhile/PyExecJS","last_synced_at":"2025-03-27T16:30:39.541Z","repository":{"id":2062185,"uuid":"3000622","full_name":"doloopwhile/PyExecJS","owner":"doloopwhile","description":"Run JavaScript code from Python (EOL: https://gist.github.com/doloopwhile/8c6ec7dd4703e8a44e559411cb2ea221)","archived":true,"fork":false,"pushed_at":"2020-04-04T06:49:05.000Z","size":154,"stargazers_count":705,"open_issues_count":9,"forks_count":112,"subscribers_count":26,"default_branch":"master","last_synced_at":"2024-10-30T00:36:05.216Z","etag":null,"topics":["python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doloopwhile.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-12-17T10:38:24.000Z","updated_at":"2024-10-15T02:22:01.000Z","dependencies_parsed_at":"2022-08-29T02:41:18.526Z","dependency_job_id":null,"html_url":"https://github.com/doloopwhile/PyExecJS","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doloopwhile%2FPyExecJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doloopwhile%2FPyExecJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doloopwhile%2FPyExecJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doloopwhile%2FPyExecJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doloopwhile","download_url":"https://codeload.github.com/doloopwhile/PyExecJS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245882217,"owners_count":20687852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python"],"created_at":"2024-07-31T17:01:21.989Z","updated_at":"2025-03-27T16:30:39.195Z","avatar_url":"https://github.com/doloopwhile.png","language":"Python","readme":"PyExecJS (EOL)\n==============\n[![Build Status](https://travis-ci.org/doloopwhile/PyExecJS.svg?branch=travis-ci)](https://travis-ci.org/doloopwhile/PyExecJS)\n\n# End of life\n\nThis library is no longer maintananced ([Reason](https://gist.github.com/doloopwhile/8c6ec7dd4703e8a44e559411cb2ea221)).\nBugs are not be fixed (even if they are trivial or essential).\n\nWe suggest to use other library or to make a fork.\n\n---\n\nRun JavaScript code from Python.\n\nPyExecJS is a porting of ExecJS from Ruby.\nPyExecJS **automatically** picks the best runtime available to evaluate your JavaScript program.\n\nA short example:\n\n    \u003e\u003e\u003e import execjs\n    \u003e\u003e\u003e execjs.eval(\"'red yellow blue'.split(' ')\")\n    ['red', 'yellow', 'blue']\n    \u003e\u003e\u003e ctx = execjs.compile(\"\"\"\n    ...     function add(x, y) {\n    ...         return x + y;\n    ...     }\n    ... \"\"\")\n    \u003e\u003e\u003e ctx.call(\"add\", 1, 2)\n    3\n\n# Supported runtimes\n\n## First-class support (runtime class is provided and tested)\n\n* [PyV8](http://code.google.com/p/pyv8/) - A python wrapper for Google V8 engine,\n* [Node.js](http://nodejs.org/)\n* [PhantomJS](http://phantomjs.org/)\n* [Nashorn](http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/intro.html#sthref16) - Included with Oracle Java 8\n\n## Second-class support (runtime class is privided but not tested)\n\n* Apple JavaScriptCore - Included with Mac OS X\n* [Microsoft Windows Script Host](http://msdn.microsoft.com/en-us/library/9bbdkx3k.aspx) (JScript)\n* [SlimerJS](http://slimerjs.org/)\n* [Mozilla SpiderMonkey](http://www.mozilla.org/js/spidermonkey/)\n\n# Installation\n\n    $ pip install PyExecJS\n\nor\n\n    $ easy_install PyExecJS\n\n# Details\n\nIf `EXECJS_RUNTIME` environment variable is specified, PyExecJS pick the JavaScript runtime as a default:\n\n    \u003e\u003e\u003e execjs.get().name # this value is depends on your environment.\n    \u003e\u003e\u003e os.environ[\"EXECJS_RUNTIME\"] = \"Node\"\n    \u003e\u003e\u003e execjs.get().name\n    'Node.js (V8)'\n\nYou can choose JavaScript runtime by `execjs.get()`:\n\n    \u003e\u003e\u003e default = execjs.get() # the automatically picked runtime\n    \u003e\u003e\u003e default.eval(\"1 + 2\")\n    3\n    \u003e\u003e\u003e import execjs.runtime_names\n    \u003e\u003e\u003e jscript = execjs.get(execjs.runtime_names.JScript)\n    \u003e\u003e\u003e jscript.eval(\"1 + 2\")\n    3\n    \u003e\u003e\u003e import execjs.runtime_names\n    \u003e\u003e\u003e node = execjs.get(execjs.runtime_names.Node)\n    \u003e\u003e\u003e node.eval(\"1 + 2\")\n    3\n\nThe pros of PyExecJS is that you do not need take care of JavaScript environment.\nEspecially, it works in Windows environment without installing extra libraries.\n\nOne of cons of PyExecJS is performance. PyExecJS communicate JavaScript runtime by text and it is slow.\nThe other cons is that it does not fully support runtime specific features.\n\n[PyV8](https://code.google.com/p/pyv8/) might be better choice for some use case.\n\n# License\n\nCopyright (c) 2016 Omoto Kenji.\nCopyright (c) 2011 Sam Stephenson and Josh Peek. (As a author of ExecJS)\n\nReleased under the MIT license. See `LICENSE` for details.\n\n# Changelog\n\n## 1.5.0\n- Eased version requirement for six.\n\n## 1.4.1\n- Fixed arguments of module-level functions.\n- Fixed bug of execution with pipe.\n- Fixed wrong excption is raised.\n\n## 1.4.0\n- Fixed required libraries.\n- Fixed order of output of `--print-available-runtimes`.\n- Execute some JavaScript runtime with pipe/stdin (without temporary file).\n\n## 1.3.1\n- Fixed `--print-available-runtimes` fails in Python 2.7.\n\n## 1.3.0\n- Added `cwd` argument.\n\n## 1.2.0\n- Supported Python 3.5\n- Supported Nashorn(Java 8 JavaScript engine) as runtime\n- Dropped support for Python 2.6 and 3.2\n\n## 1.1.0\n- Supported Python 3.4\n- Supported SlimerJS as runtime\n- Supported PhantomJS as runtime\n- Fixed JScript runtime on Windows 8\n\n## 1.0.5\n- Supported Python 3.3\n- Fixed file handle leaking\n- Fixed issue with passenger-nginx-4.0\n\n## 1.0.4\n- Removed \"import execjs\" (it prevent execution of setup.py by Python 2.6)\n\n## 1.0.3\n- Javascript sources were embeded in __init__.py. 'which' command were reimplemented by pure python.\n\n## 1.0.2\n- Python 2.6.x was supported.\n\n## 1.0.1\n- Forgotten shell=True was added to Popen.\n\n## 1.0.0\n- First release.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoloopwhile%2FPyExecJS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoloopwhile%2FPyExecJS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoloopwhile%2FPyExecJS/lists"}