CSnakes.Runtime 1.2.1

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package CSnakes.Runtime --version 1.2.1
                    
NuGet\Install-Package CSnakes.Runtime -Version 1.2.1
                    
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.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CSnakes.Runtime" Version="1.2.1" />
                    
Directory.Packages.props
<PackageReference Include="CSnakes.Runtime" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CSnakes.Runtime --version 1.2.1
                    
#r "nuget: CSnakes.Runtime, 1.2.1"
                    
#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.
#:package CSnakes.Runtime@1.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CSnakes.Runtime&version=1.2.1
                    
Install as a Cake Addin
#tool nuget:?package=CSnakes.Runtime&version=1.2.1
                    
Install as a Cake Tool

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 C#.NET Solution at a performant, low-level without the need for REST, HTTP, or Microservices.

Check out the getting started guide or check out the demo solution to see more.

Features

Benefits

  • Uses native Python type hinting standards to produce clean, readable C# code with minimal boiler plate!
  • Integration between .NET and Python is done at the C-API, meaning strong compatibility between Python versions 3.8-3.13 and .NET 8-9.
  • Integration is low-level and high-performance.
  • CSnakes uses the CPython C-API and is compatible with all Python extensions.
  • Invocation of Python code and libraries is in the same process as .NET

<br />

CSnakes Demo Video

Click to watch the CSnakes demo video on YouTube

<br />

Example

CSnakes will generate a C#.NET class for any Python file in a project that is tagged as CSharp Analyzer Additional File (see Getting Started). All functions in that class with type annotations will be reflected to callable C# methods and an environment builder added to that module.

System diagram

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 is compatible.  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.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

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

Package Downloads
Glidergun

Package Description

Harbour.NETCore.CSnakes

Harbour.NETCore.CSnakes

Evergine.Runtimes.USD

Package Description

TransformersSharp

Package Description

GitHub repositories (1)

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

