Metadata-Version: 2.4
Name: astro-resolver
Version: 0.1.0
Summary: Astronomical object name resolution: Messier, NGC/IC, Caldwell, Sharpless, Barnard, SIMBAD.
Author-email: Daniel Grundhöfer <daniel.grundhoefer@mailbox.org>
License-Expression: MIT
Keywords: astronomy,astrophotography,simbad,ngc,ic,messier,caldwell,sharpless,barnard,siril,fits
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Astronomy
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: astropy>=6.1
Requires-Dist: astroquery>=0.4.7
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Dynamic: license-file

# astro-resolver

Astronomical object name resolution for FITS workflows, astrophotography
pipelines and Siril scripts. Turns messy `OBJECT` headers like
`"M 81"`, `"sh2-101"`, `"barnard 33"` or `"HD 1"` into clean,
filesystem-safe folder names.

## Features

- Local-first resolution chain — SIMBAD only as a last resort
- Solar System, Caldwell, custom aliases, OpenNGC (~14k objects),
  Sharpless and Barnard catalogs bundled
- Stellar catalog IDs (HD, HIP, SAO, TYC, …) skip the SIMBAD `otype`
  round-trip and go straight to coordinate lookup
- Coordinate fallback via SIMBAD when name lookup fails
- Filesystem-safe output suitable as folder/file names

## Installation

```bash
pip install astro-resolver
```

## Usage

```python
from astro_resolver import resolve_object_name

resolve_object_name("M 81")              # → "M81_BodesGalaxy"
resolve_object_name("sh2-101")           # → "Sh2-101_TulipNebula"
resolve_object_name("barnard 33")        # → "B33_HorseheadNebula"

# Stellar catalog ID with coordinates → SIMBAD coord lookup
resolve_object_name("HD 1", ra="00 05 09", dec="+67 50 24")
```

The resolver accepts an optional `log` callable so it can be plugged into
Siril scripts (`log=siril.log`) or any other host environment.

## Resolution priority

1. Solar System (local)
2. Caldwell (local)
3. Custom aliases (local)
4. OpenNGC offline (local, ~14k NGC/IC objects)
5. Sharpless catalog (local, Sh 2-xxx HII regions)
6. Barnard catalog (local, dark nebulae)
7. SIMBAD by name (online)
8. SIMBAD by coordinates (online)
9. Sanitized header string as fallback

## Data sources

- [OpenNGC](https://github.com/mattiaverga/OpenNGC) — CC BY-SA 4.0
- [SIMBAD](https://simbad.u-strasbg.fr/simbad/) via `astroquery`

## License

MIT
