Skip to main content

Python extension that interacts with the J language

Project description

https://github.com/zhihaoy/jsource/raw/jruntime-pyd/docs/source/_static/jpyd.png

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


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

jruntime-0.2.0.post1-cp38-cp38-win_amd64.whl (1.7 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

jruntime-0.2.0.post1-cp38-cp38-manylinux_2_24_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.24+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page