A practical command-line interface (CLI) for selected astroquery modules, with basic autocompletion and multi-language support.
astroquery-cli provides command-line access to several astroquery data services, with support for Chinese and Japanese interfaces. The current features focus on core query commands; some advanced features are still under development.
- ALMA: Basic query
- ESASky: Sky region visualization queries
- Gaia: Cone search
- IRSA: Infrared Science Archive queries
- Heasarc: HEASARC Archive queries
- JPL: JPL Small-Body Database queries
- MAST: Mikulski Archive for Space Telescopes queries
- ADS: NASA Astrophysics Data System literature search and BibTeX retrieval, allows simple commands to search for "latest papers" or "highly cited reviews".
- NED: NASA/IPAC Extragalactic Database name resolution
- NIST: National Institute of Standards and Technology Atomic Spectra Database queries
- Exoplanet: NASA Exoplanet Archive queries
- SDSS: Sloan Digital Sky Survey queries
- ESO: European Southern Observatory queries
- SIMBAD: SIMBAD Astronomical Database basic query
- Splatalogue: Molecular line queries
- VizieR: VizieR Catalogue Database catalog search, basic query
Some modules and commands are not fully implemented. Aliases are available for some modules (e.g., sim for simbad, viz for vizier, spl for splatalogue, hea for heasarc, exo for exoplanet). Please refer to aqc --help for the latest status.
- ⚡ Command autocompletion (manual installation required, see below)
- 🌏 Multi-language support (Simplified Chinese, Japanese; French in progress)
- 📊 Formatted output for query results
需要 Node.js ≥18 与本地 Python 3.11+。首次执行会在
~/.cache/astroquery-cli(可通过AQC_VENV_DIR覆盖)创建虚拟环境并安装 Python 端依赖。
npx astroquery-cli --help
# 示例:npx astroquery-cli simbad query --identifier "M31"可用环境变量:
AQC_PYTHON:指定 Python 解释器路径AQC_VENV_DIR:自定义虚拟环境缓存目录AQC_FORCE_INSTALL=1:强制重新安装/升级 Python 端依赖
git clone https://github.com/yourusername/astroquery-cli.git
cd astroquery-cli
pip install .Install shell autocompletion with:
aqc --install-completion bash # Bash
aqc --install-completion zsh # Zsh
aqc --install-completion fish # Fishaqc --help
aqc <module> --helpQuery VizieR for a catalog:
aqc vizier find-catalogs --keywords "quasar"
aqc vizier query --catalog "VII/118" --ra 12.5 --dec 12.5 --radius 0.1Query SIMBAD for an object:
aqc simbad query --identifier "M31"Query ALMA for observations:
aqc alma query --ra 83.633 --dec -5.391 --radius 0.1aqc --lang zh simbad query --identifier "M31"aqc --pingaqc --field simbadCommon options:
-l,--lang: Set output language (e.g., 'en', 'zh')-p,--ping: Test connectivity to major services (top-level command only)-f,--field: Check field validity for modules (top-level command only)
- Translation files are located in
locales/<lang>/LC_MESSAGES/messages.poand compiled to.mofiles
Helper scripts in the locales/ directory assist with extracting, updating, and compiling translation files. The general workflow is as follows:
- Extract untranslated entries: Run
locales/extract-untranslated.sh. This script generatesuntranslated_pot.tmp(for new entries inmessages.pot) anduntranslated_<lang>.tmpfiles (for untranslated entries in language-specific.pofiles). - Translate
untranslated_pot.tmp: Manually translate the entries inlocales/untranslated_pot.tmp. These are newmsgidentries that need to be added to all language files. - Merge translations: After translating
untranslated_pot.tmp, merge these translations into the respectiveuntranslated_<lang>.tmpfiles. This step typically involves copying the translatedmsgstrfromuntranslated_pot.tmpto the corresponding entries inuntranslated_<lang>.tmp. - Update
.pofiles: Runlocales/update-po.shto incorporate the translated entries from theuntranslated_<lang>.tmpfiles into themessages.pofiles for each language. - Check for updates: Run
locales/check-update.shto ensure all translation files are consistent and up-to-date. - Compile
.mofiles: After updating.pofiles, compile them into.mofiles usinglocales/compile-mo.sh(or similar command if not explicitly provided as a script).
Refer to the comments within each script in the locales/ directory for more detailed instructions.
This project is licensed under the BSD 3-Clause License.
See the LICENSE file for details.
This project uses astroquery,