jabbalaci / nimpykot

Porting some Python / Kotlin features to Nim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NimPyKot

Build Status

Porting some Python / Kotlin features to Nim.

Installation

$ nimble install pykot

To install the latest development version, issue the following command:

$ nimble install "https://github.com/jabbalaci/nimpykot@#head"

With nimble uninstall pykot you can remove the package.

API Documentation

See here: https://jabbalaci.github.io/nimpykot/ .

Notes

The project was inspired by https://github.com/Yardanico/nimpylib.

Sample

Take an integer and reverse it. The result must also be an integer. Example: 1977 → 7791.

import unicode
import pykot/converters

proc reverse_number(n: int): int =
  n.toStr().reversed().toInt()

let n = 2018

echo n                    # 2018
echo reverse_number(n)    # 8102

See the samples/ directory for more examples.

About

Porting some Python / Kotlin features to Nim

License:MIT License


Languages

Language:Nim 79.9%Language:Python 20.1%