Metadata-Version: 2.4
Name: pykal
Version: 0.1.1
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: description
Dynamic: description-content-type
Dynamic: license-file

# PyKal

This repository contains source code for PyKal, which is the official bindings library to embed Kal into Python via `libkal`.

Installation:

```bash
$ pip3 install pykal
```

You must have `libkal.so` compiled and installed on your system for PyKal to function. Follow [instructions](https://kal-lang.vercel.app/docs/install) for installation.


Usage Example:

```python
from pykal import Kal

kal = Kal()

result = kal.exec(
    """
        var data = $data.

        len data -> size.
        first data -> f.
        last data -> l.
        var m = data[(size / 2) as int].

        <- [f, m, l].
    """,
    {
        'data': [1, 2, 3, 4, 5]
    {
)

print('Return Value:', result, '\n')

for r in result.to_list():
    print(r, r.to_number())
```
