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" />
<PackageVersion Include="CSnakes" Version="1.0.17" />
<PackageReference Include="CSnakes" />
paket add CSnakes --version 1.0.17
#r "nuget: CSnakes, 1.0.17"
#:package CSnakes@1.0.17
#addin nuget:?package=CSnakes&version=1.0.17
#tool nuget:?package=CSnakes&version=1.0.17
CSnakes - a tool for embedding Python into .NET projects
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. 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. 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. |
| .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 | 2,616 | 8/30/2024 | |
| 1.0.17-beta.76 | 228 | 9/18/2024 | |
| 1.0.17-beta.75 | 128 | 9/18/2024 | |
| 1.0.17-beta.74 | 132 | 9/18/2024 | |
| 1.0.17-beta.73 | 135 | 9/17/2024 | |
| 1.0.17-beta.72 | 134 | 9/17/2024 | |
| 1.0.17-beta.71 | 146 | 9/17/2024 | |
| 1.0.17-beta.70 | 141 | 9/17/2024 | |
| 1.0.17-beta.69 | 144 | 9/17/2024 | |
| 1.0.17-beta.68 | 142 | 9/17/2024 | |
| 1.0.17-beta.67 | 144 | 9/16/2024 | |
| 1.0.17-beta.66 | 146 | 9/10/2024 | |
| 1.0.17-beta.65 | 129 | 9/10/2024 | |
| 1.0.17-beta.64 | 143 | 9/5/2024 | |
| 1.0.17-beta.63 | 128 | 9/4/2024 | |
| 1.0.17-beta.62 | 143 | 9/4/2024 | |
| 1.0.17-beta.61 | 129 | 8/30/2024 | |
| 1.0.17-beta.60 | 138 | 8/30/2024 | |
| 1.0.16-beta.59 | 141 | 8/30/2024 | |
| 1.0.16-beta.58 | 131 | 8/29/2024 |