Metadata-Version: 2.3
Name: calciumpy
Version: 0.4.4
Summary: A Calcium language interpreter
Keywords: calcium,interpreter,json
Author: Roki Turner
Author-email: Roki Turner <roki@0xcaf2.dev>
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Project-URL: Homepage, https://github.com/0xCAF2/calciumpy
Description-Content-Type: text/markdown

# calciumpy

Run JSON like code in Python.

## How to install

```bash
pip install calciumpy
```

or

```bash
pip3 install calciumpy
```

## About Calcium language

[Calcium is a programming language](https://0xcaf2.dev/docs/calcium)
that takes a JSON array as input.
*calciumpy* is interoperable with the Python language,
allowing you to utilize Python's standard libraries and more.
It is primarily designed as a subset of Python.

## How to create the interpreter and run code

```python
from calciumpy import Runtime

# Calcium code is given as JSON arrays.
calcium_code = [
  [1, [], "#", "0.4.4"],
  [1, [], "expr", ["call", ["var", "print"], ["Hello, World."]]],
  [1, [], "end"],
]

# The Runtime executes Calcium code.
r = Runtime(calcium_code)
r.run()  # outputs 'Hello, World.'
```

The JSON code above corresponds to the following Python code:

```python
print("Hello, World.")
```

## Applications of calciumpy

[Calcium Editor](https://caed.app/) is a web application that allows you to
create code using visual programming with
[Blockly](https://developers.google.com/blockly) and execute it with calciumpy
and [Pyodide](https://pyodide.org/en/stable/).
