nym

https://img.shields.io/pypi/v/nym.svg https://github.com/gmagno/nym/actions/workflows/build.yml/badge.svg Documentation Status

Nim extension for Python using nimporter, example project.

Usage

To install nym, run this command in your terminal:

$ pip install nym

To install from source:

$ git clone git@github.com:gmagno/nym.git && cd nym
$ python -m venv .venv
$ source .venv/bin/activate
$ pip install -U pip && pip install -r requirements_dev.txt
$ python -m nym.cli

To build:

$ make dist

To use nym:

from nym import fast, slow

start = time.time()
python_ret = slow.fib(33)
python_time = time.time() - start

restart = time.time()
nim_ret = fast.fib(33)
nim_time = time.time() - restart

print(f"python ret: {python_ret}")
print(f"python elapsed time: {python_time}")

print(f"nim ret: {nim_ret}")
print(f"nim elapsed time: {nim_time}")