All Projects → apahl → nim_magic

apahl / nim_magic

Licence: MIT license
Nim cell magic for JupyterLab or Juypter Python Notebooks.

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to nim magic

Totemic
A Minecraft mod that allows you to control the world through the power of Totem Poles
Stars: ✭ 26 (-36.59%)
Mutual labels:  magic
cpython
Alternative StdLib for Nim for Python targets, hijacks Python StdLib for Nim
Stars: ✭ 75 (+82.93%)
Mutual labels:  nim-lang
ser334-public
This repository contains public source files for use in SER334 (Operating Systems & Networks) at Arizona State University.
Stars: ✭ 28 (-31.71%)
Mutual labels:  magic
Magic-Calculator
android app for fun
Stars: ✭ 31 (-24.39%)
Mutual labels:  magic
indelope
find large indels (in the blind spot between GATK/freebayes and SV callers)
Stars: ✭ 38 (-7.32%)
Mutual labels:  nim-lang
theBookOfNoah
Everything ive learned developing web applications
Stars: ✭ 22 (-46.34%)
Mutual labels:  nim-lang
mkm-sdk
Python SDK for Magickartenmarkt API
Stars: ✭ 33 (-19.51%)
Mutual labels:  magic
unofficial-webapp-office-poc1
Access all of your favorite Office 365 apps from Linux
Stars: ✭ 31 (-24.39%)
Mutual labels:  nim-lang
sound-garden
A personal journey into the audio synth domain
Stars: ✭ 21 (-48.78%)
Mutual labels:  nim-lang
easywave
Easy WAVE file handling for Nim
Stars: ✭ 18 (-56.1%)
Mutual labels:  nim-lang
cpuwhat
Nim utilities for advanced CPU operations: CPU identification, ISA extension detection, bindings to assorted intrinsics
Stars: ✭ 25 (-39.02%)
Mutual labels:  nim-lang
Magic-Spoiler
Tools for generating Cockatrice-compatible cards.xmls for unreleased magic cards
Stars: ✭ 13 (-68.29%)
Mutual labels:  magic
grim
grim brings property graphs to the Nim language. Look around you: everything is a graph!
Stars: ✭ 44 (+7.32%)
Mutual labels:  nim-lang
dotfiles
Opinionated garbage for your terminal. Gotta get that yolo swag.
Stars: ✭ 37 (-9.76%)
Mutual labels:  magic
nim-gatabase
Connection-Pooling Compile-Time ORM for Nim
Stars: ✭ 103 (+151.22%)
Mutual labels:  nim-lang
pick-a-good-color
Choose the boldest and most accessible color for a given background.
Stars: ✭ 18 (-56.1%)
Mutual labels:  magic
flake-nimble
Nimble packages Nix flake [maintainer=@ehmry]
Stars: ✭ 26 (-36.59%)
Mutual labels:  nim-lang
clc
No description or website provided.
Stars: ✭ 20 (-51.22%)
Mutual labels:  magic
nim-lmdb
Nim LMDB wrapper
Stars: ✭ 31 (-24.39%)
Mutual labels:  nim-lang
mtgsqlive
MTGJSON build scripts to generate alternative data formats
Stars: ✭ 40 (-2.44%)
Mutual labels:  magic

nim_magic

Nim cell magic for JupyterLab or Jupyter Python Notebooks.

Write Nim modules and use the compiled code directly in the Notebook as extension modules for the Python kernel (similar to e.g. %%cython, but for your favorite language :P ). It builds on @yglukhov 's awesome nimpy library.

Requirements

  • A Nim compiler in your path
  • nimpy package (nimble install nimpy)

Installation

Just put the file nim_magic.py somewhere in Python's import path, e.g. in one of the dirs that is printed by: python3 -c "import sys; print(sys.path)".

Example

In a JupyterLab or Jupyter Notebook running a Python3 kernel:

# In [1]:
%load_ext nim_magic


# In [2]:
%%nim -d:release
proc greet(name: string): string {.exportpy.} =
    return "Hello, " & name & "!"


# In [3]:
greet("World")
    

# Out [3]:
'Hello, World!'


# In [4] (this will remove temporary dirs created by nim_magic):
%nim_clear

Further examples can be found here.

And there are some gists, too:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].