Python extension that interacts with the J language
Project description
jruntime is a modern Python extension that interacts with the J language. It provides deep integration between Python and J in the following ways:
Takes over J engine I/O with Python I/O
Maps between J arrays and NumPy ndarrays, J boxes and Python tuples
Binds J nouns to lexical scopes using Python with statements
Handles J errors using Python exceptions
Emits the complete API document in help(jruntime)
Getting Started
Install jruntime and NumPy from PyPI:
pip install jruntime numpy
Now you can run J code and read data in NumPy arrays:
>>> import jruntime
>>> j = jruntime.Session()
>>> j.runsource('v =: 3 4 $ i.12')
>>> j['v']
array([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11]], dtype=int64)
Or put Python data in J and run code that uses it:
>>> with j.let(title='Price', v=[.99, 1.48, 0.26]):
... j.runsource('title;+/ v')
+-----+----+
|Price|2.73|
+-----+----+
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for jruntime-0.2.0.post1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 235371d08e689b06f5fe08b2249c022926e6c8f6187fe48b8f7b11ca1654025b |
|
MD5 | a8ef5d830cd58315fbb28a558a0c9b6f |
|
BLAKE2b-256 | 93da2c5fc5de9bcfd28767e140adecd80056838160d297fa798c35e3d75ed144 |
Close
Hashes for jruntime-0.2.0.post1-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6b220ca3fe0b563615d7f9e160ef03911d27bf6e5c12c35d6624da866cd8128 |
|
MD5 | 4d00a7293f58f353b75da3cb44d29568 |
|
BLAKE2b-256 | ab9382ea763d2f8ba89272cb8da05914e2d46827ef54d536e2c3c08e062edca5 |