pythran


Namepythran JSON
Version 0.15.0 PyPI version JSON
download
home_page
SummaryAhead of Time compiler for numeric kernels
upload_time2024-01-07 21:21:42
maintainer
docs_urlNone
author
requires_python>=3.7
licenseCopyright (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 conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of HPCProject, Serge Guelton nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Pythran
#######

https://pythran.readthedocs.io

What is it?
-----------

Pythran is an ahead of time compiler for a subset of the Python language, with a
focus on scientific computing. It takes a Python module annotated with a few
interface descriptions and turns it into a native Python module with the same
interface, but (hopefully) faster.

It is meant to efficiently compile **scientific programs**, and takes advantage
of multi-cores and SIMD instruction units.

Until 0.9.5 (included), Pythran was supporting Python 3 and Python 2.7.
It now only supports Python **3**.

Installation
------------

Pythran sources are hosted on https://github.com/serge-sans-paille/pythran.

Pythran releases are hosted on https://pypi.python.org/pypi/pythran.

Pythran is available on conda-forge on https://anaconda.org/conda-forge/pythran.

Debian/Ubuntu
=============

Using ``pip``
*************

1. Gather dependencies:

   Pythran depends on a few Python modules and several C++ libraries. On a debian-like platform, run::

        $> sudo apt-get install libatlas-base-dev
        $> sudo apt-get install python-dev python-ply python-numpy

2. Install with ``pip``::

        $> pip install pythran

Using ``mamba`` or ``conda``
****************************

1. Using ``mamba`` (https://github.com/conda-forge/miniforge#mambaforge) or ``conda`` (https://github.com/conda-forge/miniforge)
 
2. Run::

       $> mamba install -c conda-forge pythran

   or::

       $> conda install -c conda-forge pythran

Mac OSX
=======

Using brew (https://brew.sh/)::

    $> pip install pythran
    $> brew install openblas
    $> printf '[compiler]\nblas=openblas\ninclude_dirs=/usr/local/opt/openblas/include\nlibrary_dirs=/usr/local/opt/openblas/lib' > ~/.pythranrc

Depending on your setup, you may need to add the following to your ``~/.pythranrc`` file::

    [compiler]
    CXX=g++-4.9
    CC=gcc-4.9

ArchLinux
=========

Using ``pacman``::

    $> pacman -S python-pythran


Fedora
======

Using ``dnf``::

    $> dnf install pythran

Windows
=======

Windows support is on going and only targets Python 3.5+ with either Visual Studio 2017 or, better, clang-cl::

    $> pip install pythran

Note that using ``clang-cl.exe`` is the default setting. It can be changed
through the ``CXX`` and ``CC`` environment variables.


Other Platform
==============

See MANUAL file.


Basic Usage
-----------

A simple pythran input could be ``dprod.py``

.. code-block:: python

    """
    Naive dotproduct! Pythran supports numpy.dot
    """
    #pythran export dprod(int list, int list)
    def dprod(l0,l1):
        """WoW, generator expression, zip and sum."""
        return sum(x * y for x, y in zip(l0, l1))


To turn it into a native module, run::

    $> pythran dprod.py

That will generate a native dprod.so that can be imported just like the former
module::

    $> python -c 'import dprod' # this imports the native module instead


Documentation
-------------

The user documentation is available in the MANUAL file from the doc directory.

The developer documentation is available in the DEVGUIDE file from the doc
directory. There is also a TUTORIAL file for those who don't like reading
documentation.

The CLI documentation is available from the pythran help command::

    $> pythran --help

Some extra developer documentation is also available using pydoc. Beware, this
is the computer science incarnation for the famous Where's Waldo? game::

    $> pydoc pythran
    $> pydoc pythran.typing
    $> pydoc -b  # in the browser


Examples
--------

See the ``pythran/tests/cases/`` directory from the sources.


Contact
-------

Praise, flame and cookies:

- pythran@freelists.org -- register at https://www.freelists.org/list/pythran first!

- #pythran on OFTC, https://oftc.net 

- serge.guelton@telecom-bretagne.eu

The mailing list archive is available at https://www.freelists.org/archive/pythran/.

Citing
------

If you need to cite a Pythran paper, feel free to use

.. code-block:: bibtex

    @article{guelton2015pythran,
      title={Pythran: Enabling static optimization of scientific python programs},
      author={Guelton, Serge and Brunet, Pierrick and Amini, Mehdi and Merlini,
                      Adrien and Corbillon, Xavier and Raynaud, Alan},
      journal={Computational Science \& Discovery},
      volume={8},
      number={1},
      pages={014001},
      year={2015},
      publisher={IOP Publishing}
    }


Authors
-------

See AUTHORS file.

License
-------

See LICENSE file.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pythran",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "Serge Guelton <serge.guelton@telecom-bretagne.eu>",
    "download_url": "https://files.pythonhosted.org/packages/82/31/cc6fd7a2b91efc6cdb03e7c42df895b4a65a8f049b074579d45d1def746f/pythran-0.15.0.tar.gz",
    "platform": null,
    "description": "Pythran\n#######\n\nhttps://pythran.readthedocs.io\n\nWhat is it?\n-----------\n\nPythran is an ahead of time compiler for a subset of the Python language, with a\nfocus on scientific computing. It takes a Python module annotated with a few\ninterface descriptions and turns it into a native Python module with the same\ninterface, but (hopefully) faster.\n\nIt is meant to efficiently compile **scientific programs**, and takes advantage\nof multi-cores and SIMD instruction units.\n\nUntil 0.9.5 (included), Pythran was supporting Python 3 and Python 2.7.\nIt now only supports Python **3**.\n\nInstallation\n------------\n\nPythran sources are hosted on https://github.com/serge-sans-paille/pythran.\n\nPythran releases are hosted on https://pypi.python.org/pypi/pythran.\n\nPythran is available on conda-forge on https://anaconda.org/conda-forge/pythran.\n\nDebian/Ubuntu\n=============\n\nUsing ``pip``\n*************\n\n1. Gather dependencies:\n\n   Pythran depends on a few Python modules and several C++ libraries. On a debian-like platform, run::\n\n        $> sudo apt-get install libatlas-base-dev\n        $> sudo apt-get install python-dev python-ply python-numpy\n\n2. Install with ``pip``::\n\n        $> pip install pythran\n\nUsing ``mamba`` or ``conda``\n****************************\n\n1. Using ``mamba`` (https://github.com/conda-forge/miniforge#mambaforge) or ``conda`` (https://github.com/conda-forge/miniforge)\n \n2. Run::\n\n       $> mamba install -c conda-forge pythran\n\n   or::\n\n       $> conda install -c conda-forge pythran\n\nMac OSX\n=======\n\nUsing brew (https://brew.sh/)::\n\n    $> pip install pythran\n    $> brew install openblas\n    $> printf '[compiler]\\nblas=openblas\\ninclude_dirs=/usr/local/opt/openblas/include\\nlibrary_dirs=/usr/local/opt/openblas/lib' > ~/.pythranrc\n\nDepending on your setup, you may need to add the following to your ``~/.pythranrc`` file::\n\n    [compiler]\n    CXX=g++-4.9\n    CC=gcc-4.9\n\nArchLinux\n=========\n\nUsing ``pacman``::\n\n    $> pacman -S python-pythran\n\n\nFedora\n======\n\nUsing ``dnf``::\n\n    $> dnf install pythran\n\nWindows\n=======\n\nWindows support is on going and only targets Python 3.5+ with either Visual Studio 2017 or, better, clang-cl::\n\n    $> pip install pythran\n\nNote that using ``clang-cl.exe`` is the default setting. It can be changed\nthrough the ``CXX`` and ``CC`` environment variables.\n\n\nOther Platform\n==============\n\nSee MANUAL file.\n\n\nBasic Usage\n-----------\n\nA simple pythran input could be ``dprod.py``\n\n.. code-block:: python\n\n    \"\"\"\n    Naive dotproduct! Pythran supports numpy.dot\n    \"\"\"\n    #pythran export dprod(int list, int list)\n    def dprod(l0,l1):\n        \"\"\"WoW, generator expression, zip and sum.\"\"\"\n        return sum(x * y for x, y in zip(l0, l1))\n\n\nTo turn it into a native module, run::\n\n    $> pythran dprod.py\n\nThat will generate a native dprod.so that can be imported just like the former\nmodule::\n\n    $> python -c 'import dprod' # this imports the native module instead\n\n\nDocumentation\n-------------\n\nThe user documentation is available in the MANUAL file from the doc directory.\n\nThe developer documentation is available in the DEVGUIDE file from the doc\ndirectory. There is also a TUTORIAL file for those who don't like reading\ndocumentation.\n\nThe CLI documentation is available from the pythran help command::\n\n    $> pythran --help\n\nSome extra developer documentation is also available using pydoc. Beware, this\nis the computer science incarnation for the famous Where's Waldo? game::\n\n    $> pydoc pythran\n    $> pydoc pythran.typing\n    $> pydoc -b  # in the browser\n\n\nExamples\n--------\n\nSee the ``pythran/tests/cases/`` directory from the sources.\n\n\nContact\n-------\n\nPraise, flame and cookies:\n\n- pythran@freelists.org -- register at https://www.freelists.org/list/pythran first!\n\n- #pythran on OFTC, https://oftc.net \n\n- serge.guelton@telecom-bretagne.eu\n\nThe mailing list archive is available at https://www.freelists.org/archive/pythran/.\n\nCiting\n------\n\nIf you need to cite a Pythran paper, feel free to use\n\n.. code-block:: bibtex\n\n    @article{guelton2015pythran,\n      title={Pythran: Enabling static optimization of scientific python programs},\n      author={Guelton, Serge and Brunet, Pierrick and Amini, Mehdi and Merlini,\n                      Adrien and Corbillon, Xavier and Raynaud, Alan},\n      journal={Computational Science \\& Discovery},\n      volume={8},\n      number={1},\n      pages={014001},\n      year={2015},\n      publisher={IOP Publishing}\n    }\n\n\nAuthors\n-------\n\nSee AUTHORS file.\n\nLicense\n-------\n\nSee LICENSE file.\n",
    "bugtrack_url": null,
    "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 conditions are met:  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  Neither the name of HPCProject, Serge Guelton nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   ",
    "summary": "Ahead of Time compiler for numeric kernels",
    "version": "0.15.0",
    "project_urls": {
        "Changelog": "https://pythran.readthedocs.io/en/latest/Changelog.html",
        "Documentation": "https://pythran.readthedocs.io",
        "Homepage": "https://github.com/serge-sans-paille/pythran"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "05f97b83b106557c98b26a4452c092416f521ede035d9f6f6fb6ffd9a4ec771b",
                "md5": "3651b58c396d506c7ca2fa6508719c6c",
                "sha256": "74d52f9b5fc4d307a48c7ee741dff3bcb55014f91b6fb851a22cd8f381d404d1"
            },
            "downloads": -1,
            "filename": "pythran-0.15.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3651b58c396d506c7ca2fa6508719c6c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 4300520,
            "upload_time": "2024-01-07T21:21:39",
            "upload_time_iso_8601": "2024-01-07T21:21:39.160464Z",
            "url": "https://files.pythonhosted.org/packages/05/f9/7b83b106557c98b26a4452c092416f521ede035d9f6f6fb6ffd9a4ec771b/pythran-0.15.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8231cc6fd7a2b91efc6cdb03e7c42df895b4a65a8f049b074579d45d1def746f",
                "md5": "cc6fa05e583733182d06d2e41e03cc10",
                "sha256": "f9bc61bcb96df2cd4b578abc5a62dfb3fbb0b0ef02c264513dfb615c5f87871c"
            },
            "downloads": -1,
            "filename": "pythran-0.15.0.tar.gz",
            "has_sig": false,
            "md5_digest": "cc6fa05e583733182d06d2e41e03cc10",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 2365746,
            "upload_time": "2024-01-07T21:21:42",
            "upload_time_iso_8601": "2024-01-07T21:21:42.549299Z",
            "url": "https://files.pythonhosted.org/packages/82/31/cc6fd7a2b91efc6cdb03e7c42df895b4a65a8f049b074579d45d1def746f/pythran-0.15.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-07 21:21:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "serge-sans-paille",
    "github_project": "pythran",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pythran"
}
        
Elapsed time: 0.16780s