CSnakes 1.0.17-beta.76

Suggested Alternatives

CSnakes.Runtime

Additional Details

This has been merged into a single package, CSnakes.Runtime.

This is a prerelease version of CSnakes.
There is a newer version of this package available.
See the version list below for details.
dotnet add package CSnakes --version 1.0.17-beta.76                
NuGet\Install-Package CSnakes -Version 1.0.17-beta.76                
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" Version="1.0.17-beta.76">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CSnakes --version 1.0.17-beta.76                
#r "nuget: CSnakes, 1.0.17-beta.76"                
#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 as a Cake Addin
#addin nuget:?package=CSnakes&version=1.0.17-beta.76&prerelease

// Install CSnakes as a Cake Tool
#tool nuget:?package=CSnakes&version=1.0.17-beta.76&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.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

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,241 8/30/2024 1.0.17 is deprecated because it is no longer maintained.
1.0.17-beta.76 165 9/18/2024 1.0.17-beta.76 is deprecated because it is no longer maintained.
1.0.17-beta.75 67 9/18/2024 1.0.17-beta.75 is deprecated because it is no longer maintained.
1.0.17-beta.74 66 9/18/2024 1.0.17-beta.74 is deprecated because it is no longer maintained.
1.0.17-beta.73 73 9/17/2024 1.0.17-beta.73 is deprecated because it is no longer maintained.
1.0.17-beta.72 65 9/17/2024 1.0.17-beta.72 is deprecated because it is no longer maintained.
1.0.17-beta.71 75 9/17/2024 1.0.17-beta.71 is deprecated because it is no longer maintained.
1.0.17-beta.70 71 9/17/2024 1.0.17-beta.70 is deprecated because it is no longer maintained.
1.0.17-beta.69 75 9/17/2024 1.0.17-beta.69 is deprecated because it is no longer maintained.
1.0.17-beta.68 73 9/17/2024 1.0.17-beta.68 is deprecated because it is no longer maintained.
1.0.17-beta.67 67 9/16/2024 1.0.17-beta.67 is deprecated because it is no longer maintained.
1.0.17-beta.66 71 9/10/2024 1.0.17-beta.66 is deprecated because it is no longer maintained.
1.0.17-beta.65 68 9/10/2024 1.0.17-beta.65 is deprecated because it is no longer maintained.
1.0.17-beta.64 75 9/5/2024 1.0.17-beta.64 is deprecated because it is no longer maintained.
1.0.17-beta.63 66 9/4/2024 1.0.17-beta.63 is deprecated because it is no longer maintained.
1.0.17-beta.62 75 9/4/2024 1.0.17-beta.62 is deprecated because it is no longer maintained.
1.0.17-beta.61 65 8/30/2024 1.0.17-beta.61 is deprecated because it is no longer maintained.
1.0.17-beta.60 67 8/30/2024 1.0.17-beta.60 is deprecated because it is no longer maintained.
1.0.16 669 8/21/2024 1.0.16 is deprecated because it is no longer maintained.
1.0.16-beta.59 68 8/30/2024 1.0.16-beta.59 is deprecated because it is no longer maintained.
1.0.16-beta.58 65 8/29/2024 1.0.16-beta.58 is deprecated because it is no longer maintained.
1.0.16-beta.57 67 8/28/2024 1.0.16-beta.57 is deprecated because it is no longer maintained.
1.0.16-beta.56 70 8/28/2024 1.0.16-beta.56 is deprecated because it is no longer maintained.
1.0.16-beta.55 63 8/28/2024 1.0.16-beta.55 is deprecated because it is no longer maintained.
1.0.16-beta.54 92 8/23/2024 1.0.16-beta.54 is deprecated because it is no longer maintained.
1.0.16-beta.53 89 8/23/2024 1.0.16-beta.53 is deprecated because it is no longer maintained.
1.0.16-beta.52 90 8/22/2024 1.0.16-beta.52 is deprecated because it is no longer maintained.
1.0.16-beta.51 88 8/21/2024 1.0.16-beta.51 is deprecated because it is no longer maintained.
1.0.15 382 8/19/2024 1.0.15 is deprecated because it is no longer maintained.
1.0.15-beta.50 91 8/21/2024 1.0.15-beta.50 is deprecated because it is no longer maintained.
1.0.15-beta.49 89 8/21/2024 1.0.15-beta.49 is deprecated because it is no longer maintained.
1.0.15-beta.48 91 8/21/2024 1.0.15-beta.48 is deprecated because it is no longer maintained.
1.0.15-beta.47 95 8/21/2024 1.0.15-beta.47 is deprecated because it is no longer maintained.
1.0.15-beta.46 94 8/21/2024 1.0.15-beta.46 is deprecated because it is no longer maintained.
1.0.15-beta.45 90 8/20/2024 1.0.15-beta.45 is deprecated because it is no longer maintained.
1.0.15-beta.44 98 8/20/2024 1.0.15-beta.44 is deprecated because it is no longer maintained.
1.0.15-beta.43 88 8/20/2024 1.0.15-beta.43 is deprecated because it is no longer maintained.
1.0.15-beta.42 93 8/20/2024 1.0.15-beta.42 is deprecated because it is no longer maintained.
1.0.15-beta.41 91 8/19/2024 1.0.15-beta.41 is deprecated because it is no longer maintained.
1.0.15-beta.40 107 8/19/2024 1.0.15-beta.40 is deprecated because it is no longer maintained.
1.0.14-beta.39 113 8/19/2024 1.0.14-beta.39 is deprecated because it is no longer maintained.
1.0.14-beta.38 90 8/19/2024 1.0.14-beta.38 is deprecated because it is no longer maintained.
1.0.14-beta.37 89 8/19/2024 1.0.14-beta.37 is deprecated because it is no longer maintained.
1.0.13 178 8/15/2024 1.0.13 is deprecated because it is no longer maintained.
1.0.13-beta.36 85 8/17/2024 1.0.13-beta.36 is deprecated because it is no longer maintained.
1.0.13-beta.35 79 8/16/2024 1.0.13-beta.35 is deprecated because it is no longer maintained.
1.0.13-beta.34 85 8/16/2024 1.0.13-beta.34 is deprecated because it is no longer maintained.
1.0.13-beta.33 85 8/16/2024 1.0.13-beta.33 is deprecated because it is no longer maintained.
1.0.13-beta.32 84 8/15/2024 1.0.13-beta.32 is deprecated because it is no longer maintained.
1.0.13-beta.31 85 8/15/2024 1.0.13-beta.31 is deprecated because it is no longer maintained.
1.0.11 142 8/14/2024 1.0.11 is deprecated because it is no longer maintained.
1.0.11-beta.30 89 8/15/2024 1.0.11-beta.30 is deprecated because it is no longer maintained.
1.0.11-beta.29 87 8/15/2024 1.0.11-beta.29 is deprecated because it is no longer maintained.
1.0.11-beta.28 82 8/14/2024 1.0.11-beta.28 is deprecated because it is no longer maintained.
1.0.11-beta.27 85 8/14/2024 1.0.11-beta.27 is deprecated because it is no longer maintained.
1.0.11-beta.26 88 8/14/2024 1.0.11-beta.26 is deprecated because it is no longer maintained.
1.0.10 142 8/14/2024 1.0.10 is deprecated because it is no longer maintained.
1.0.10-beta.25 87 8/14/2024 1.0.10-beta.25 is deprecated because it is no longer maintained.
1.0.10-beta.24 82 8/14/2024 1.0.10-beta.24 is deprecated because it is no longer maintained.
1.0.9 144 8/14/2024 1.0.9 is deprecated because it is no longer maintained.
1.0.9-beta.23 84 8/14/2024 1.0.9-beta.23 is deprecated because it is no longer maintained.
1.0.8 151 8/13/2024 1.0.8 is deprecated because it is no longer maintained.
1.0.8-beta.22 83 8/13/2024 1.0.8-beta.22 is deprecated because it is no longer maintained.
1.0.8-beta.21 84 8/13/2024 1.0.8-beta.21 is deprecated because it is no longer maintained.
1.0.8-beta.20 91 8/13/2024 1.0.8-beta.20 is deprecated because it is no longer maintained.
1.0.8-beta.19 90 8/13/2024 1.0.8-beta.19 is deprecated because it is no longer maintained.
1.0.8-beta.18 85 8/13/2024 1.0.8-beta.18 is deprecated because it is no longer maintained.
1.0.8-beta.17 95 8/13/2024 1.0.8-beta.17 is deprecated because it is no longer maintained.
1.0.7-beta.16 84 8/6/2024 1.0.7-beta.16 is deprecated because it is no longer maintained.
1.0.6 96 8/5/2024 1.0.6 is deprecated because it is no longer maintained.
1.0.4-beta.14 60 8/3/2024 1.0.4-beta.14 is deprecated because it is no longer maintained.
1.0.4-beta.13 58 8/3/2024 1.0.4-beta.13 is deprecated because it is no longer maintained.
1.0.4-beta.12 58 8/3/2024 1.0.4-beta.12 is deprecated because it is no longer maintained.
1.0.4-beta.11 71 8/1/2024 1.0.4-beta.11 is deprecated because it is no longer maintained.
1.0.4-beta.10 71 8/1/2024 1.0.4-beta.10 is deprecated because it is no longer maintained.
1.0.3-beta.8 65 8/1/2024 1.0.3-beta.8 is deprecated because it is no longer maintained.
1.0.3-beta.7 66 8/1/2024 1.0.3-beta.7 is deprecated because it is no longer maintained.
1.0.2 121 7/26/2024 1.0.2 is deprecated because it is no longer maintained.
1.0.1 108 7/26/2024 1.0.1 is deprecated because it is no longer maintained.
1.0.0 102 7/25/2024 1.0.0 is deprecated because it is no longer maintained.