pyerfa
Python bindings for ERFA
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 pyerfauv
uv add pyerfapoetry
poetry add pyerfaInstalling 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
Tags
More Physics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
pydicomPydicom reads, modifies, and writes DICOM…
permissive · top 5,000 on PyPI
albumentationsAlbumentations applies image transformations to…
permissive · top 5,000 on PyPI
CoolPropCoolProp provides thermodynamic and transport…
permissive · top 5,000 on PyPI
pyquaternionProvides quaternion representation,…
permissive · top 5,000 on PyPI
ephemPyEphem computes high-precision positions of…
permissive · top 5,000 on PyPI
fitsiofitsio reads and writes FITS (Flexible Image…
copyleft · top 15,000 on PyPI
regionsRegions provides tools for defining,…
permissive · top 15,000 on PyPI
reprojectReproject astronomical images between different…
permissive · top 15,000 on PyPI
array-api-extraProvides extra array manipulation functions…
permissive · top 15,000 on PyPI
numpy-quaternionAdds a quaternion dtype to NumPy, enabling…
permissive · top 5,000 on PyPI
transforms3dConverts between different 3D geometric…
permissive · top 15,000 on PyPI
astroqueryAstroquery provides a Python interface to query…
permissive · top 15,000 on PyPI
jdcalConverts between Julian dates and Gregorian or…
permissive · top 5,000 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI