CSnakes 1.0.17
This has been merged into a single package, CSnakes.Runtime.
dotnet add package CSnakes --version 1.0.17
NuGet\Install-Package CSnakes -Version 1.0.17
<PackageReference Include="CSnakes" Version="1.0.17" />
paket add CSnakes --version 1.0.17
#r "nuget: CSnakes, 1.0.17"
// Install CSnakes as a Cake Addin #addin nuget:?package=CSnakes&version=1.0.17 // Install CSnakes as a Cake Tool #tool nuget:?package=CSnakes&version=1.0.17
CSnakes - a tool for embedding Python into .NET projects
[!WARNING]
This project is in prototype stage and the API is subject to change.
<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
- .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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.CodeAnalysis.CSharp (>= 4.9.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
1.0.17 | 1,237 | 8/30/2024 | |
1.0.17-beta.76 | 164 | 9/18/2024 | |
1.0.17-beta.75 | 66 | 9/18/2024 | |
1.0.17-beta.74 | 65 | 9/18/2024 | |
1.0.17-beta.73 | 72 | 9/17/2024 | |
1.0.17-beta.72 | 64 | 9/17/2024 | |
1.0.17-beta.71 | 74 | 9/17/2024 | |
1.0.17-beta.70 | 68 | 9/17/2024 | |
1.0.17-beta.69 | 74 | 9/17/2024 | |
1.0.17-beta.68 | 72 | 9/17/2024 | |
1.0.17-beta.67 | 66 | 9/16/2024 | |
1.0.17-beta.66 | 68 | 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 | 65 | 9/4/2024 | |
1.0.17-beta.62 | 74 | 9/4/2024 | |
1.0.17-beta.61 | 61 | 8/30/2024 | |
1.0.17-beta.60 | 65 | 8/30/2024 | |
1.0.16 | 668 | 8/21/2024 | |
1.0.16-beta.59 | 66 | 8/30/2024 | |
1.0.16-beta.58 | 63 | 8/29/2024 | |
1.0.16-beta.57 | 66 | 8/28/2024 | |
1.0.16-beta.56 | 69 | 8/28/2024 | |
1.0.16-beta.55 | 62 | 8/28/2024 | |
1.0.16-beta.54 | 91 | 8/23/2024 | |
1.0.16-beta.53 | 88 | 8/23/2024 | |
1.0.16-beta.52 | 89 | 8/22/2024 | |
1.0.16-beta.51 | 87 | 8/21/2024 | |
1.0.15 | 381 | 8/19/2024 | |
1.0.15-beta.50 | 90 | 8/21/2024 | |
1.0.15-beta.49 | 88 | 8/21/2024 | |
1.0.15-beta.48 | 90 | 8/21/2024 | |
1.0.15-beta.47 | 94 | 8/21/2024 | |
1.0.15-beta.46 | 93 | 8/21/2024 | |
1.0.15-beta.45 | 89 | 8/20/2024 | |
1.0.15-beta.44 | 97 | 8/20/2024 | |
1.0.15-beta.43 | 87 | 8/20/2024 | |
1.0.15-beta.42 | 92 | 8/20/2024 | |
1.0.15-beta.41 | 90 | 8/19/2024 | |
1.0.15-beta.40 | 106 | 8/19/2024 | |
1.0.14-beta.39 | 112 | 8/19/2024 | |
1.0.14-beta.38 | 89 | 8/19/2024 | |
1.0.14-beta.37 | 88 | 8/19/2024 | |
1.0.13 | 177 | 8/15/2024 | |
1.0.13-beta.36 | 84 | 8/17/2024 | |
1.0.13-beta.35 | 78 | 8/16/2024 | |
1.0.13-beta.34 | 84 | 8/16/2024 | |
1.0.13-beta.33 | 84 | 8/16/2024 | |
1.0.13-beta.32 | 83 | 8/15/2024 | |
1.0.13-beta.31 | 84 | 8/15/2024 | |
1.0.11 | 139 | 8/14/2024 | |
1.0.11-beta.30 | 88 | 8/15/2024 | |
1.0.11-beta.29 | 86 | 8/15/2024 | |
1.0.11-beta.28 | 81 | 8/14/2024 | |
1.0.11-beta.27 | 84 | 8/14/2024 | |
1.0.11-beta.26 | 87 | 8/14/2024 | |
1.0.10 | 141 | 8/14/2024 | |
1.0.10-beta.25 | 86 | 8/14/2024 | |
1.0.10-beta.24 | 81 | 8/14/2024 | |
1.0.9 | 143 | 8/14/2024 | |
1.0.9-beta.23 | 83 | 8/14/2024 | |
1.0.8 | 150 | 8/13/2024 | |
1.0.8-beta.22 | 82 | 8/13/2024 | |
1.0.8-beta.21 | 83 | 8/13/2024 | |
1.0.8-beta.20 | 90 | 8/13/2024 | |
1.0.8-beta.19 | 89 | 8/13/2024 | |
1.0.8-beta.18 | 84 | 8/13/2024 | |
1.0.8-beta.17 | 94 | 8/13/2024 | |
1.0.7-beta.16 | 83 | 8/6/2024 | |
1.0.6 | 95 | 8/5/2024 | |
1.0.4-beta.14 | 59 | 8/3/2024 | |
1.0.4-beta.13 | 57 | 8/3/2024 | |
1.0.4-beta.12 | 57 | 8/3/2024 | |
1.0.4-beta.11 | 70 | 8/1/2024 | |
1.0.4-beta.10 | 68 | 8/1/2024 | |
1.0.3-beta.8 | 64 | 8/1/2024 | |
1.0.3-beta.7 | 65 | 8/1/2024 | |
1.0.2 | 120 | 7/26/2024 | |
1.0.1 | 107 | 7/26/2024 | |
1.0.0 | 99 | 7/25/2024 |