PScript
PScript is a Python to JavaScript compiler, and is also the name of the subset of Python that this compiler supports. It was originally developed as a part of Flexx and is now a project on its own.
Installation
PScript is pure Python and requires Python 3.6+ (including Pypy). It has no further dependencies.
pip install pscript
Short example
from pscript import py2js
def foo(a, b=2):
print(a - b)
print(py2js(foo))
Gives:
var foo;
foo = function flx_foo (a, b) {
b = (b === undefined) ? 2: b;
console.log((a - b));
return null;
};
Supported browsers
PScript aims to support all modern browsers, including Firefox, Chrome and Edge.
Internet Explorer is in principal supported from version 9, though some constructs
(e.g. async and await) do not work in Internet Explorer.
PScript in the wild
To give an idea of what PScript can do, here are some examples in the wild:
- Obviously, everything built in Flexx uses PScript, see e.g. these examples
- The front-end of TimeTagger.app is built in Python using PScript.
Let us know if you know more!
License
PScript makes use of the liberal 2-clause BSD license. See LICENSE for details.
Metadata
Release files for pscript 0.8.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pscript-0.8.1.tar.gz | 104.6 kB | Without provenance | Details for pscript-0.8.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pscript-0.8.1-py3-none-any.whl | Python 3 | none | any | Details for pscript-0.8.1-py3-none-any.whl |
Total release size: 168.1 kB
Release files / pscript-0.8.1.tar.gz
| Download URL | pscript-0.8.1.tar.gz |
|---|---|
| Size | 104.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d3858bf9b34454af8018c7eab832c2f4aaf54f878d7e40f3131ff6dd634bcdfd
|
|
BLAKE2b-256 checksum How to use checksums |
682e73709f4b3ec5c7f3b73a468fe2c1a6fb40e4371ae2921a306c1c53002109
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.33.0
|
Release files / pscript-0.8.1-py3-none-any.whl
| Download URL | pscript-0.8.1-py3-none-any.whl |
|---|---|
| Size | 63.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bbae5fa9d585b3dc3f9fa3a5ddeb1e634cbdc90bd9637d082de015e25358c794
|
|
BLAKE2b-256 checksum How to use checksums |
88facfe3fe748610a3efecb4487d2e86dcbf7d35cc0d6ba8b8eb8e8bc9c6d537
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.33.0
|
Security for pscript 0.8.1
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.