--- id: pythran version: "0.18.1" license: Copyright (c) 2012, HPC Project and Serge Guelton All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following… (full text in the JSON record) license_treatment: unclear maintenance: active --- # pythran — Ahead of Time compiler for numeric kernels License: unclear · Maintenance: active · Downloads: 854.4K/mo ## 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 above — verify before relying. Pythran is an ahead-of-time compiler that converts annotated Python functions into optimized native code, targeting scientific computing workloads with support for multi-core and SIMD execution. 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 pip install pythran uv add pythran poetry add pythran ## Installing pythran 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. 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 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. 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: Copyright (c) 2012, HPC Project and Serge Guelton All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following… (full text in the JSON record) (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 854.4K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags python to native code compiler, scientific python optimization, ahead of time compilation, numpy acceleration, python performance compiler, scientific-computing, performance-optimization, jit-compilation [View on SkillFed](https://skillfed.io/packages/pythran) · [View on PyPI](https://pypi.org/project/pythran/)