Repository Stars
tonybaloney/TransformersSharp
A little wrapper for hugging face transformers in C#
Version Downloads Last Updated
2.0.0-beta.319 25 1/14/2026
2.0.0-beta.318 249 1/5/2026
2.0.0-beta.317 52 12/31/2025
2.0.0-beta.316 40 12/31/2025
2.0.0-beta.315 45 12/30/2025
2.0.0-beta.314 50 12/27/2025
2.0.0-beta.313 208 12/22/2025
2.0.0-beta.312 164 12/21/2025
2.0.0-beta.311 126 12/21/2025
2.0.0-beta.310 115 12/21/2025
2.0.0-beta.309 160 12/19/2025
2.0.0-beta.308 194 12/19/2025
2.0.0-beta.307 198 12/19/2025
2.0.0-beta.306 265 12/17/2025
2.0.0-beta.305 235 12/14/2025
2.0.0-beta.304 116 12/13/2025
2.0.0-beta.303 69 12/13/2025
2.0.0-beta.302 160 11/30/2025
2.0.0-beta.301 76 11/29/2025
2.0.0-beta.300 69 11/29/2025
2.0.0-beta.299 67 11/29/2025
2.0.0-beta.298 134 11/27/2025
2.0.0-beta.297 153 11/25/2025
2.0.0-beta.296 194 10/26/2025
2.0.0-beta.295 129 10/26/2025
2.0.0-beta.294 183 10/22/2025
2.0.0-beta.293 152 10/12/2025
2.0.0-beta.292 121 10/12/2025
2.0.0-beta.291 186 10/1/2025
2.0.0-beta.290 136 10/1/2025
2.0.0-beta.289 213 9/19/2025
2.0.0-beta.288 184 9/19/2025
2.0.0-beta.287 230 9/19/2025
2.0.0-beta.286 283 9/18/2025
2.0.0-beta.285 264 9/18/2025
2.0.0-beta.284 272 9/18/2025
2.0.0-beta.283 262 9/18/2025
2.0.0-beta.282 274 9/18/2025
2.0.0-beta.281 262 9/18/2025
2.0.0-beta.280 260 9/18/2025
2.0.0-beta.279 265 9/17/2025
2.0.0-beta.278 279 9/17/2025
2.0.0-beta.277 271 9/17/2025
2.0.0-beta.276 261 9/15/2025
2.0.0-beta.275 198 9/15/2025
2.0.0-beta.274 195 9/15/2025
2.0.0-beta.273 184 9/15/2025
2.0.0-beta.272 173 9/3/2025
2.0.0-beta.271 200 8/28/2025
2.0.0-beta.270 195 8/28/2025
2.0.0-beta.269 189 8/28/2025
2.0.0-beta.268 253 8/25/2025
2.0.0-beta.267 100 8/22/2025
2.0.0-beta.266 151 8/20/2025
2.0.0-beta.265 143 8/18/2025
2.0.0-beta.264 134 8/18/2025
2.0.0-beta.263 130 8/18/2025
2.0.0-beta.262 136 8/18/2025
2.0.0-beta.261 152 8/14/2025
2.0.0-beta.260 155 8/13/2025
2.0.0-beta.259 150 8/12/2025
2.0.0-beta.258 156 8/12/2025
1.2.1 21,020 8/8/2025
1.2.1-beta.257 142 8/12/2025
1.2.1-beta.256 157 8/12/2025
1.2.1-beta.255 135 8/9/2025
1.2.1-beta.254 197 8/8/2025
1.2.0 1,147 8/1/2025
1.2.0-beta.253 194 8/8/2025
1.2.0-beta.252 197 8/8/2025
1.2.0-beta.250 100 8/1/2025
1.1.0 9,915 6/24/2025
1.1.0-beta.249 104 8/1/2025
1.1.0-beta.246 483 7/24/2025
1.1.0-beta.245 492 7/24/2025
1.1.0-beta.244 532 7/23/2025
1.1.0-beta.243 536 7/22/2025
1.1.0-beta.242 527 7/22/2025
1.1.0-beta.241 147 7/15/2025
1.1.0-beta.240 136 7/14/2025
1.1.0-beta.239 146 7/9/2025
1.1.0-beta.238 147 7/8/2025
1.1.0-beta.237 151 6/25/2025
1.1.0-beta.236 147 6/24/2025
1.1.0-beta.235 147 6/24/2025
1.0.35 6,851 6/5/2025
1.0.35-beta.234 143 6/24/2025
1.0.35-beta.233 146 6/24/2025
1.0.35-beta.232 142 6/24/2025
1.0.35-beta.231 142 6/23/2025
1.0.35-beta.230 144 6/23/2025
1.0.35-beta.229 142 6/23/2025
1.0.35-beta.228 150 6/23/2025
1.0.35-beta.227 142 6/23/2025
1.0.35-beta.226 150 6/18/2025
1.0.35-beta.225 152 6/18/2025
1.0.35-beta.224 149 6/16/2025
1.0.35-beta.223 150 6/15/2025
1.0.35-beta.222 140 6/15/2025
1.0.35-beta.221 154 6/15/2025
1.0.35-beta.220 138 6/15/2025
1.0.35-beta.219 133 6/15/2025
1.0.35-beta.218 132 6/15/2025
1.0.35-beta.217 137 6/15/2025
1.0.35-beta.216 149 6/14/2025
1.0.35-beta.215 287 6/12/2025
1.0.35-beta.214 288 6/12/2025
1.0.35-beta.213 293 6/11/2025
1.0.35-beta.212 282 6/11/2025
1.0.35-beta.211 291 6/11/2025
1.0.35-beta.210 293 6/11/2025
1.0.35-beta.209 292 6/11/2025
1.0.35-beta.208 82 6/6/2025
1.0.35-beta.207 144 6/5/2025
1.0.34 2,502 5/25/2025
1.0.34-beta.206 150 6/5/2025
1.0.34-beta.205 146 6/4/2025
1.0.34-beta.204 150 6/4/2025
1.0.34-beta.203 144 6/4/2025
1.0.34-beta.202 145 6/4/2025
1.0.34-beta.201 146 6/4/2025
1.0.34-beta.200 143 6/3/2025
1.0.34-beta.199 151 6/2/2025
1.0.34-beta.198 153 6/2/2025
1.0.34-beta.197 149 6/2/2025
1.0.34-beta.196 110 5/25/2025
1.0.34-beta.195 113 5/25/2025
1.0.33 1,328 5/7/2025
1.0.33-beta.194 76 5/24/2025
1.0.33-beta.193 129 5/23/2025
1.0.33-beta.192 94 5/23/2025
1.0.33-beta.191 127 5/23/2025
1.0.33-beta.190 171 5/8/2025
1.0.33-beta.189 143 5/8/2025
1.0.33-beta.188 190 5/7/2025
1.0.32 760 4/29/2025
1.0.32-beta.187 174 5/7/2025
1.0.32-beta.186 145 5/6/2025
1.0.32-beta.185 148 5/5/2025
1.0.32-beta.184 172 5/5/2025
1.0.32-beta.183 179 4/30/2025
1.0.32-beta.182 192 4/30/2025
1.0.32-beta.181 150 4/30/2025
1.0.32-beta.180 164 4/29/2025
1.0.31 1,414 4/23/2025
1.0.31-beta.179 175 4/28/2025
1.0.31-beta.178 193 4/28/2025
1.0.31-beta.177 167 4/28/2025
1.0.31-beta.176 162 4/28/2025
1.0.31-beta.175 158 4/28/2025
1.0.31-beta.174 174 4/27/2025
1.0.31-beta.173 194 4/24/2025
1.0.31-beta.172 169 4/24/2025
1.0.31-beta.171 160 4/24/2025
1.0.31-beta.170 164 4/24/2025
1.0.31-beta.169 159 4/24/2025
1.0.31-beta.168 181 4/23/2025
1.0.31-beta.167 162 4/23/2025
1.0.31-beta.166 162 4/23/2025
1.0.31-beta.165 179 4/23/2025
1.0.30 4,140 3/26/2025
1.0.30-beta.164 165 4/23/2025
1.0.30-beta.163 159 4/22/2025
1.0.30-beta.162 184 4/22/2025
1.0.30-beta.161 162 4/18/2025
1.0.30-beta.160 192 4/17/2025
1.0.30-beta.159 186 4/6/2025
1.0.30-beta.158 167 4/6/2025
1.0.30-beta.157 191 4/4/2025
1.0.30-beta.156 163 4/3/2025
1.0.30-beta.155 153 4/3/2025
1.0.30-beta.154 164 4/3/2025
1.0.30-beta.153 170 4/3/2025
1.0.30-beta.152 185 3/30/2025
1.0.30-beta.151 480 3/26/2025
1.0.29 624 3/14/2025
1.0.29-beta.150 478 3/26/2025
1.0.29-beta.149 151 3/21/2025
1.0.29-beta.148 158 3/20/2025
1.0.29-beta.147 185 3/17/2025
1.0.29-beta.146 169 3/16/2025
1.0.29-beta.145 145 3/14/2025
1.0.28 269 3/12/2025
1.0.28-beta.144 147 3/14/2025
1.0.28-beta.143 202 3/12/2025
1.0.27 2,345 2/14/2025
1.0.27-beta.142 191 3/12/2025
1.0.27-beta.141 167 3/12/2025
1.0.27-beta.140 170 3/10/2025
1.0.27-beta.139 106 2/28/2025
1.0.27-beta.138 104 2/14/2025
1.0.26 7,366 1/27/2025
1.0.26-beta.137 105 2/14/2025
1.0.26-beta.136 105 2/10/2025
1.0.26-beta.135 138 1/27/2025
1.0.25 552 1/14/2025
1.0.25-beta.134 96 1/27/2025
1.0.25-beta.133 98 1/22/2025
1.0.25-beta.132 101 1/22/2025
1.0.25-beta.131 95 1/22/2025
1.0.25-beta.130 116 1/14/2025
1.0.25-beta.129 83 1/14/2025
1.0.25-beta.128 114 1/14/2025
1.0.24 243 1/13/2025
1.0.24-beta.127 83 1/13/2025
1.0.24-beta.126 92 1/13/2025
1.0.24-beta.125 94 1/13/2025
1.0.23 369 1/10/2025
1.0.23-beta.124 117 1/13/2025
1.0.23-beta.123 87 1/12/2025
1.0.23-beta.122 127 1/12/2025
1.0.23-beta.121 98 1/11/2025
1.0.23-beta.120 91 1/10/2025
1.0.22-beta.119 92 1/10/2025
1.0.21 3,325 10/15/2024
1.0.21-beta.118 84 1/10/2025
1.0.21-beta.117 116 1/8/2025
1.0.21-beta.116 93 1/8/2025
1.0.21-beta.115 128 11/2/2024
1.0.21-beta.114 119 10/30/2024
1.0.21-beta.113 104 10/29/2024
1.0.21-beta.112 104 10/29/2024
1.0.21-beta.111 100 10/29/2024
1.0.21-beta.110 95 10/29/2024
1.0.21-beta.109 124 10/22/2024
1.0.21-beta.108 126 10/20/2024
1.0.21-beta.107 125 10/20/2024
1.0.21-beta.106 118 10/20/2024
1.0.21-beta.105 141 10/18/2024
1.0.21-beta.104 98 10/17/2024
1.0.21-beta.103 101 10/17/2024
1.0.21-beta.102 90 10/15/2024
1.0.20 514 10/11/2024
1.0.20-beta.101 103 10/15/2024
1.0.20-beta.100 103 10/15/2024
1.0.20-beta.99 130 10/14/2024
1.0.20-beta.98 107 10/14/2024
1.0.20-beta.97 103 10/14/2024
1.0.20-beta.96 95 10/11/2024
1.0.19-beta.95 113 10/11/2024
1.0.19-beta.94 132 10/11/2024
1.0.19-beta.93 110 10/11/2024
1.0.19-beta.92 98 10/11/2024
1.0.19-beta.91 124 10/11/2024
1.0.19-beta.90 99 10/11/2024
1.0.19-beta.89 102 10/11/2024
1.0.18 1,175 9/23/2024
1.0.18-beta.88 104 10/11/2024
1.0.18-beta.87 93 10/10/2024
1.0.18-beta.86 111 10/7/2024
1.0.18-beta.85 105 10/6/2024
1.0.18-beta.84 101 10/6/2024
1.0.18-beta.83 114 9/25/2024
1.0.18-beta.82 99 9/24/2024
1.0.18-beta.80 104 9/23/2024
1.0.17 3,119 8/30/2024
1.0.17-beta.79 141 9/23/2024
1.0.17-beta.78 98 9/23/2024
1.0.17-beta.77 89 9/19/2024
1.0.17-beta.73 111 9/17/2024
1.0.17-beta.72 108 9/17/2024
1.0.17-beta.71 145 9/17/2024
1.0.17-beta.70 119 9/17/2024
1.0.17-beta.69 114 9/17/2024
1.0.17-beta.68 117 9/17/2024
1.0.17-beta.67 120 9/16/2024
1.0.17-beta.66 123 9/10/2024
1.0.17-beta.65 108 9/10/2024
1.0.17-beta.64 125 9/5/2024
1.0.17-beta.63 109 9/4/2024
1.0.17-beta.62 116 9/4/2024
1.0.17-beta.61 110 8/30/2024
1.0.17-beta.60 142 8/30/2024
1.0.16 786 8/21/2024
1.0.16-beta.59 150 8/30/2024
1.0.16-beta.58 131 8/29/2024
1.0.16-beta.57 110 8/28/2024
1.0.16-beta.56 112 8/28/2024
1.0.16-beta.55 116 8/28/2024
1.0.16-beta.54 165 8/23/2024
1.0.16-beta.53 134 8/23/2024
1.0.16-beta.52 169 8/22/2024
1.0.16-beta.51 132 8/21/2024
1.0.15-beta.50 132 8/21/2024
1.0.15-beta.49 153 8/21/2024
1.0.15-beta.48 145 8/21/2024
1.0.15-beta.47 171 8/21/2024
1.0.15-beta.46 122 8/21/2024
1.0.13 556 8/15/2024
1.0.13-beta.36 128 8/17/2024
1.0.13-beta.35 117 8/16/2024
1.0.13-beta.34 143 8/16/2024
1.0.13-beta.33 134 8/16/2024
1.0.13-beta.32 156 8/15/2024
1.0.13-beta.31 131 8/15/2024
1.0.11 275 8/14/2024
1.0.11-beta.30 139 8/15/2024
1.0.11-beta.29 142 8/15/2024
1.0.11-beta.28 129 8/14/2024
1.0.11-beta.27 124 8/14/2024
1.0.11-beta.26 134 8/14/2024
1.0.10 309 8/14/2024
1.0.10-beta.25 141 8/14/2024
1.0.10-beta.24 122 8/14/2024
1.0.9 277 8/14/2024
1.0.9-beta.23 135 8/14/2024
1.0.8 296 8/13/2024
1.0.8-beta.22 130 8/13/2024
1.0.8-beta.21 129 8/13/2024
1.0.8-beta.20 133 8/13/2024
1.0.8-beta.19 125 8/13/2024
1.0.8-beta.18 163 8/13/2024
1.0.8-beta.17 135 8/13/2024
1.0.7-beta.16 129 8/6/2024
1.0.6 279 8/5/2024
1.0.4-beta.14 108 8/3/2024
1.0.4-beta.13 102 8/3/2024
1.0.4-beta.12 121 8/3/2024
1.0.4-beta.11 121 8/1/2024
1.0.4-beta.10 120 8/1/2024
1.0.3-beta.8 110 8/1/2024
1.0.3-beta.7 126 8/1/2024
1.0.2 271 7/26/2024
1.0.1 277 7/26/2024
1.0.0 467 7/25/2024