Skip to main content

AsteroidPy

GitHub Contributor Covenant contributions welcome Quality Gate Coverage

AsteroidPy is a command-line tool for astronomers to schedule and manage asteroid observations. It integrates with the Minor Planet Center and other astronomical data sources to provide ephemerides, NEO confirmation candidates, weather forecasts, and observing aids—all from an interactive terminal UI built with Textual.


Table of Contents


Features

Feature Description
Weather forecast Astronomical weather (cloud cover, seeing, transparency) up to 72 hours via 7Timer
Observation scheduling Plan sessions with target lists and visibility windows
NEOcp candidates List and filter Near-Earth Object candidates from the MPC Confirmation Page
Object ephemeris Retrieve detailed ephemeris data for any minor body
Twilight & Sun/Moon Civil, nautical, and astronomical twilight; rise/set times
Best-upcoming-night planner Rank the upcoming astronomical nights by observing quality (cloud cover, seeing, transparency, Moon illumination) with configurable weights
Virtual horizon Simulate horizon obstructions for visibility calculations

Requirements

  • Python 3.11 or later (supported: 3.11, 3.12, 3.13 and 3.14)
  • pip (or another Python package manager)

AsteroidPy runs on Linux, macOS, and Windows.

The 3.11 floor comes from the dependency stack, not the application code: astropy 7 and later require Python 3.11 or newer, and platformdirs and requests require 3.10. Pinning the floor at 3.11 guarantees every supported interpreter resolves the same versions of the scientific stack, instead of silently falling back to a several-years-old astropy on older interpreters.

On Windows, use Windows Terminal (recommended) or another modern terminal for the Textual UI. The first pip install may take several minutes because scientific dependencies (astropy, lxml, and related packages) download platform-specific wheels. A current python.org build is the most reliable choice on Windows.


Installation

From PyPI

With Python 3.11+ and a virtual environment activated (recommended):

pip install asteroidpy

See the package on PyPI.

On Windows, after installation the asteroidpy command is available in your virtual environment's Scripts folder (for example .venv\Scripts\asteroidpy.exe).

From source

  1. Clone the repository:

    git clone https://github.com/ziriuz84/asteroidpy.git
    cd asteroidpy
    
  2. (Recommended) Create and activate a virtual environment:

    python -m venv .venv
    source .venv/bin/activate   # On Windows: .venv\Scripts\activate
    
  3. Install in editable mode:

    pip install -e .
    

    Or in normal mode:

    pip install .
    

Quick Start

Run the application:

asteroidpy

On first launch, AsteroidPy creates a config file with default settings. Use the Configuration menu to set:

  • Observatory: coordinates, altitude, site and observer names, MPC code
  • Virtual horizon: minimum altitude per cardinal direction
  • General: interface language

The Observation scheduling menu offers weather, MPC observing target list, NEOcp list, object ephemeris, twilight times, and best upcoming night.


Configuration

Configuration is stored in a single INI file named .asteroidpy, in the application config directory returned by platformdirs (for example ~/.config/asteroidpy/ on Linux, ~/Library/Application Support/asteroidpy/ on macOS, and %LOCALAPPDATA%\asteroidpy\ on Windows). Legacy installs may still have a copy at ~/.asteroidpy, which is migrated automatically on first run.

Use the in-app Configuration menu to change:

Option Description
Observatory Latitude, longitude, altitude, site and observer names, MPC observatory code
Virtual horizon Minimum altitude (in degrees) per cardinal direction for visibility
Language Interface language (English, Italiano, Deutsch, Français, Español, Português)

The same values can be edited by hand in the INI file. It has three sections:

Section Options
[General] lang — interface language
[Planner] max_nights — how many nights the best-night planner ranks; w_cloud, w_seeing, w_transparency, w_moon — relative weights, normalized to sum to 1
[Observatory] place, latitude, longitude, altitude, obs_name, observer_name, mpc_code, nord_altitude, east_altitude, south_altitude, west_altitude

Missing options are filled from the built-in defaults on every load, so a partial or older file stays usable. The [Planner] weights are read from the file only — there is no in-app screen for them yet; they control the Best upcoming night score, whose only inputs are cloud cover, seeing, transparency and Moon illumination. Nights with any precipitation are discarded outright.


FAQ

Where do I find my MPC observatory code?
The Minor Planet Center publishes the list of observatory codes. If your site is not listed, use XXX or another temporary code until you register it with the MPC.

Why do ephemerides differ from Stellarium or other tools?
Small differences can arise from different orbital elements, epoch dates, or time handling. AsteroidPy uses MPC data directly; ensure your observatory coordinates and time (UTC vs local) match across tools.

The application fails to start or shows errors.
Check that all dependencies are installed (pip install asteroidpy from PyPI, or pip install . from a source checkout), that the config directory is writable (see Configuration for the platform-specific path), and that you have internet access (required for weather and ephemeris queries). If the config file is corrupted, remove .asteroidpy from that config directory and let the app recreate it on next run.

Which languages are supported?
English (default), Italiano, Deutsch, Français, Español, Português. Change the language in Configuration → General → Language. PyPI wheels ship with compiled .mo catalogs for all supported languages. When working from a source checkout, only locales with compiled .mo files are listed as selectable; if a folder under asteroidpy/locales/ has only a base.po, the UI may show a notice when opening the language screen—compile with msgfmt so the locale appears as a proper option.


Data Sources

AsteroidPy relies on:


For Contributors

Contributions are welcome — bug fixes, new features, documentation, and translations all count. Please read the Code of Conduct first.

The full contributor guide lives in CONTRIBUTING.md:

New to the project? Start with the open issues and the bug report / feature request templates.


Release History

See CHANGELOG.md.


TODO

  • NEOcp alert integration
  • Observation registration
  • In-app editor for the [Planner] best-night weights (currently INI-only)
  • Build the Sphinx docs in CI (the Jenkinsfile has no docs stage, so doc drift goes unnoticed)
  • A CI matrix that actually exercises every claimed supported Python (3.11–3.14); the Jenkinsfile currently runs a single unpinned python3

License

AsteroidPy is licensed under the GPL-3.0 license.

Metadata

Release files for Asteroidpy 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Asteroidpy 1.4.0
File Size Uploaded
asteroidpy-1.4.0.tar.gz 81.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Asteroidpy 1.4.0
File Interpreter ABI Platform
asteroidpy-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 163.6 kB

Release files / asteroidpy-1.4.0.tar.gz

Download URL asteroidpy-1.4.0.tar.gz
Size 81.8 kB
Tags Source
SHA-256 checksum
How to use checksums
193e29faf512bb00ce075e08ebc16773067c7d20822caf100630facac3e5307c
BLAKE2b-256 checksum
How to use checksums
0df63c0151eda01a6251ad138e8b650c2f976ce5dae12c7e45e3a7c9e5810747
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / asteroidpy-1.4.0-py3-none-any.whl

Download URL asteroidpy-1.4.0-py3-none-any.whl
Size 81.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a320700e0b608b90217538e91b67628a6f088c8c2d4dc3c713769ef4bc308e7b
BLAKE2b-256 checksum
How to use checksums
8eb73432be4bba7300b387e869c5c5aa7c4f0fa8ec543920e5903698ef513189
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release history Release notifications | RSS feed

1.5.0

2 release files

1.4.1

2 release files

This release

1.4.0 This release

2 release files

1.3.2

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.5

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page