Wednesday 3:30 PM–5:00 PM in Central Park East 6501a (6th fl)

Bridging .NET with PyData

Denis Akhiyarov

Audience level:
Experienced

Description

Python for .NET (pythonnet, Python.NET) allows two-way inter-operability between Python and CLR runtimes on Windows, Linux, OSX, and even Linux subsystem on Windows! This presentation is going to show how to use Python code from .NET and .NET assemblies from Python. Let us step on the bridge!

Abstract

Python for .NET (pythonnet, Python.NET) allows two-way inter-operability between Python and CLR runtimes on Windows, Linux, OSX, and even Linux subsystem on Windows! This presentation is going to show how to use Python code from .NET and .NET assemblies from Python. Particular importance in Python.NET is given to installation options: Python wheels, conda and nuget binaries, docker images, and even distribution with WinPython. The deployment is also simplified with tools such as PyInstaller and cx_freeze. This presentation will show how to install and deploy Python.NET apps using these tools. In this talk we are going to show how to call numpy, matplotlib, sympy, and tensorflow from .NET without much boilerplate code. The second part will show how to use .NET from Python, particularly C# magic cells (clrmagic) in ipython kernel with Jupyter Notebooks. The Python.NET tutorial was converted to Jupyter Notebook and C# code cells that are embedded within the same notebook. This presentation will show few demos with REPL experience both from C# and Python using IPython, scriptcs, and Visual Studio. All libraries used in this presentation are open-source and available on all major platforms. Python for .NET is a library developed since 2003 and is very mature and used in production. This talk will also demonstrate clrmagic - Jupyter extension, built on top of pythonnet and developed by authors of this presentation. Python.NET is built with a number of open-source technologies. It uses pycparser and clang for parsing internal CPython structures. .NET types are exposed to Python with Unmanaged Exports (DllExport) open-source “compiler” on Windows. On other platforms, C-API of Mono and CPython are used to “bootstrap” both runtimes. Recently support for next generation cross-platform .NET Core runtime has been developed. Python.NET is used by financial algorithmic trading platforms, banks, engineering companies, and few open-source projects: QuantConnect Lean, pywebview, Pybee Beeware Toga cross-platform UI toolkit, and DWSIM process simulator. Python.NET enables large .NET applications to embed scripting Python interface and numerical Python libraries without boilerplate code and without sacrificing for performance.

Subscribe to Receive PyData Updates

Subscribe