CSnakes.Runtime
1.0.33
dotnet add package CSnakes.Runtime --version 1.0.33
NuGet\Install-Package CSnakes.Runtime -Version 1.0.33
<PackageReference Include="CSnakes.Runtime" Version="1.0.33" />
<PackageVersion Include="CSnakes.Runtime" Version="1.0.33" />
<PackageReference Include="CSnakes.Runtime" />
paket add CSnakes.Runtime --version 1.0.33
#r "nuget: CSnakes.Runtime, 1.0.33"
#addin nuget:?package=CSnakes.Runtime&version=1.0.33
#tool nuget:?package=CSnakes.Runtime&version=1.0.33
CSnakes - a tool for embedding Python into .NET projects
<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.
Features
- Supports .NET Standard 8-9
- Supports Python 3.9-3.13
- Supports Virtual Environments and C-Extensions
- Supports Windows, macOS, and Linux
- Tight integration between NumPy ndarrays and Spans, 2D Spans and TensorSpans (.NET 9)
- 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 CPython 3.13 "free-threading" mode
- 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 | Versions 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. |
-
net8.0
- CommunityToolkit.HighPerformance (>= 8.3.0)
- Microsoft.Extensions.Hosting (>= 8.0.0)
- ZstdSharp.Port (>= 0.8.4)
-
net9.0
- CommunityToolkit.HighPerformance (>= 8.3.0)
- Microsoft.Extensions.Hosting (>= 9.0.0)
- System.Numerics.Tensors (>= 9.0.0)
- ZstdSharp.Port (>= 0.8.4)
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.33 | 253 | 5/7/2025 |
1.0.33-beta.190 | 53 | 5/8/2025 |
1.0.33-beta.189 | 57 | 5/8/2025 |
1.0.33-beta.188 | 67 | 5/7/2025 |
1.0.32 | 551 | 4/29/2025 |
1.0.32-beta.187 | 68 | 5/7/2025 |
1.0.32-beta.186 | 58 | 5/6/2025 |
1.0.32-beta.185 | 58 | 5/5/2025 |
1.0.32-beta.184 | 63 | 5/5/2025 |
1.0.32-beta.183 | 101 | 4/30/2025 |
1.0.32-beta.182 | 104 | 4/30/2025 |
1.0.32-beta.181 | 102 | 4/30/2025 |
1.0.32-beta.180 | 117 | 4/29/2025 |
1.0.31 | 991 | 4/23/2025 |
1.0.31-beta.179 | 119 | 4/28/2025 |
1.0.31-beta.178 | 114 | 4/28/2025 |
1.0.31-beta.177 | 121 | 4/28/2025 |
1.0.31-beta.176 | 116 | 4/28/2025 |
1.0.31-beta.175 | 113 | 4/28/2025 |
1.0.31-beta.174 | 117 | 4/27/2025 |
1.0.31-beta.173 | 117 | 4/24/2025 |
1.0.31-beta.172 | 117 | 4/24/2025 |
1.0.31-beta.171 | 111 | 4/24/2025 |
1.0.31-beta.170 | 113 | 4/24/2025 |
1.0.31-beta.169 | 114 | 4/24/2025 |
1.0.31-beta.168 | 114 | 4/23/2025 |
1.0.31-beta.167 | 116 | 4/23/2025 |
1.0.31-beta.166 | 114 | 4/23/2025 |
1.0.31-beta.165 | 118 | 4/23/2025 |
1.0.30 | 2,037 | 3/26/2025 |
1.0.30-beta.164 | 120 | 4/23/2025 |
1.0.30-beta.163 | 112 | 4/22/2025 |
1.0.30-beta.162 | 112 | 4/22/2025 |
1.0.30-beta.161 | 114 | 4/18/2025 |
1.0.30-beta.160 | 146 | 4/17/2025 |
1.0.30-beta.159 | 124 | 4/6/2025 |
1.0.30-beta.158 | 122 | 4/6/2025 |
1.0.30-beta.157 | 122 | 4/4/2025 |
1.0.30-beta.156 | 115 | 4/3/2025 |
1.0.30-beta.155 | 116 | 4/3/2025 |
1.0.30-beta.154 | 120 | 4/3/2025 |
1.0.30-beta.153 | 122 | 4/3/2025 |
1.0.30-beta.152 | 118 | 3/30/2025 |
1.0.30-beta.151 | 434 | 3/26/2025 |
1.0.29 | 511 | 3/14/2025 |
1.0.29-beta.150 | 437 | 3/26/2025 |
1.0.29-beta.149 | 109 | 3/21/2025 |
1.0.29-beta.148 | 118 | 3/20/2025 |
1.0.29-beta.147 | 110 | 3/17/2025 |
1.0.29-beta.146 | 99 | 3/16/2025 |
1.0.29-beta.145 | 100 | 3/14/2025 |
1.0.28 | 222 | 3/12/2025 |
1.0.28-beta.144 | 98 | 3/14/2025 |
1.0.28-beta.143 | 124 | 3/12/2025 |
1.0.27 | 1,414 | 2/14/2025 |
1.0.27-beta.142 | 122 | 3/12/2025 |
1.0.27-beta.141 | 122 | 3/12/2025 |
1.0.27-beta.140 | 127 | 3/10/2025 |
1.0.27-beta.139 | 54 | 2/28/2025 |
1.0.27-beta.138 | 55 | 2/14/2025 |
1.0.26 | 2,545 | 1/27/2025 |
1.0.26-beta.137 | 56 | 2/14/2025 |
1.0.26-beta.136 | 65 | 2/10/2025 |
1.0.26-beta.135 | 70 | 1/27/2025 |
1.0.25 | 508 | 1/14/2025 |
1.0.25-beta.134 | 55 | 1/27/2025 |
1.0.25-beta.133 | 51 | 1/22/2025 |
1.0.25-beta.132 | 56 | 1/22/2025 |
1.0.25-beta.131 | 50 | 1/22/2025 |
1.0.25-beta.130 | 41 | 1/14/2025 |
1.0.25-beta.129 | 43 | 1/14/2025 |
1.0.25-beta.128 | 45 | 1/14/2025 |
1.0.24 | 133 | 1/13/2025 |
1.0.24-beta.127 | 45 | 1/13/2025 |
1.0.24-beta.126 | 46 | 1/13/2025 |
1.0.24-beta.125 | 49 | 1/13/2025 |
1.0.23 | 323 | 1/10/2025 |
1.0.23-beta.124 | 49 | 1/13/2025 |
1.0.23-beta.123 | 45 | 1/12/2025 |
1.0.23-beta.122 | 49 | 1/12/2025 |
1.0.23-beta.121 | 57 | 1/11/2025 |
1.0.23-beta.120 | 47 | 1/10/2025 |
1.0.22-beta.119 | 47 | 1/10/2025 |
1.0.21 | 2,397 | 10/15/2024 |
1.0.21-beta.118 | 45 | 1/10/2025 |
1.0.21-beta.117 | 47 | 1/8/2025 |
1.0.21-beta.116 | 43 | 1/8/2025 |
1.0.21-beta.115 | 63 | 11/2/2024 |
1.0.21-beta.114 | 54 | 10/30/2024 |
1.0.21-beta.113 | 61 | 10/29/2024 |
1.0.21-beta.112 | 57 | 10/29/2024 |
1.0.21-beta.111 | 56 | 10/29/2024 |
1.0.21-beta.110 | 59 | 10/29/2024 |
1.0.21-beta.109 | 71 | 10/22/2024 |
1.0.21-beta.108 | 80 | 10/20/2024 |
1.0.21-beta.107 | 83 | 10/20/2024 |
1.0.21-beta.106 | 79 | 10/20/2024 |
1.0.21-beta.105 | 108 | 10/18/2024 |
1.0.21-beta.104 | 57 | 10/17/2024 |
1.0.21-beta.103 | 56 | 10/17/2024 |
1.0.21-beta.102 | 56 | 10/15/2024 |
1.0.20 | 458 | 10/11/2024 |
1.0.20-beta.101 | 57 | 10/15/2024 |
1.0.20-beta.100 | 59 | 10/15/2024 |
1.0.20-beta.99 | 65 | 10/14/2024 |
1.0.20-beta.98 | 63 | 10/14/2024 |
1.0.20-beta.97 | 56 | 10/14/2024 |
1.0.20-beta.96 | 58 | 10/11/2024 |
1.0.19-beta.95 | 75 | 10/11/2024 |
1.0.19-beta.94 | 96 | 10/11/2024 |
1.0.19-beta.93 | 72 | 10/11/2024 |
1.0.19-beta.92 | 64 | 10/11/2024 |
1.0.19-beta.91 | 86 | 10/11/2024 |
1.0.19-beta.90 | 58 | 10/11/2024 |
1.0.19-beta.89 | 64 | 10/11/2024 |
1.0.18 | 813 | 9/23/2024 |
1.0.18-beta.88 | 64 | 10/11/2024 |
1.0.18-beta.87 | 54 | 10/10/2024 |
1.0.18-beta.86 | 67 | 10/7/2024 |
1.0.18-beta.85 | 57 | 10/6/2024 |
1.0.18-beta.84 | 60 | 10/6/2024 |
1.0.18-beta.83 | 67 | 9/25/2024 |
1.0.18-beta.82 | 58 | 9/24/2024 |
1.0.18-beta.80 | 64 | 9/23/2024 |
1.0.17 | 1,986 | 8/30/2024 |
1.0.17-beta.79 | 60 | 9/23/2024 |
1.0.17-beta.78 | 58 | 9/23/2024 |
1.0.17-beta.77 | 48 | 9/19/2024 |
1.0.17-beta.73 | 74 | 9/17/2024 |
1.0.17-beta.72 | 69 | 9/17/2024 |
1.0.17-beta.71 | 72 | 9/17/2024 |
1.0.17-beta.70 | 72 | 9/17/2024 |
1.0.17-beta.69 | 74 | 9/17/2024 |
1.0.17-beta.68 | 73 | 9/17/2024 |
1.0.17-beta.67 | 67 | 9/16/2024 |
1.0.17-beta.66 | 69 | 9/10/2024 |
1.0.17-beta.65 | 67 | 9/10/2024 |
1.0.17-beta.64 | 72 | 9/5/2024 |
1.0.17-beta.63 | 64 | 9/4/2024 |
1.0.17-beta.62 | 75 | 9/4/2024 |
1.0.17-beta.61 | 65 | 8/30/2024 |
1.0.17-beta.60 | 66 | 8/30/2024 |
1.0.16 | 639 | 8/21/2024 |
1.0.16-beta.59 | 70 | 8/30/2024 |
1.0.16-beta.58 | 61 | 8/29/2024 |
1.0.16-beta.57 | 63 | 8/28/2024 |
1.0.16-beta.56 | 70 | 8/28/2024 |
1.0.16-beta.55 | 73 | 8/28/2024 |
1.0.16-beta.54 | 90 | 8/23/2024 |
1.0.16-beta.53 | 89 | 8/23/2024 |
1.0.16-beta.52 | 90 | 8/22/2024 |
1.0.16-beta.51 | 84 | 8/21/2024 |
1.0.15-beta.50 | 91 | 8/21/2024 |
1.0.15-beta.49 | 112 | 8/21/2024 |
1.0.15-beta.48 | 104 | 8/21/2024 |
1.0.15-beta.47 | 96 | 8/21/2024 |
1.0.15-beta.46 | 75 | 8/21/2024 |
1.0.13 | 399 | 8/15/2024 |
1.0.13-beta.36 | 85 | 8/17/2024 |
1.0.13-beta.35 | 82 | 8/16/2024 |
1.0.13-beta.34 | 89 | 8/16/2024 |
1.0.13-beta.33 | 90 | 8/16/2024 |
1.0.13-beta.32 | 87 | 8/15/2024 |
1.0.13-beta.31 | 84 | 8/15/2024 |
1.0.11 | 135 | 8/14/2024 |
1.0.11-beta.30 | 88 | 8/15/2024 |
1.0.11-beta.29 | 83 | 8/15/2024 |
1.0.11-beta.28 | 81 | 8/14/2024 |
1.0.11-beta.27 | 83 | 8/14/2024 |
1.0.11-beta.26 | 86 | 8/14/2024 |
1.0.10 | 147 | 8/14/2024 |
1.0.10-beta.25 | 89 | 8/14/2024 |
1.0.10-beta.24 | 78 | 8/14/2024 |
1.0.9 | 128 | 8/14/2024 |
1.0.9-beta.23 | 86 | 8/14/2024 |
1.0.8 | 138 | 8/13/2024 |
1.0.8-beta.22 | 82 | 8/13/2024 |
1.0.8-beta.21 | 84 | 8/13/2024 |
1.0.8-beta.20 | 89 | 8/13/2024 |
1.0.8-beta.19 | 82 | 8/13/2024 |
1.0.8-beta.18 | 83 | 8/13/2024 |
1.0.8-beta.17 | 98 | 8/13/2024 |
1.0.7-beta.16 | 84 | 8/6/2024 |
1.0.6 | 103 | 8/5/2024 |
1.0.4-beta.14 | 59 | 8/3/2024 |
1.0.4-beta.13 | 56 | 8/3/2024 |
1.0.4-beta.12 | 58 | 8/3/2024 |
1.0.4-beta.11 | 72 | 8/1/2024 |
1.0.4-beta.10 | 70 | 8/1/2024 |
1.0.3-beta.8 | 62 | 8/1/2024 |
1.0.3-beta.7 | 75 | 8/1/2024 |
1.0.2 | 109 | 7/26/2024 |
1.0.1 | 108 | 7/26/2024 |
1.0.0 | 134 | 7/25/2024 |