pythran
Ahead of Time compiler for numeric kernels
Decision gist · record as of 2026-08-14
Yes, if you have scientific Python code with numeric bottlenecks and are willing to annotate function signatures. The package is actively maintained, has low install friction, and requires only standard dependencies. The main gotcha is platform-specific setup (C++ compiler and BLAS libraries); verify those are available before installing. The unclear license treatment warrants a quick review of your project's compliance requirements.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.7 or later.
- Platform-specific C++ compiler and BLAS library (libatlas, openblas, etc.) must be installed separately; see platform-specific installation notes in documentation.
- Low install friction with a pure-wheel distribution.
License · maintenance · safety
(unclear) — License treatment is unclear—the package uses a BSD-style license, but the SPDX identifier is not formally declared. Verify the exact terms apply to your use case before depending on it in proprietary or restricted-license projects.
last release 2025-11-15 (272 days) · last repo commit 2026-08-12 · 2,141 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 854,351 downloads/mo, #4,895 on PyPI
Alternatives
Verify before relying
pip install pythran
# Annotate a Python module with type hints:
# #pythran export dprod(int list, int list)
# def dprod(l0, l1):
# return sum(x * y for x, y in zip(l0, l1))
# Compile to native module:
# pythran dprod.py
# Then import the compiled result as a normal Python module- Whether the BSD-style license in license_raw is formally equivalent to a standard SPDX identifier and what that means for your project's compliance.
- Performance gains on your specific workload—Pythran targets scientific computing but actual speedup depends on code patterns and hardware.
What it is and what it does
Pythran is an ahead-of-time compiler for a subset of Python, designed to accelerate scientific computing code. You write Python functions with type annotations (via special comments), run the Pythran compiler on your module, and get back a native Python extension that drops in as a replacement. It leverages multi-core and SIMD capabilities to speed up numeric kernels.
The package depends on numpy, gast (for AST manipulation), beniget (for scope analysis), ply (for parsing), and setuptools. It requires Python 3.7 or later and a C++ compiler plus BLAS libraries on your system. The project is actively maintained and is used in scientific Python workflows where pure Python or even NumPy alone is too slow.
Use it for
- Accelerate tight numeric loops in scientific simulations without rewriting in C or Cython.
- Compile array-heavy functions that use NumPy operations into native code for multi-core execution.
- Optimize linear algebra and matrix operations by leveraging SIMD and BLAS libraries.
- Speed up data processing pipelines in research code where Python is the primary language.
- Parallelize embarrassingly parallel numeric kernels across CPU cores automatically.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you have scientific Python code with numeric bottlenecks and are willing to annotate function signatures.
The package is actively maintained, has low install friction, and requires only standard dependencies. The main gotcha is platform-specific setup (C++ compiler and BLAS libraries); verify those are available before installing. The unclear license treatment warrants a quick review of your project's compliance requirements.
Install
pythran on PyPI
Before you install
Low install friction with a pure-wheel distribution. The package is actively maintained with a recent release and an active repository. Runtime dependencies are all well-established Python packages (ply, setuptools, gast, numpy, beniget), though system-level C++ compilation tools and BLAS libraries may be required depending on your platform.
Requires Python 3.7 or later. Platform-specific C++ compiler and BLAS library (libatlas, openblas, etc.) must be installed separately; see platform-specific installation notes in documentation.
License in practice
License treatment is unclear—the package uses a BSD-style license, but the SPDX identifier is not formally declared. Verify the exact terms apply to your use case before depending on it in proprietary or restricted-license projects.
Quickstart
pip install pythran
# Annotate a Python module with type hints:
# #pythran export dprod(int list, int list)
# def dprod(l0, l1):
# return sum(x * y for x, y in zip(l0, l1))
# Compile to native module:
# pythran dprod.py
# Then import the compiled result as a normal Python module
Verify before relying
- Whether the BSD-style license in license_raw is formally equivalent to a standard SPDX identifier and what that means for your project's compliance.
- Performance gains on your specific workload—Pythran targets scientific computing but actual speedup depends on code patterns and hardware.
Package facts
| License | Not declared unclear |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagesplysetuptoolsgastnumpybeniget |
| Maintenance | Actively maintained 272 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 854,351 / month, #4,895 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: MacOSOperating System :: POSIX :: LinuxProgramming Language :: C++Programming Language :: Python :: 3Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Code GeneratorsTopic :: Software Development :: Compilers |
Evidence: pythran-0.18.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “python to native code compiler”
- pythranPythran is an ahead-of-time compiler that converts annotated Python…
- CythonCython is a source code translator that compiles Python code to C,…
- xdslxDSL is a Python framework for building compiler infrastructure using…
Give your agent the search over MCP, or paste the wish link into any chat.
More Code Generators packages
Proto Plus wraps protocol buffers to provide Python classes that behave like native Python types while maintaining protocol buffer serialization and schema validation.
Install it if you're working with protocol buffers in Python and want a more Pythonic interface, or if you're using Google Cloud libraries that depend on it.
Cython is a source code translator that compiles Python code to C, enabling optional static typing and direct C/C++ interoperability to generate efficient native extensions.
Install it if you need to optimize Python performance, wrap C/C++ libraries, or build fast native extensions.
Annotates Python abstract syntax trees with the positions of tokens and source code text, enabling tools to map AST nodes back to their originating code for refactoring, analysis, and transformation.
Beartype is a runtime type checker that validates Python type hints at function call time, catching type violations before they cause downstream bugs.
Install it if you want runtime type safety for your annotated code or need to validate type hints on third-party packages.
llvmlite provides a lightweight Python binding to LLVM's IR builder, optimizer, and JIT compiler APIs, enabling you to write JIT compilers and code generators without needing the full LLVM C++ API surface.
astor converts Python abstract syntax trees (ASTs) back to readable source code and provides tools for AST manipulation, inspection, and non-recursive tree traversal.
Install it if you need AST round-tripping or advanced tree inspection.
See also Nuitka · nvidia-cuda-nvrtc · meson-python · numpy-minmax · nvidia-cuda-nvcc · numba · SCons · memray · librt · ManimPango