Skip to main content
https://img.shields.io/pypi/v/pygsl.svg https://img.shields.io/conda/vn/conda-forge/pygsl https://img.shields.io/github/commits-since/pygsl/pygsl/latest https://img.shields.io/pypi/dm/pygsl?label=PyPI%20downloads https://img.shields.io/conda/dn/conda-forge/pygsl?label=Conda-Forge%20downloads

PyGSL is a Python wrapper for the GNU Scientific Library (GSL). Nearly all modules are wrapped. A lot of tests are covering various functionality.

Please report it as a Github Issue if you find a bug. We are looking forward to contributions of new submodules, while maintaining the available code, and welcome pull requests.

PyGSL moved from Sourceforge to GitHub in 2021.

Requirements

To build the interface, you will need

Since version 2.6 PyGSL is built using meson-python. Swig must be always installed to build PyGSL.Meson-python will be automatically installed by PyPI during the build process.

Installing PyGSL

Installing via PyPI

PyGSL can also installed using the pip package installer. SWIG is required to be installed and can usually be found via your distribution’s package manager (for example, apt install swig).

To install PyGSL from PyPI, first install

pip install --upgrade pip wheel
pip install pygsl

To remove PyGSL, use:

pip uninstall pygsl

Building it locally

It can be useful to install PyGSL locally e.g. if the automatic build process fails. In a first step, update the packages pip and wheel as

pip install --upgrade build

– code-block:: sh

python3 -m build -w .

Using PyGSL

Do NOT test the interface in the distribution root directory! – please install it first and then change to the tests directory and execute python -m pytest ..

Just write in Python

import pygsl.sf
print("%g+/-%g"%pygsl.sf.erf(1))

or

import pygsl.rng
rng=pygsl.rng.rng()
print rng.gaussian(1.0)

You may set the environment variable LD_LIBRARY_PATH to find the gsl shared object.

Supported Platforms

  • Linux with Python 3.x and GSL 2.x

  • Mac OS X with Python 3.x and GSL 2.x

but is supposed to compile and run on any posix platform.

Currently it is being tested using GitHub Actions continuous integration on:

  • Python 3.9 – 3.12, numpy 1.x and 2.x and GSL 2.7.1 under Ubuntu Linux 22.04.2.

Testing

The directory test will contain several testsuites, based on Python unittest. Change to this directory to run the tests.

What is implemented (versus GSL 2.1):

  • Blas

  • BSplines

  • Chebyshev

  • Combination

  • Const

  • Diff

  • Eigen

  • Fit

  • Ieee

  • Integrate

  • Interpolation

  • Interpolation2D

  • Linalg

  • Math

  • Minimize

  • Multifit

  • Multifit_nlin

  • Multimin

  • Multiroots

  • Odeiv

  • Permutation

  • Poly

  • Qrng

  • Rng

  • Roots

  • Siman

  • Sf

  • Spline

  • Statistics

What is not implemented yet (versus GSL 2.7)

  • GSL Capabilites not yet wrapped by PyGSL

    • Sorting

    • N-tuples

  • GSL Capabilites partly implemented

    • Discrete Hankel Transforms

See also the TODO file in the distribution.

For the exact function volume for a module, please type:

from pygsl.testing import sf
dir(sf)

You can do this with the other modules, too. The naming scheme is the same as in GSL.

Documentation

The function reference can be found in the docstrings and at the gsl-reference.

Written documentation can be found in the doc/ref directory.

See also the examples directory.

Support

Support requests and all other questions should be submitted as a GitHub Issue.

Developement

You can browse our git repository.

If you want to contribute to PyGSL, please fork the repository and create a pull request.

The script tools/extract_tool.py generates most of the special function code.

History

A GSL interface for Python was needed for a project at Center for applied informatics Cologne.

pygsl-0.0.3 was released on May 23, 2001.

Thanks

  • Charl Linssen for continous integration

  • Jochen Küpper for pygsl.statistics

  • Fabian Jakobs for pygsl.blas, pygsl.eigen, pygsl.linalg and pygsl.permutation

  • Leonardo Milano for rpm build support and test

  • Eric Gurrola and Peter Stoltz for testing and supporting the port of pygsl to the MAC

  • Sebastien Maret for supporting the Fink http://fink.sourceforge.net port of pygsl.

  • Michael Forbes for Series Acceleration

  • Sergei Ossokine

  • Jerry James

  • and all for support by providing feed back on testing or showing by email that the code is useful for them

Maintainers

PyGSL is currently maintained by Achim Gaedke, Pierre Schnizer and Charl Linssen.

Metadata

Release files for pygsl 2.6.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygsl 2.6.5
File Size Uploaded
pygsl-2.6.5.tar.gz 649.4 kB Details

Release files / pygsl-2.6.5.tar.gz

Download URL pygsl-2.6.5.tar.gz
Size 649.4 kB
Tags Source
SHA-256 checksum
How to use checksums
33bc9dc18808ca04f2f67e4f92a4185916728ed876971a3a0b36570672c22e71
BLAKE2b-256 checksum
How to use checksums
a4ad9fd481b3a6a3865229e0dbb16c738eeb9b1263b286c0e0985fae78988bcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.6.5 This release

1 release file

2.6.4

1 release file

2.6.3

1 release file

2.6.2

1 release file

2.6.1

1 release file

2.6.0

1 release file

2.5.1

1 release file

2.5.0

1 release file

2.3.3

1 release file

2.3.2

1 release file

2.3.0

1 release file

2.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page