esx
JS API in python 3!
Contains
• js API in python 3
(A downsteam of the domonic js API)
API
from esx.javascript import Math
print(Math.random())
from esx.javascript import Array
myArr=Array(1,2,3)
print(myArr.splice(1))
from esx.javascript import URL
url = URL('https://somesite.com/blog/article-one#some-hash')
print(url.protocol)
print(url.host)
print(url.pathname)
print(url.hash)
# you can use Global class to import all the js methods from the global namespace i.e
# from esx.javascript.esx import Global
# Global.decodeURIComponent(...
# Global.encodeComponent(...
# Global.setInterval(...
# from esx.javascript.esx import Date, String, Number
# etc..
You can use setInterval and clearInterval with params
from esx.javascript import setInterval, clearInterval
x=0
def hi(inc):
global x
x = x+inc
print(x)
test = setInterval(hi, 1000, 2)
import time
time.sleep(5)
clearInterval(test)
print(f"Final value of x:{x}")
Or for a single delayed function call use setTimeout, clearTimeout
from esx.javascript import setTimeout, clearTimeout
timeoutID = setTimeout(hi, 1000)
DOCS
notes
currently forking over from domonic.
Join-In
Feel free to contribute if you find it useful.
Email me, message me directly if you like or create a discussion on here.
If there are any methods you want that are missing or not complete yet or you think you can help make it better just update the code and send a pull request.
I'll merge and releaese asap.
run tests
There are tests used during dev. They are useful as code examples and to see what still needs doing.
See Makefile to run all tests:
make test
or to test a single function:
python -m unittest tests.test_esx.TestCase.test_esx_array
or to test a whole module
python -m unittest tests.test_esx
to see coverage
coverage run -m unittest discover tests/
coverage report
Metadata
Release files for esx 0.0.4
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 | |
|---|---|---|---|---|
| esx-0.0.4.tar.gz | 11.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| esx-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.6 kB
Release files / esx-0.0.4.tar.gz
| Download URL | esx-0.0.4.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cce766ec90bd9c3f96c8123e9f29ba34fdd31752a1a0fd22dc8a365de0d0e5c7
|
|
BLAKE2b-256 checksum How to use checksums |
83d73cb0e805b871894c990910e3664432a3c4eaa6546e392410e14c78bdf1f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|
Release files / esx-0.0.4-py3-none-any.whl
| Download URL | esx-0.0.4-py3-none-any.whl |
|---|---|
| Size | 2.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
32ba8008a705a0d2b347e52f6a58db21cbd4e77a89a262629eb59212ecce4a3a
|
|
BLAKE2b-256 checksum How to use checksums |
947f213c722fe9914d5bfa0bb1d3ccc25ec8b84279f72ff95bc701c887c0c54f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|
Security for esx 0.0.4
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.