CSnakes.Runtime 1.0.16-beta.54

This is a prerelease version of CSnakes.Runtime.
There is a newer version of this package available.
See the version list below for details.
dotnet add package CSnakes.Runtime --version 1.0.16-beta.54                
NuGet\Install-Package CSnakes.Runtime -Version 1.0.16-beta.54                
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.16-beta.54" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CSnakes.Runtime --version 1.0.16-beta.54                
#r "nuget: CSnakes.Runtime, 1.0.16-beta.54"                
#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.16-beta.54&prerelease

// Install CSnakes.Runtime as a Cake Tool
#tool nuget:?package=CSnakes.Runtime&version=1.0.16-beta.54&prerelease                

CSnakes - a tool for embedding Python into .NET projects

[!WARNING]
This project is in prototype stage and the API is subject to change.

Documentation

NuGet Version 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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.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.27 115 2/14/2025
1.0.27-beta.138 31 2/14/2025
1.0.26 703 1/27/2025
1.0.26-beta.137 34 2/14/2025
1.0.26-beta.136 42 2/10/2025
1.0.26-beta.135 41 1/27/2025
1.0.25 421 1/14/2025
1.0.25-beta.134 34 1/27/2025
1.0.25-beta.133 34 1/22/2025
1.0.25-beta.132 34 1/22/2025
1.0.25-beta.131 31 1/22/2025
1.0.25-beta.130 26 1/14/2025
1.0.25-beta.129 29 1/14/2025
1.0.25-beta.128 28 1/14/2025
1.0.24 119 1/13/2025
1.0.24-beta.127 33 1/13/2025
1.0.24-beta.126 34 1/13/2025
1.0.24-beta.125 39 1/13/2025
1.0.23 300 1/10/2025
1.0.23-beta.124 39 1/13/2025
1.0.23-beta.123 37 1/12/2025
1.0.23-beta.122 41 1/12/2025
1.0.23-beta.121 43 1/11/2025
1.0.23-beta.120 35 1/10/2025
1.0.22-beta.119 37 1/10/2025
1.0.21 2,025 10/15/2024
1.0.21-beta.118 33 1/10/2025
1.0.21-beta.117 29 1/8/2025
1.0.21-beta.116 28 1/8/2025
1.0.21-beta.115 56 11/2/2024
1.0.21-beta.114 51 10/30/2024
1.0.21-beta.113 57 10/29/2024
1.0.21-beta.112 53 10/29/2024
1.0.21-beta.111 53 10/29/2024
1.0.21-beta.110 56 10/29/2024
1.0.21-beta.109 68 10/22/2024
1.0.21-beta.108 75 10/20/2024
1.0.21-beta.107 77 10/20/2024
1.0.21-beta.106 75 10/20/2024
1.0.21-beta.105 105 10/18/2024
1.0.21-beta.104 54 10/17/2024
1.0.21-beta.103 53 10/17/2024
1.0.21-beta.102 52 10/15/2024
1.0.20 447 10/11/2024
1.0.20-beta.101 54 10/15/2024
1.0.20-beta.100 56 10/15/2024
1.0.20-beta.99 61 10/14/2024
1.0.20-beta.98 60 10/14/2024
1.0.20-beta.97 53 10/14/2024
1.0.20-beta.96 55 10/11/2024
1.0.19-beta.95 72 10/11/2024
1.0.19-beta.94 93 10/11/2024
1.0.19-beta.93 70 10/11/2024
1.0.19-beta.92 62 10/11/2024
1.0.19-beta.91 84 10/11/2024
1.0.19-beta.90 56 10/11/2024
1.0.19-beta.89 62 10/11/2024
1.0.18 805 9/23/2024
1.0.18-beta.88 62 10/11/2024
1.0.18-beta.87 51 10/10/2024
1.0.18-beta.86 64 10/7/2024
1.0.18-beta.85 54 10/6/2024
1.0.18-beta.84 56 10/6/2024
1.0.18-beta.83 64 9/25/2024
1.0.18-beta.82 55 9/24/2024
1.0.18-beta.80 54 9/23/2024
1.0.17 1,524 8/30/2024
1.0.17-beta.79 57 9/23/2024
1.0.17-beta.78 55 9/23/2024
1.0.17-beta.77 45 9/19/2024
1.0.17-beta.73 67 9/17/2024
1.0.17-beta.72 64 9/17/2024
1.0.17-beta.71 67 9/17/2024
1.0.17-beta.70 67 9/17/2024
1.0.17-beta.69 66 9/17/2024
1.0.17-beta.68 68 9/17/2024
1.0.17-beta.67 61 9/16/2024
1.0.17-beta.66 64 9/10/2024
1.0.17-beta.65 61 9/10/2024
1.0.17-beta.64 66 9/5/2024
1.0.17-beta.63 59 9/4/2024
1.0.17-beta.62 68 9/4/2024
1.0.17-beta.61 58 8/30/2024
1.0.17-beta.60 58 8/30/2024
1.0.16 633 8/21/2024
1.0.16-beta.59 65 8/30/2024
1.0.16-beta.58 54 8/29/2024
1.0.16-beta.57 57 8/28/2024
1.0.16-beta.56 63 8/28/2024
1.0.16-beta.55 65 8/28/2024
1.0.16-beta.54 83 8/23/2024
1.0.16-beta.53 80 8/23/2024
1.0.16-beta.52 81 8/22/2024
1.0.16-beta.51 78 8/21/2024
1.0.15-beta.50 84 8/21/2024
1.0.15-beta.49 104 8/21/2024
1.0.15-beta.48 97 8/21/2024
1.0.15-beta.47 90 8/21/2024
1.0.15-beta.46 70 8/21/2024
1.0.13 390 8/15/2024
1.0.13-beta.36 80 8/17/2024
1.0.13-beta.35 76 8/16/2024
1.0.13-beta.34 82 8/16/2024
1.0.13-beta.33 82 8/16/2024
1.0.13-beta.32 80 8/15/2024
1.0.13-beta.31 75 8/15/2024
1.0.11 128 8/14/2024
1.0.11-beta.30 79 8/15/2024
1.0.11-beta.29 77 8/15/2024
1.0.11-beta.28 74 8/14/2024
1.0.11-beta.27 78 8/14/2024
1.0.11-beta.26 80 8/14/2024
1.0.10 137 8/14/2024
1.0.10-beta.25 84 8/14/2024
1.0.10-beta.24 71 8/14/2024
1.0.9 122 8/14/2024
1.0.9-beta.23 80 8/14/2024
1.0.8 129 8/13/2024
1.0.8-beta.22 76 8/13/2024
1.0.8-beta.21 79 8/13/2024
1.0.8-beta.20 82 8/13/2024
1.0.8-beta.19 76 8/13/2024
1.0.8-beta.18 78 8/13/2024
1.0.8-beta.17 93 8/13/2024
1.0.7-beta.16 76 8/6/2024
1.0.6 99 8/5/2024
1.0.4-beta.14 55 8/3/2024
1.0.4-beta.13 50 8/3/2024
1.0.4-beta.12 54 8/3/2024
1.0.4-beta.11 67 8/1/2024
1.0.4-beta.10 65 8/1/2024
1.0.3-beta.8 58 8/1/2024
1.0.3-beta.7 68 8/1/2024
1.0.2 104 7/26/2024
1.0.1 100 7/26/2024
1.0.0 112 7/25/2024