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 interface.
- Features
- Requirements
- Installation
- Quick Start
- Configuration
- FAQ
- Data Sources
- For Contributors
- Release History
- License
| 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 |
| Virtual horizon | Simulate horizon obstructions for visibility calculations |
- Python 3.9 or later
- pip (or another Python package manager)
AsteroidPy runs on Linux, macOS, and Windows.
-
Clone the repository:
git clone https://github.com/ziriuz84/asteroidpy.git cd asteroidpy -
(Recommended) Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install in editable mode:
pip install -e .Or in normal mode:
pip install .
Run the application:
asteroidpyOn first launch, AsteroidPy creates a config directory at ~/.asteroidpy with default settings. Use the Configuration menu to set:
- Observatory: coordinates, altitude, MPC code
- Virtual horizon: minimum altitude per cardinal direction
- General: interface language
Configuration is stored in ~/.asteroidpy. Use the in-app Configuration → General menu to change:
| Option | Description |
|---|---|
| Observatory | Latitude, longitude, altitude, 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) |
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 .), that ~/.asteroidpy is writable, and that you have internet access (required for weather and ephemeris queries). If the config file is corrupted, you can remove ~/.asteroidpy 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; only locales with compiled .mo files are shown.
AsteroidPy relies on:
- 7Timer — meteorological forecasts (cloud cover, seeing, transparency)
- Minor Planet Center (MPC) — ephemerides and NEO Confirmation Page data
Thank you for considering contributing to AsteroidPy. Please read the Code of Conduct before participating.
- Code: bug fixes, new features, refactoring
- QA: bug reports with repro steps and environment details
- Documentation: improvements to this README, docstrings, or Sphinx docs
- Community: presenting the project, organizing local meetups
-
Clone the repository and install in editable mode (see Installation).
-
Install development dependencies (optional, for tests and linting):
pip install pytest ruff mypy black isort
-
Run the test suite:
pytest -q
Run a single test:
pytest tests/test_scheduling.py::test_name -q
-
Lint and type-check:
ruff check . mypy .
-
Build the package:
python -m build
- Imports: standard library → third-party → local; explicit imports only
- Formatting: Black for style; isort for import order
- Types: type hints on public APIs; snake_case for functions/variables; CamelCase for classes
- Errors: avoid bare
except; raise or propagate clear exceptions; validate inputs early - Tests: small, isolated tests; prefer parameterized tests where sensible
- Browse open issues and comment or pick one to work on
- Open issues for bugs or feature ideas—the more detail, the better
- Pull requests are welcome; please ensure tests pass and style is consistent
asteroidpy/
├── __init__.py # Entry point; loads config, launches interface
├── interface.py # CLI menus, user I/O, gettext setup
├── scheduling.py # Ephemerides, weather, NEOcp, twilight
├── configuration.py # Observatory config, horizon, language
└── locales/ # gettext translations (en, it, de, fr, es, pt)
interface— Main entry for the interactive UI. Loads config, sets up gettext, and delegates toschedulingfor ephemeris/weather/NEOcp and toconfigurationfor settings.scheduling— Astronomy logic: MPC queries, 7Timer weather, twilight, Sun/Moon ephemeris. Usesconfiguration.load_config()to read observatory data.configuration— Persists and loads settings in~/.asteroidpy; handles observatory coordinates, virtual horizon, and language. Used by bothinterfaceandscheduling.
AsteroidPy uses GNU gettext with a single catalog base. Translations live under locales/<lang>/LC_MESSAGES/.
-
Create a new locale directory:
mkdir -p locales/nl/LC_MESSAGES
-
Copy and adapt an existing
.pofile, or create one from the template:cp locales/it/LC_MESSAGES/base.po locales/nl/LC_MESSAGES/base.po
Edit
locales/nl/LC_MESSAGES/base.po, setLanguage: nl, and translate allmsgstrentries. -
Compile the
.pofile into a.mofile (required for the language to appear in the menu):msgfmt -o locales/nl/LC_MESSAGES/base.mo locales/nl/LC_MESSAGES/base.po
The
msgfmtcommand comes with the gettext package (gettexton most Linux distros). -
The new language will appear in Configuration → General after restart.
To add or update translatable strings for all locales, update locales/base.pot (e.g. with xgettext or pybabel), then merge into each .po with msgmerge, translate, and recompile with msgfmt.
- Update
asteroidpy/version.py(__version__, used by setuptools and the UI); keepsetup.pyin sync if you still rely on it. - Add the corresponding entry to
CHANGELOG.mdunder a new[X.Y.Z]heading with date and link to the tag. - Run tests and build:
pytest -q python -m build
- Commit the version bump and changelog, then create and push a tag:
(Use
git tag vX.Y.Z -m "Release vX.Y.Z" git push origin main --tagsgit tag -sfor a signed tag if you have GPG configured.) - Create a release on GitHub from the new tag and attach the built artifacts (e.g. from
dist/).
See CHANGELOG.md.
- NEOcp alert integration
- Observation registration
AsteroidPy is licensed under the GPL-3.0 license.