CSnakes.Runtime 1.0.13

There is a newer version of this package available.
See the version list below for details.
dotnet add package CSnakes.Runtime --version 1.0.13                
NuGet\Install-Package CSnakes.Runtime -Version 1.0.13                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CSnakes.Runtime" Version="1.0.13" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CSnakes.Runtime --version 1.0.13                
#r "nuget: CSnakes.Runtime, 1.0.13"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CSnakes.Runtime as a Cake Addin
#addin nuget:?package=CSnakes.Runtime&version=1.0.13

// Install CSnakes.Runtime as a Cake Tool
#tool nuget:?package=CSnakes.Runtime&version=1.0.13                

CSnakes - a tool for embedding Python code into .NET projects

Documentation

NuGet Version

<img src="docs/res/logo.jpeg" alt="drawing" width="200"/>

CSnakes is a .NET Source Generator and Runtime that you can use to embed Python code and libraries into your .NET Solution without the need for REST, HTTP, or Microservices.

image

Features

  • .NET Standard 2.0 (.NET 6-8)
  • Supports Python 3.9-3.13
  • Supports Virtual Environments and C-Extensions
  • Supports Windows, macOS, and Linux
  • Uses Python's C-API for fast invocation of Python code directly in the .NET process
  • Uses Python type hinting to generate function signatures with .NET native types
  • Supports nested sequence and mapping types (tuple, dict, list)
  • Supports default values

Examples

Given the following Python file called example.py


def hello_world(name: str, age: int) -> str:
  return f"Hello {name}, you must be {age} years old!"

CSnakes will generate a static .NET class called Example with the function:

public class Example {
  public static string HelloWorld(string name, long age) {
    ...
  }
}

When called, HelloWorld() will invoke the Python function from example.py using Python's C-API and return native .NET types.

FAQ

See the FAQ for more information.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on CSnakes.Runtime:

Package Downloads
Glidergun

Package Description

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on CSnakes.Runtime:

Repository Stars
tonybaloney/CSnakes
Embed Python in .NET
Version Downloads Last updated
1.0.21 1,386 10/15/2024
1.0.21-beta.115 48 11/2/2024
1.0.21-beta.114 45 10/30/2024
1.0.21-beta.113 49 10/29/2024
1.0.21-beta.112 47 10/29/2024
1.0.21-beta.111 45 10/29/2024
1.0.21-beta.110 48 10/29/2024
1.0.21-beta.109 58 10/22/2024
1.0.21-beta.108 67 10/20/2024
1.0.21-beta.107 69 10/20/2024
1.0.21-beta.106 67 10/20/2024
1.0.21-beta.105 102 10/18/2024
1.0.21-beta.104 52 10/17/2024
1.0.21-beta.103 51 10/17/2024
1.0.21-beta.102 48 10/15/2024
1.0.20 444 10/11/2024
1.0.20-beta.101 50 10/15/2024
1.0.20-beta.100 54 10/15/2024
1.0.20-beta.99 57 10/14/2024
1.0.20-beta.98 56 10/14/2024
1.0.20-beta.97 49 10/14/2024
1.0.20-beta.96 53 10/11/2024
1.0.19-beta.95 68 10/11/2024
1.0.19-beta.94 89 10/11/2024
1.0.19-beta.93 65 10/11/2024
1.0.19-beta.92 57 10/11/2024
1.0.19-beta.91 79 10/11/2024
1.0.19-beta.90 51 10/11/2024
1.0.19-beta.89 56 10/11/2024
1.0.18 803 9/23/2024
1.0.18-beta.88 59 10/11/2024
1.0.18-beta.87 47 10/10/2024
1.0.18-beta.86 60 10/7/2024
1.0.18-beta.85 50 10/6/2024
1.0.18-beta.84 54 10/6/2024
1.0.18-beta.83 60 9/25/2024
1.0.18-beta.82 49 9/24/2024
1.0.18-beta.80 52 9/23/2024
1.0.17 1,410 8/30/2024
1.0.17-beta.79 53 9/23/2024
1.0.17-beta.78 53 9/23/2024
1.0.17-beta.77 40 9/19/2024
1.0.17-beta.73 63 9/17/2024
1.0.17-beta.72 58 9/17/2024
1.0.17-beta.71 61 9/17/2024
1.0.17-beta.70 62 9/17/2024
1.0.17-beta.69 59 9/17/2024
1.0.17-beta.68 60 9/17/2024
1.0.17-beta.67 57 9/16/2024
1.0.17-beta.66 59 9/10/2024
1.0.17-beta.65 59 9/10/2024
1.0.17-beta.64 62 9/5/2024
1.0.17-beta.63 55 9/4/2024
1.0.17-beta.62 63 9/4/2024
1.0.17-beta.61 55 8/30/2024
1.0.17-beta.60 56 8/30/2024
1.0.16 630 8/21/2024
1.0.16-beta.59 61 8/30/2024
1.0.16-beta.58 52 8/29/2024
1.0.16-beta.57 53 8/28/2024
1.0.16-beta.56 59 8/28/2024
1.0.16-beta.55 63 8/28/2024
1.0.16-beta.54 81 8/23/2024
1.0.16-beta.53 76 8/23/2024
1.0.16-beta.52 77 8/22/2024
1.0.16-beta.51 76 8/21/2024
1.0.15-beta.50 80 8/21/2024
1.0.15-beta.49 102 8/21/2024
1.0.15-beta.48 93 8/21/2024
1.0.15-beta.47 88 8/21/2024
1.0.15-beta.46 67 8/21/2024
1.0.13 386 8/15/2024
1.0.13-beta.36 76 8/17/2024
1.0.13-beta.35 72 8/16/2024
1.0.13-beta.34 75 8/16/2024
1.0.13-beta.33 80 8/16/2024
1.0.13-beta.32 76 8/15/2024
1.0.13-beta.31 71 8/15/2024
1.0.11 120 8/14/2024
1.0.11-beta.30 75 8/15/2024
1.0.11-beta.29 73 8/15/2024
1.0.11-beta.28 70 8/14/2024
1.0.11-beta.27 72 8/14/2024
1.0.11-beta.26 74 8/14/2024
1.0.10 129 8/14/2024
1.0.10-beta.25 75 8/14/2024
1.0.10-beta.24 67 8/14/2024
1.0.9 118 8/14/2024
1.0.9-beta.23 78 8/14/2024
1.0.8 124 8/13/2024
1.0.8-beta.22 73 8/13/2024
1.0.8-beta.21 75 8/13/2024
1.0.8-beta.20 78 8/13/2024
1.0.8-beta.19 74 8/13/2024
1.0.8-beta.18 74 8/13/2024
1.0.8-beta.17 90 8/13/2024
1.0.7-beta.16 70 8/6/2024
1.0.6 91 8/5/2024
1.0.4-beta.14 53 8/3/2024
1.0.4-beta.13 48 8/3/2024
1.0.4-beta.12 50 8/3/2024
1.0.4-beta.11 63 8/1/2024
1.0.4-beta.10 61 8/1/2024
1.0.3-beta.8 56 8/1/2024
1.0.3-beta.7 66 8/1/2024
1.0.2 100 7/26/2024
1.0.1 94 7/26/2024
1.0.0 105 7/25/2024