ephem
Compute positions of the planets and stars
Decision gist · record as of 2026-08-14
Yes. PyEphem is a mature, actively maintained library with no known vulnerabilities, a permissive MIT license, and broad platform support via pre-built wheels. Install friction is moderate but manageable. It is the standard choice for Python-based high-precision astronomy calculations and is well-suited for anyone building observational astronomy, planetarium, or satellite-tracking tools.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- A C compiler is required if installing from source; pre-built wheels are available for most platforms, eliminating this requirement for standard installations.
- Medium install friction due to C extension compilation, but pre-built wheels cover most modern Python versions and platforms.
- The package is actively maintained with recent commits and has been stable since its 2008 release.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute PyEphem freely in commercial or private projects with minimal restrictions.
last release 2026-02-28 (167 days) · last repo commit 2026-04-30 · 893 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,567,267 downloads/mo, #3,754 on PyPI
Alternatives
Verify before relying
pip install ephem
import ephem
mars = ephem.Mars()
mars.compute('2008/1/1')
print(mars.ra) # prints 5:59:27.35
print(mars.dec) # prints 26:56:27.4- Precision level (number of decimal places or arcsecond accuracy) of position computations
- Performance characteristics for batch computations of many bodies or dates
- Whether atmospheric refraction compensation works for all observer altitudes
What it is and what it does
PyEphem is a Python wrapper around high-precision C-based astronomy computation routines originally from the XEphem application. It lets you compute where celestial objects appear in the sky from any location on Earth at any date, handling the complex orbital mechanics and coordinate transformations automatically. The package represents planets, moons, stars, comets, and asteroids as Python objects, and automatically formats dates and angles in standard astronomical notation.
Typical use involves creating an observer object with a location (longitude, latitude, altitude), creating or loading a celestial body (planets and major moons are built-in, or you can supply orbital elements), computing its position for a specific date, and reading off coordinates like right ascension and declination. The package also handles rise/transit/set times, Moon phases, equinoxes, solstices, coordinate system conversions, and includes a database of 122 world cities for convenience.
Use it for
- Determine when and where to observe a planet or comet from a specific location on a given night
- Calculate the Moon's phase and position for calendar or astronomical applications
- Track Earth-orbiting satellites using TLE orbital data
- Find the dates of equinoxes, solstices, and lunar phases for a calendar year
- Convert between equatorial, ecliptic, and galactic coordinate systems for star catalogs
- Compute atmospheric refraction corrections for objects near the horizon
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
PyEphem is a mature, actively maintained library with no known vulnerabilities, a permissive MIT license, and broad platform support via pre-built wheels. Install friction is moderate but manageable. It is the standard choice for Python-based high-precision astronomy calculations and is well-suited for anyone building observational astronomy, planetarium, or satellite-tracking tools.
Install
ephem on PyPI
Before you install
Medium install friction due to C extension compilation, but pre-built wheels cover most modern Python versions and platforms. The package is actively maintained with recent commits and has been stable since its 2008 release.
A C compiler is required if installing from source; pre-built wheels are available for most platforms, eliminating this requirement for standard installations.
License in practice
MIT license is permissive; you can use, modify, and distribute PyEphem freely in commercial or private projects with minimal restrictions.
Quickstart
pip install ephem
import ephem
mars = ephem.Mars()
mars.compute('2008/1/1')
print(mars.ra) # prints 5:59:27.35
print(mars.dec) # prints 26:56:27.4
Verify before relying
- Precision level (number of decimal places or arcsecond accuracy) of position computations
- Performance characteristics for batch computations of many bodies or dates
- Whether atmospheric refraction compensation works for all observer altitudes
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 167 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,567,267 / month, #3,754 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 6 - MatureIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Astronomy |
Evidence: ephem-4.2.1-cp27-cp27m-manylinux2010_i686.whl; ephem-4.2.1-cp27-cp27m-manylinux2010_x86_64.whl; ephem-4.2.1-cp27-cp27mu-manylinux2010_i686.whl; ephem-4.2.1-cp27-cp27mu-manylinux2010_x86_64.whl; ephem-4.2.1-cp310-cp310-macosx_10_9_x86_64.whl; ephem-4.2.1-cp310-cp310-macosx_11_0_arm64.whl; ephem-4.2.1-cp310-cp310-manylinux2010_i686.manylinux_2_12_i686.manylinux_2_28_i686.whl; ephem-4.2.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; ephem-4.2.1-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl; ephem-4.2.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; ephem-4.2.1-cp310-cp310-musllinux_1_2_aarch64.whl; ephem-4.2.1-cp310-cp310-musllinux_1_2_i686.whl; ephem-4.2.1-cp310-cp310-musllinux_1_2_s390x.whl; ephem-4.2.1-cp310-cp310-musllinux_1_2_x86_64.whl; ephem-4.2.1-cp310-cp310-win32.whl; ephem-4.2.1-cp310-cp310-win_amd64.whl; ephem-4.2.1-cp311-cp311-macosx_10_9_x86_64.whl; ephem-4.2.1-cp311-cp311-macosx_11_0_arm64.whl; ephem-4.2.1-cp311-cp311-manylinux2010_i686.manylinux_2_12_i686.manylinux_2_28_i686.whl; ephem-4.2.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “astronomy position calculations”
- ephemPyEphem computes high-precision positions of planets, moons, stars,…
- PyMeeusPyMeeus implements astronomical algorithms from Jean Meeus's…
- suntimesCalculates sunrise and sunset times for any geographic location…
Give your agent the search over MCP, or paste the wish link into any chat.
More Astronomy packages
Albumentations applies image transformations to training data, supporting classification, segmentation, object detection, and pose estimation with a unified API for images, masks, bounding boxes, and keypoints.
Install it if you need a unified, production-grade augmentation API for computer vision tasks.
Converts dates between the Gregorian calendar and 15+ alternative calendar systems including Hebrew, Islamic, Julian, French Republican, Mayan, and others, plus calculates holidays across North American, Jewish, and other traditions.
Install only if you actually need multi-calendar support; the single pymeeus dependency is manageable.
Converts between Julian dates and Gregorian or Julian calendar dates, storing Julian dates as pairs of floating-point numbers for maximum precision.
However, be aware that it will not receive bug fixes or updates—verify that its behavior matches your requirements before committing to it in a production system.
PyERFA wraps the ERFA C library (Essential Routines for Fundamental Astronomy) as NumPy universal functions, exposing key astronomy algorithms for scalar or array inputs.
Install it if you need fundamental astronomy calculations or if another package depends on it.
PyMeeus implements astronomical algorithms from Jean Meeus's classical reference, providing Python classes for computing celestial positions, lunar phases, planetary phenomena, and time conversions with minimal dependencies.
However, verify Python version compatibility first and consider whether other libraries better suit production-grade use cases.
Adds a quaternion dtype to NumPy, enabling efficient quaternion arithmetic and array operations with native NumPy integration.
See also jplephem · skyfield · spiceypy · pyorbital · sgp4 · skyfield-data · kerykeion