Skip to content
Space Science library for Python - contains superposed epoch classes, drift shell tracing, access to magnetic field models, streamline tracing, bootstrap confidence limits, time and coordinate conversions, etc.
Fortran Python HTML Other
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Add 'version of spacepy' to issue template Aug 10, 2019
Doc Post 0.2.1 release, change back to unreleased Oct 3, 2019
scripts pycdf.istp: add option to suppress errors for ISTP checks Sep 25, 2019
spacepy toolbox: pmm refactor to handle all input args identically Nov 7, 2019
tests toolbox: apply patch to fix pmm for strings Nov 7, 2019
.gitignore gitignore: remove .pyf, since they should all be in build/ Mar 8, 2012
.travis.yml remove numpy 1.16.x restrictions on testing Feb 28, 2019
CHANGELOG pycdf.istp: Checks for null string Entries in global and variable att… Oct 29, 2019 LICENSE and COPYRIGHT: updates required after IP transfer Feb 27, 2019
DISTRIBUTE 0.2.1 release Oct 2, 2019
INSTALL Revert "Allow for unreleased versions (YYYY.MM.DD.cccccccc of the las… Aug 16, 2017 LICENSE and COPYRIGHT: updates required after IP transfer Feb 27, 2019 pycdf.istp: support for ISTP metadata Sep 25, 2019 new file to carry license and copyright info with install Feb 27, 2019 Repoint docs from pythonhosted to github Jun 20, 2019
requirements.txt remove numpy 1.16.x restrictions on testing Feb 28, 2019 Post 0.2.1 release, change back to unreleased Oct 3, 2019

Build Status


SpacePy is a package for Python, targeted at the space sciences, that aims to make basic data analysis, modeling and visualization easier. It builds on the capabilities of the well-known NumPy and MatPlotLib packages. Publication quality output direct from analyses is emphasized among other goals:

  • Quickly obtain data
  • Read (and write) data from (and to) data formats like NASA CDF and HDF5
  • Create publications quality plots
  • Perform complicated analysis easily
  • Run common empirical models
  • Change coordinates and time systems effortlessly
  • Harness the power of Python

The SpacePy project seeks to promote accurate and open research standards by providing an open environment for code development. In the space physics community there has long been a significant reliance on proprietary languages that restrict free transfer of data and reproducibility of results. By providing a comprehensive, open-source library of widely-used analysis and visualization tools in a free, modern and intuitive language, we hope that this reliance will be diminished.

To help foster an open and welcoming environment, we have adopted a code of conduct that we encourage members of the SpacePy community to read and follow.

Getting SpacePy

Our latest release version is available through PyPI and can be installed using

pip install spacepy --user

This will also automatically install most dependencies. To permit binary installations without a compiler, this will not install ffnet on Windows. Users needing the LANLstar module can install ffnet separately (requires Fortran compiler); this can be done before or after the SpacePy install.

The latest "bleeding-edge" source code is available from our github repository at and can be installed using the standard

python install --user

Further installation documentation can be found here Mac-specific information can be found here Full documentation is at

SpacePy supports both Python 2.7 and 3.x.


SpacePy has a number of well-maintained dependencies, most of which are automatically installed by pip. These include:

  • numpy (>=1.6, !=1.15.0)
  • scipy (>=0.10)
  • matplotlib (>=1.5)
  • h5py

Soft dependencies (that are required only for a very limited part of SpacePy's functionality) are:

  • ffnet

For complete installation, excepting pre-built Windows binaries, SpacePy also requires C and Fortran compilers. We test with GCC compilers but try to maintain support for all major compilers.


If you wish to use CDF files, download and install the NASA CDF library. The default installation directory is recommended to help SpacePy find the library. Get the package from


When publishing research which used SpacePy, please provide appropriate credit to the SpacePy team via citation or acknowledgement.

To cite SpacePy in publications, use (BibTeX code):

author = {{Morley}, S.~K. and {Koller}, J. and {Welling}, D.~T. and {Larsen}, B.~A. and {Henderson}, M.~G. and {Niehof}, J.~T.},
title = "{Spacepy - A Python-based library of tools for the space sciences}",
booktitle = "{Proceedings of the 9th Python in science conference (SciPy 2010)}",
year = 2011,
address = {Austin, TX}

Certain modules may provide additional citations in the __citation__ attribute. Contact a module's author before publication or public presentation of analysis performed by that module. This allows the author to validate the analysis and receive appropriate credit for his or her work.

For acknowledging SpacePy, please provide the URL to our github repository.

You can’t perform that action at this time.