skillfed

pyerfa

Python bindings for ERFA

pyerfa v2.0.1.5 3.4M downloads/30d#2,627 on PyPI48
Permissive license BSD 3-Clause License Active released

What it is and what it does

PyERFA is a Python wrapper around ERFA, a C library of fundamental astronomy algorithms published by the International Astronomical Union. It exposes ERFA routines as numpy universal functions, allowing them to work seamlessly with both scalar and array inputs. The package originated as a split from Astropy's internal _erfa module and now stands as a standalone dependency for astronomy and astrophysics work.

The library provides access to ERFA's key algorithms—including coordinate transformations, time conversions, and planetary position calculations—along with ERFA constants and structured data types. It handles error and warning states automatically through wrapped Python functions, though direct access to raw ufuncs is also available for lower-level control. Installation requires numpy and targets Python 3.9+, with prebuilt wheels for most common platforms.

Use it for:

  • Convert Julian dates to calendar dates for astronomical observations and data processing.
  • Calculate planetary positions and velocities for mission planning or ephemeris generation.
  • Perform time-scale conversions for precise astronomical timing and coordination.
  • Access ERFA constants and structured data types used in fundamental astronomy.
  • Batch-process large arrays of astronomical data using vectorized universal functions.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PyERFA wraps the ERFA C library (Essential Routines for Fundamental Astronomy) as NumPy universal functions, exposing key astronomy algorithms for scalar or array inputs.

Yes. PyERFA is actively maintained, has no known vulnerabilities, and provides the standard Python interface to ERFA algorithms. Install it if you need fundamental astronomy calculations or if another package depends on it. The BSD 3-Clause License poses no restrictions, and prebuilt wheels minimize friction on common platforms.

Install

pyerfa on PyPI

pip

pip install pyerfa

uv

uv add pyerfa

poetry

poetry add pyerfa

Installing pyerfa

Before you install

Medium install friction due to compiled C extension; prebuilt wheels cover common platforms (CPython 3.9+, PyPy 3.9+, x86_64/ARM64/Windows). Repository is active with recent commits.

License in practice

BSD 3-Clause License is permissive; you can use, modify, and distribute pyerfa with minimal restrictions, provided you retain the license notice.

Quickstart

pip install pyerfa

import pyerfa
result = pyerfa.jd2cal(2460000., [0, 1, 2, 3])

Requires Python 3.9 or later and numpy as a runtime dependency.

Verify before relying

  • Whether system-provided liberfa (via PYERFA_USE_SYSTEM_LIBERFA=1) offers performance or compatibility benefits.
  • Performance characteristics and numerical accuracy compared to other astronomy libraries.
  • Specific ERFA algorithms and their use cases beyond the examples in the documentation.

Package facts

License BSD 3-Clause License (permissive)
Python support supports the current Python release (>=3.9)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — numpy
Maintenance actively maintained — 641 days since the last release
Last repo commit
First released
Downloads 3,420,670/month — #2,627 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyerfa-2.0.1.5-cp39-abi3-macosx_10_9_x86_64.whl; pyerfa-2.0.1.5-cp39-abi3-macosx_11_0_arm64.whl; pyerfa-2.0.1.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyerfa-2.0.1.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyerfa-2.0.1.5-cp39-abi3-musllinux_1_2_x86_64.whl; pyerfa-2.0.1.5-cp39-abi3-win32.whl; pyerfa-2.0.1.5-cp39-abi3-win_amd64.whl; pyerfa-2.0.1.5-pp39-pypy39_pp73-macosx_10_15_x86_64.whl; pyerfa-2.0.1.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyerfa-2.0.1.5-pp39-pypy39_pp73-win_amd64.whl

Keywords: astronomy, astrophysics, cosmology, space, science, coordinate

Intended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: CProgramming Language :: Python :: 3Programming Language :: Python :: Implementation :: CPythonTopic :: Scientific/Engineering :: AstronomyTopic :: Scientific/Engineering :: Physics

Tags

astronomy coordinate transformationsfundamental astronomy algorithmsERFA library python wrappercelestial mechanics calculationsnumpy ufuncs astronomyIAU SOFA algorithmsastronomical time conversions
astronomycoordinate-transformsnumpy-ufuncs

More Physics packages