--- id: pythonnet version: "3.1.0" license: MIT license_treatment: permissive maintenance: active --- # pythonnet — .NET and Mono integration for Python License: permissive · Maintenance: active · Downloads: 3.6M/mo ## What it is and what it does pythonnet bridges Python and the .NET Common Language Runtime, enabling two-way integration: Python code can import and call .NET namespaces and assemblies as if they were Python packages, while .NET applications can initialize a Python engine and invoke Python modules dynamically. It treats CLR namespaces as Python packages and provides a clr module for loading assemblies and managing the runtime. The package supports multiple runtimes—Mono on Linux/macOS and .NET Framework on Windows by default, with .NET Core available via environment variable or explicit load call. For embedding Python in .NET, it requires setting the Python DLL path and managing thread access through a GIL context manager. It is actively maintained, supports modern Python versions (3.10–3.14), and has no known security vulnerabilities. Use it for: - Call Windows Forms or WPF UI libraries from Python scripts to build GUI applications with .NET components. - Embed Python in a C# application to allow dynamic scripting or plugin functionality without rewriting core logic. - Access .NET data structures and business logic from Python data science or automation workflows. - Prototype or test .NET libraries interactively from Python before integrating them into larger .NET projects. - Migrate legacy Python code to .NET incrementally by calling existing Python modules from new C# code. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. pythonnet enables Python code to call .NET and Mono libraries directly, and allows .NET applications to embed and invoke Python code with full CLR interoperability. Yes, if you need to integrate Python with .NET or Mono. The package is production-stable, actively maintained, has low install friction, carries a permissive MIT license, and has no known vulnerabilities. The main constraint is the requirement for a .NET runtime on the target system; verify that your deployment environment has the necessary .NET/Mono installation before committing. ## Install pip install pythonnet uv add pythonnet poetry add pythonnet ## Installing pythonnet Before you install: Low friction install with a single runtime dependency (clr_loader). Active maintenance with recent commits and production-stable status. Supports Python 3.10 through 3.14. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both commercial and open-source projects. Quickstart: pip install pythonnet import clr clr.AddReference("System.Windows.Forms") .NET Framework, .NET Core, or Mono must be installed on the system; on Linux/macOS, Mono is used by default unless PYTHONNET_RUNTIME=coreclr is set. Verify before relying: - Performance overhead of CLR interop calls compared to native .NET or pure Python - Completeness of type mapping between Python and CLR for complex generic types - Thread-safety guarantees beyond the documented GIL usage pattern ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 3.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags .NET integration from Python, call C# from Python, Python CLR interop, embed Python in .NET, Mono integration Python, Python .NET bridge, CLR namespace access, interop, dotnet-integration, clr-bridge [View on SkillFed](https://skillfed.io/packages/pythonnet) · [View on PyPI](https://pypi.org/project/pythonnet/)