--- id: ephem version: "4.2.1" license: MIT license_treatment: permissive maintenance: active --- # ephem — Compute positions of the planets and stars License: permissive · Maintenance: active · Downloads: 1.6M/mo ## 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 above — verify before relying. PyEphem computes high-precision positions of planets, moons, stars, comets, and asteroids in the sky for any observer location and date, using C-based numeric routines from the XEphem astronomy application. 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 pip install ephem uv add ephem poetry add ephem ## Installing ephem 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. 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 A C compiler is required if installing from source; pre-built wheels are available for most platforms, eliminating this requirement for standard installations. 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: unspecified - Install friction: medium - Maintenance: active - Downloads: 1.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags astronomy position calculations, planetary ephemeris computation, celestial body coordinates, moon and planet positions, astronomical observer calculations, satellite orbital elements, star position lookup, ephemeris data python, astronomy, ephemeris, celestial-mechanics [View on SkillFed](https://skillfed.io/packages/ephem) · [View on PyPI](https://pypi.org/project/ephem/)