Skip to main content

A Calcium language interpreter

Project description

calciumpy

Run JSON like code in Python.

How to install

pip install calciumpy

or

pip3 install calciumpy

About Calcium language

Calcium is a programming language 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

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:

print("Hello, World.")

Applications of calciumpy

Calcium Editor is a web application that allows you to create code using visual programming with Blockly and execute it with calciumpy and Pyodide.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

calciumpy-0.4.4.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

calciumpy-0.4.4-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file calciumpy-0.4.4.tar.gz.

File metadata

  • Download URL: calciumpy-0.4.4.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for calciumpy-0.4.4.tar.gz
Algorithm Hash digest
SHA256 e9b301bf3e9065131507d119b1f06ccc05e6c826923130c091e1253a40794cc9
MD5 1c2453453326902b114c31bf31ff1f44
BLAKE2b-256 75fdc7e05e8f929b01222f91a323972446f287f6818d4262aec2bdde9c9dde0f

See more details on using hashes here.

File details

Details for the file calciumpy-0.4.4-py3-none-any.whl.

File metadata

  • Download URL: calciumpy-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for calciumpy-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b85f84459fca623ab46b4c869ce50054287a634e72fc0f379e82b03ac1892c62
MD5 40b2859cd8cce880317db33e0b40cec4
BLAKE2b-256 a56dfcf8073add3eee26ab9bb0925bf57582726fe4f65ee9d8ea4e8f819f0c11

See more details on using hashes here.

Supported by

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