Albatross.CodeGen.Python
9.0.2
Prefix Reserved
This package has a SemVer 2.0.0 package version: 9.0.2+ff7cf30.
dotnet add package Albatross.CodeGen.Python --version 9.0.2
NuGet\Install-Package Albatross.CodeGen.Python -Version 9.0.2
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="Albatross.CodeGen.Python" Version="9.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Albatross.CodeGen.Python" Version="9.0.2" />
<PackageReference Include="Albatross.CodeGen.Python" />
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 Albatross.CodeGen.Python --version 9.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Albatross.CodeGen.Python, 9.0.2"
#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 Albatross.CodeGen.Python@9.0.2
#: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=Albatross.CodeGen.Python&version=9.0.2
#tool nuget:?package=Albatross.CodeGen.Python&version=9.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Albatross.CodeGen.Python
Python code generation library that provides expressions, declarations, and type converters for generating Python source code from C# type symbols. Used by the web client generators to produce Python dataclasses, type hints, and async HTTP client implementations.
Key Features
- Python declarations: classes, methods, enums, constructors, fields, properties
- Expression support: await, decorators, list comprehensions, dictionaries, tuples
- Import statement generation with proper module organization
- Type converters for C# to Python type mapping (int, str, bool, datetime, Decimal, etc.)
- Full type hint generation for modern Python
- Async/await support for async HTTP clients
Quick Start
using Albatross.CodeGen.Python.Declarations;
using Albatross.CodeGen.Python.Expressions;
// Create a Python class declaration
var classDecl = new ClassDeclaration("User")
.AddField(new FieldDeclaration("id", new SimpleTypeExpression("int")))
.AddField(new FieldDeclaration("name", new SimpleTypeExpression("str")));
// Generate the Python code
using var writer = new StringWriter();
classDecl.Generate(writer);
Dependencies
- Albatross.CodeGen (project reference)
- Albatross.CodeGen.SymbolProviders (project reference)
- Albatross.CodeAnalysis 8.0.3
- Albatross.Collections 8.0.1
- Microsoft.CodeAnalysis.CSharp 5.0.0
Source Code
NuGet Package
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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.
-
net10.0
- Albatross.CodeAnalysis (>= 8.0.3)
- Albatross.CodeGen (>= 9.0.2)
- Albatross.CodeGen.SymbolProviders (>= 9.0.2)
- Albatross.Collections (>= 8.0.1)
- Microsoft.CodeAnalysis.CSharp (>= 5.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Albatross.CodeGen.Python:
| Package | Downloads |
|---|---|
|
Albatross.CodeGen.WebClient
This assembly contains code generator that can generate C# and TypeScript Proxies from AspNetCore controller classes |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 9.0.2 | 28 | 2/12/2026 |
| 9.0.2-200.main | 28 | 1/30/2026 |
| 9.0.1 | 43 | 1/9/2026 |
| 9.0.1-190.main | 34 | 1/8/2026 |
| 9.0.1-185.main | 36 | 1/4/2026 |
| 9.0.1-168.main | 33 | 12/31/2025 |
| 9.0.1-165.main | 42 | 12/31/2025 |
| 9.0.1-164.main | 36 | 12/25/2025 |
| 9.0.1-154.main | 47 | 12/24/2025 |
| 9.0.1-148.main | 39 | 12/22/2025 |
| 9.0.1-60.main | 78 | 11/21/2025 |
| 9.0.1-55.main | 66 | 11/19/2025 |
| 9.0.0-50.main | 69 | 11/11/2025 |