Skip to main content

Additional Packages


Python Standard Library

Python come with an impressive standard library of modules data types and tools (http://docs.python.org/2/library/index.html). This provides database functionality, a variety of data persistence features (ie saving your data), routines for interfacing with the operating system (eg running a model, moving some data), website interfacing, email and networking tools, data compression support (eg archiving, zipping), cryptography, xml support, regular expressions, unit testing, multithreading, and much more.

Linking With Other Languages

Cython: Cython provides a way to embed compiled, optimized bits of code written in C or C++ in a larger Python program.

F2PY: program that provides an interface to use Fortran subroutines in Python code. (http://cens.ioc.ee/projects/f2py2e/)

mlabwrap: A Python-to-MATLAB bridge which make MATLAB functions available as Python functions.

RPy: a Python interface to the R Programming Language.

pyidlrpc: A library to call IDL (Interactive Data Language) from python.

Scientific Packages

NumPy/SciPy: This pair of packages provide array and matrix structures, linear algebra routines, numerical optimization, random number generation, statistics routines, differential equation modeling, Fourier transforms and signal processing, image processing, masked arrays, spatial computation, and lots of other mathematical routines. The packages are well documented and there’s a very active community of users.

Matplotlib: matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. matplotlib can be used in python scripts, the python and ipython shell, web application servers, and six graphical user interface toolkits.

Data Storage/Database

SQLAlchemy: Powerful SQL database tool.

PyTables: package for managing large amounts of data in an organized, reliable, and efficient way.

Netcdf4: This is one of the packages that allow you to read and write netcdf files with Python. Netcdf 4 is also compatible with Numpy. It’s included in Canopy. https://code.google.com/p/netcdf4-python/

Earth And Environmental Sciences

Phreeqpy: Python interface for PHREEQC a geochemical computing program. http://www.phreeqpy.com/

Iris and Cartopy: (http://scitools.org.uk/) MetOffice Python library for visualising weather and climate data (including UM output) based on basemap and matplotlib (recommended). Iris provides a quick way to plot.

Basemap: package to plot maps with matplotlib.

UV-CDAT: (Ultrascale Visualization Climate Data Analysis Tools; (http://uvcdat.llnl.gov/) for climate data analysis.

PyClimate: Tools for climate variability analysis. http://fisica.ehu.es/pyclimate

GIS libraries: Some essential libraries for Python (eg. GDAL). http://michalisavraam.org/2010/04/the-essential-python-modules-for-gis/

seawater: a package for computing properties of seawater.

Fluid: a package for calulating properties of fluids (air and seawater), and their interactions (e.g., wind stress).

Others: Search online for other packages you would be intersted in such as Image processing, model optimisation, statistics...

Python Distributions (eg ways to install python and packages):

Enthought Canopy Distribution: Software that provides more than 150 Python packages for scientific use, including ipython, Numpy, matplotlib, Netcdf4, pyproj and many others. It also provides a simple editor. It’s commercial software, but free for academic use. Check out the list of python packages in Canopy (https://www.enthought.com/products/canopy/package-index/).

Anaconda: Another distribution of Python with more than 125 Python Packages for scientific use. It’s Free and cross platform (Linux, Mac and Windows). https://store.continuum.io/cshop/anaconda/

Development environments:

IDLE: The default development environment with a simple editor to write and run code. It comes with every python distribution and is used in this course. http://docs.python.org/2/library/idle.html

IPython: An enhanced interactive Python interpreter great for debugging, profiling code, using Numpy and plotting interactively. (http://ipython.org/) The Ipython Notebook provides a web-based python/text editor combined into one so you can write text, code and add your figures all into one document (it emulates the Mathematica notebook).

Spyder: Interactive Development environment for scientific use. http://packages.python.org/spyder/

PyDev for Eclipse: Eclipse is an interactive development environment (IDE) that works with a range of different programming languages (http://www.eclipse.org/). PyDev is a plugin for Eclipse which allows you to use Eclipse to develop python code (http://pydev.org/).

Canopy has a simple python editor with syntax highlighting and debugging features which also integrates the ipython interpreter.

Wing IDE: another IDE designed for Pyhton. It has a free version for academic use. (http://wingware.com/)

You can also use other programming editors to write and execute Python programs:

Sage: Sage is a piece of software for pure and applied math which aims to replace software like Magma, Maple, Mathematica and MATLAB. Sage is not Python package itself but rather a piece of software which included lots of mathematical tools including python packages and allows you to use the python language into Sage. The interface is a notebook like the one provided by ipython. It’s free and based on open-source packages.