aqc-cli 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. aqc_cli-1.0.0/LICENSE +31 -0
  2. aqc_cli-1.0.0/PKG-INFO +346 -0
  3. aqc_cli-1.0.0/README.md +317 -0
  4. aqc_cli-1.0.0/astroquery_cli/__init__.py +30 -0
  5. aqc_cli-1.0.0/astroquery_cli/__main__.py +4 -0
  6. aqc_cli-1.0.0/astroquery_cli/common_options.py +77 -0
  7. aqc_cli-1.0.0/astroquery_cli/config.py +76 -0
  8. aqc_cli-1.0.0/astroquery_cli/debug.py +162 -0
  9. aqc_cli-1.0.0/astroquery_cli/i18n.py +86 -0
  10. aqc_cli-1.0.0/astroquery_cli/locales/fr/LC_MESSAGES/messages.mo +0 -0
  11. aqc_cli-1.0.0/astroquery_cli/locales/ja/LC_MESSAGES/messages.mo +0 -0
  12. aqc_cli-1.0.0/astroquery_cli/locales/zh/LC_MESSAGES/messages.mo +0 -0
  13. aqc_cli-1.0.0/astroquery_cli/main.py +443 -0
  14. aqc_cli-1.0.0/astroquery_cli/modules/aavso_cli.py +366 -0
  15. aqc_cli-1.0.0/astroquery_cli/modules/ads_cli.py +297 -0
  16. aqc_cli-1.0.0/astroquery_cli/modules/alma_cli.py +181 -0
  17. aqc_cli-1.0.0/astroquery_cli/modules/esasky_cli.py +308 -0
  18. aqc_cli-1.0.0/astroquery_cli/modules/eso_cli.py +137 -0
  19. aqc_cli-1.0.0/astroquery_cli/modules/exoplanet_cli.py +109 -0
  20. aqc_cli-1.0.0/astroquery_cli/modules/fermi_cli.py +295 -0
  21. aqc_cli-1.0.0/astroquery_cli/modules/gaia_cli.py +313 -0
  22. aqc_cli-1.0.0/astroquery_cli/modules/heasarc_cli.py +223 -0
  23. aqc_cli-1.0.0/astroquery_cli/modules/irsa_cli.py +471 -0
  24. aqc_cli-1.0.0/astroquery_cli/modules/jpl_cli.py +462 -0
  25. aqc_cli-1.0.0/astroquery_cli/modules/mast_cli.py +236 -0
  26. aqc_cli-1.0.0/astroquery_cli/modules/ned_cli.py +200 -0
  27. aqc_cli-1.0.0/astroquery_cli/modules/nist_cli.py +169 -0
  28. aqc_cli-1.0.0/astroquery_cli/modules/sdss_cli.py +175 -0
  29. aqc_cli-1.0.0/astroquery_cli/modules/simbad_cli.py +188 -0
  30. aqc_cli-1.0.0/astroquery_cli/modules/splatalogue_cli.py +221 -0
  31. aqc_cli-1.0.0/astroquery_cli/modules/vizier_cli.py +439 -0
  32. aqc_cli-1.0.0/astroquery_cli/options/field.py +204 -0
  33. aqc_cli-1.0.0/astroquery_cli/options/ping.py +73 -0
  34. aqc_cli-1.0.0/astroquery_cli/options/test.py +48 -0
  35. aqc_cli-1.0.0/astroquery_cli/utils.py +320 -0
  36. aqc_cli-1.0.0/locales/fr/LC_MESSAGES/messages.mo +0 -0
  37. aqc_cli-1.0.0/locales/ja/LC_MESSAGES/messages.mo +0 -0
  38. aqc_cli-1.0.0/locales/zh/LC_MESSAGES/messages.mo +0 -0
  39. aqc_cli-1.0.0/pyproject.toml +40 -0
aqc_cli-1.0.0/LICENSE ADDED
@@ -0,0 +1,31 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) [2025], [inoribea]
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions
8
+ are met:
9
+
10
+ 1. Redistributions of source code must retain the above copyright
11
+ notice, this list of conditions and the following disclaimer.
12
+
13
+ 2. Redistributions in binary form must reproduce the above copyright
14
+ notice, this list of conditions and the following disclaimer in the
15
+ documentation and/or other materials provided with the distribution.
16
+
17
+ 3. Neither the name of inoribea nor the names of its
18
+ contributors may be used to endorse or promote products derived from
19
+ this software without specific prior written permission.
20
+
21
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
+ POSSIBILITY OF SUCH DAMAGE.
aqc_cli-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,346 @@
1
+ Metadata-Version: 2.4
2
+ Name: aqc-cli
3
+ Version: 1.0.0
4
+ Summary: CLI for astroquery modules with autocompletion and multi-language support.
5
+ License: BSD-3-Clause
6
+ License-File: LICENSE
7
+ Author: inoribea
8
+ Author-email: inoribea@outlook.com
9
+ Requires-Python: >=3.11
10
+ Classifier: License :: OSI Approved :: BSD License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Requires-Dist: astropy (>=7.1.0,<8.0.0)
17
+ Requires-Dist: astroquery (>=0.4.10,<0.5.0)
18
+ Requires-Dist: babel (>=2.15.0,<3.0.0)
19
+ Requires-Dist: pyvo (>=1.4.1,<2.0.0)
20
+ Requires-Dist: requests (>=2.10.0,<3.0.0)
21
+ Requires-Dist: rich (>=13.5.2,<14.0.0)
22
+ Requires-Dist: typer (>=0.15.4,<0.16.0)
23
+ Project-URL: Documentation, https://github.com/inoribea/astroquery-cli#readme
24
+ Project-URL: Homepage, https://github.com/inoribea/astroquery-cli
25
+ Project-URL: Issues, https://github.com/inoribea/astroquery-cli/issues
26
+ Project-URL: Repository, https://github.com/inoribea/astroquery-cli
27
+ Description-Content-Type: text/markdown
28
+
29
+ # Astro CLI 🚀
30
+
31
+ > Your gateway to cosmos — Query astronomical data from command line
32
+
33
+ [![License](https://img.shields.io/badge/License-BSD%203Clause-blue.svg)](LICENSE)
34
+ [![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/downloads/)
35
+ [![Astropy](https://img.shields.io/badge/astropy-6.0%2B-orange.svg)](https://www.astropy.org/)
36
+
37
+ ---
38
+
39
+ ## ✨ What is Astro CLI?
40
+
41
+ **Astro CLI** (working title: suggestions welcome!) is a modern command-line tool that provides quick access to multiple astronomical data services through the [Astroquery](https://astroquery.readthedocs.io/) library. It's designed for astronomers, researchers, and anyone who needs to query astronomical databases efficiently from the terminal.
42
+
43
+ *17 data sources. One command. Beautiful output. Multi-language support. Extensible for future services.*
44
+
45
+ ---
46
+
47
+ ## 🧩 Supported Data Sources
48
+
49
+ Query data from 17 different astronomical databases and services:
50
+
51
+ | Service | Description | Command | Alias |
52
+ |---------|------------|----------|--------|
53
+ | [SIMBAD](https://simbad.cds.unistra.fr/) | Basic astronomical data & object identification | `astrocli simbad` | `astrocli sim` |
54
+ | [VizieR](https://vizier.cds.unistra.fr/) | Catalog database search | `astrocli vizier` | `astrocli viz` |
55
+ | [ALMA](https://almascience.org/) | ALMA radio telescope observations | `astrocli alma` | - |
56
+ | [ESASky](https://www.esa.int/Enabling_Support/Operations/ESASky/) | Sky region visualization | `astrocli esasky` | - |
57
+ | [Gaia](https://www.cosmos.esa.int/gaia/) | ESA Gaia mission data | `astrocli gaia` | - |
58
+ | [IRSA](https://irsa.ipac.caltech.edu/) | Infrared Science Archive | `astrocli irsa` | - |
59
+ | [HEASARC](https://heasarc.gsfc.nasa.gov/) | X-ray and Gamma-ray data | `astrocli heasarc` | `astrocli hea` |
60
+ | [JPL Horizons](https://ssd.jpl.nasa.gov/) | Solar System ephemerides | `astrocli jpl` | - |
61
+ | [MAST](https://mast.stsci.edu/) | Space Telescope Archive (HST, JWST, etc.) | `astrocli mast` | - |
62
+ | [ADS](https://ui.adsabs.harvard.edu/) | Astrophysics literature search | `astrocli ads` | - |
63
+ | [NED](https://ned.ipac.caltech.edu/) | Extragalactic Database | `astrocli ned` | - |
64
+ | [NIST](https://physics.nist.gov/ASD/) | Atomic spectra database | `astrocli nist` | - |
65
+ | [NASA Exoplanet](https://exoplanetarchive.ipac.caltech.edu/) | Exoplanet catalog | `astrocli exoplanet` | `astrocli exo` |
66
+ | [SDSS](https://www.sdss.org/) | Sloan Digital Sky Survey | `astrocli sdss` | - |
67
+ | [ESO](https://www.eso.org/) | European Southern Observatory | `astrocli eso` | - |
68
+ | [Splatalogue](https://www.splatalogue.org/) | Molecular line database | `astrocli splatalogue` | `astrocli spl` |
69
+ | [**AAVSO VSX**](https://www.aavso.org/vsx/) | Variable Star Index | `astrocli aavso` | - |
70
+ | [**Fermi-LAT**](https://fermi.gsfc.nasa.gov/) | Gamma-ray telescope data | `astrocli fermi` | - |
71
+
72
+ ---
73
+
74
+ ## 🌟 Key Features
75
+
76
+ - **📦 Multi-Source Access**: Query 17+ astronomical databases from a single interface
77
+ - **🌏 Internationalized UI**: Built-in support for English, Chinese (Simplified), and Japanese
78
+ - **📊 Rich Output**: Beautifully formatted tables with support for exporting to CSV, ECSV, FITS, and more
79
+ - **⚡ Smart Defaults**: Sensible defaults with extensive customization options
80
+ - **🔍 Service Health**: Built-in connectivity testing (`--ping`) and field validation (`--field`)
81
+ - **🧑‍💻 Shell Completion**: Auto-completion support for Bash, Zsh, and Fish
82
+ - **🌌 Extensible**: Easy to add new astronomical data services
83
+
84
+ ---
85
+
86
+ ## 📦 Installation
87
+
88
+ ### Quick Start (via npx/pnpm)
89
+
90
+ Requires: Node.js ≥18 and Python 3.11+
91
+
92
+ ```bash
93
+ # Using pnpm (recommended)
94
+ pnpm astrocli --help
95
+
96
+ # Using npx
97
+ npx astrocli --help
98
+
99
+ # Example: Query SIMBAD for M31
100
+ pnpm astrocli simbad object "M31"
101
+ ```
102
+
103
+ ### Environment Variables
104
+
105
+ - `AC_PYTHON` - Specify Python interpreter path
106
+ - `AC_VENV_DIR` - Custom virtual environment cache directory (default: `~/.cache/astrocli`)
107
+ - `AC_FORCE_INSTALL=1` - Force reinstall/upgrade Python dependencies
108
+ - `AC_DEBUG` - Enable debug mode
109
+ - `AC_LANG` - Set default language (en/zh/ja)
110
+
111
+ ### Install from Source
112
+
113
+ ```bash
114
+ git clone https://github.com/yourusername/astrocli.git
115
+ cd astrocli
116
+ pip install -e .
117
+ ```
118
+
119
+ ---
120
+
121
+ ## 📚 Usage
122
+
123
+ ### View All Available Commands
124
+
125
+ ```bash
126
+ # Show all available modules and commands
127
+ astrocli --help
128
+
129
+ # Show help for a specific module
130
+ astrocli <module> --help
131
+ ```
132
+
133
+ ### Query Examples
134
+
135
+ #### 1. Query SIMBAD for an object
136
+
137
+ ```bash
138
+ astrocli simbad object "M31"
139
+ astrocli simbad object "Crab Nebula" --show-all-cols
140
+ ```
141
+
142
+ #### 2. Search VizieR catalogs
143
+
144
+ ```bash
145
+ # Find catalogs by keywords
146
+ astrocli vizier find-catalogs --keyword photometry --keyword galaxy
147
+
148
+ # Query a specific catalog
149
+ astrocli vizier object "M31" --radius 0.1 --catalog "I/261/gaiadr3"
150
+ ```
151
+
152
+ #### 3. Query AAVSO Variable Star Index (NEW!)
153
+
154
+ ```bash
155
+ # Query a variable star by name
156
+ astrocli aavso object "SS Cyg"
157
+
158
+ # Search variable stars in a sky region
159
+ astrocli aavso region 196.421 18.018 --radius 0.5
160
+
161
+ # Get results in JSON format
162
+ astrocli aavso object "T CrB" --format json
163
+ ```
164
+
165
+ #### 4. Query Fermi-LAT Data (NEW!)
166
+
167
+ ```bash
168
+ # Query Fermi data for a target
169
+ astrocli fermi object "Crab Nebula" --energy "1000,100000" --dates "2020-01-01 00:00:00, 2020-01-02 00:00:00"
170
+
171
+ # Clear Fermi cache
172
+ astrocli fermi clear-cache
173
+ ```
174
+
175
+ #### 5. Search ADS literature
176
+
177
+ ```bash
178
+ astrocli ads search --title "exoplanet detection"
179
+ astrocli ads bibcode "2023A&A...555..959W"
180
+ ```
181
+
182
+ ---
183
+
184
+ ## 🌐 Multi-Language Support
185
+
186
+ Change output language on-the-fly:
187
+
188
+ ```bash
189
+ astrocli --lang zh simbad object "M31" # Chinese
190
+ astrocli --lang ja simbad object "M31" # Japanese
191
+ astrocli --lang en simbad object "M31" # English
192
+ ```
193
+
194
+ ---
195
+
196
+ ## 🔧 Global Options
197
+
198
+ | Option | Description |
199
+ |---------|-------------|
200
+ | `-l, --lang` | Set output language (en/zh/ja) |
201
+ | `-p, --ping` | Test connectivity to all services (top-level only) |
202
+ | `-f, --field` | Check available fields for a module (top-level only) |
203
+ | `-d, --debug` | Enable debug mode with verbose output |
204
+ | `-v, --verbose` | Enable verbose output |
205
+
206
+ ---
207
+
208
+ ## 🧑‍💻 Shell Autocompletion
209
+
210
+ Install completion for your shell:
211
+
212
+ ```bash
213
+ astrocli --install-completion bash # Bash
214
+ astrocli --install-completion zsh # Zsh
215
+ astrocli --install-completion fish # Fish
216
+ ```
217
+
218
+ Add this to your shell config (e.g., `~/.zshrc`):
219
+
220
+ ```bash
221
+ # For zsh
222
+ eval "$(astrocli --install-completion zsh)"
223
+
224
+ # For bash
225
+ eval "$(astrocli --install-completion bash)"
226
+ ```
227
+
228
+ ---
229
+
230
+ ## 📊 Output & Export
231
+
232
+ Save query results to file:
233
+
234
+ ```bash
235
+ astrocli simbad object "M31" --output-file results.csv
236
+
237
+ # Specify format explicitly
238
+ astrocli simbad object "M31" --output-file data.ecsv --output-format ecsv
239
+ ```
240
+
241
+ Supported formats: `csv`, `ecsv`, `fits`, `votable`, `html`, `latex`, `ascii`
242
+
243
+ ---
244
+
245
+ ## 🔍 Testing Service Connectivity
246
+
247
+ Check if all data services are accessible:
248
+
249
+ ```bash
250
+ astrocli --ping
251
+ ```
252
+
253
+ ---
254
+
255
+ ## 🛠️ Development
256
+
257
+ ### Project Structure
258
+
259
+ ```
260
+ astrocli/
261
+ ├── astrocli/
262
+ │ ├── modules/ # Service-specific modules
263
+ │ │ ├── simbad_cli.py
264
+ │ │ ├── vizier_cli.py
265
+ │ │ ├── aavso_cli.py # NEW: AAVSO VSX
266
+ │ │ ├── fermi_cli.py # NEW: Fermi-LAT
267
+ │ │ └── ...
268
+ │ ├── utils.py # Common utilities
269
+ │ ├── common_options.py # Shared CLI options
270
+ │ ├── i18n.py # Internationalization
271
+ │ └── main.py # CLI entry point
272
+ ├── locales/ # Translation files
273
+ │ ├── zh/LC_MESSAGES/
274
+ │ ├── ja/LC_MESSAGES/
275
+ │ └── en/LC_MESSAGES/
276
+ ├── package.json # pnpm/npx configuration
277
+ ├── pyproject.toml # Python package config
278
+ └── README.md
279
+ ```
280
+
281
+ ### Adding a New Module
282
+
283
+ 1. Create `modules/<service>_cli.py` following existing patterns
284
+ 2. Import in `main.py`'s `setup_subcommands()`
285
+ 3. Add to README module list
286
+ 4. Add translations to `locales/` directories
287
+
288
+ ---
289
+
290
+ ## 📄 License
291
+
292
+ BSD 3-Clause License
293
+
294
+ This project uses [Astroquery](https://github.com/astropy/astroquery), which is licensed under the BSD 3-Clause License.
295
+
296
+ ---
297
+
298
+ ## 🙏 Acknowledgments
299
+
300
+ - [Astroquery](https://astroquery.readthedocs.io/) - Core library for astronomical data access
301
+ - [Typer](https://typer.tiangolo.com/) - Modern CLI framework
302
+ - [Rich](https://github.com/Textualize/rich) - Beautiful terminal output
303
+ - [AAVSO](https://www.aavso.org/) - American Association of Variable Star Observers
304
+ - [Fermi Team](https://fermi.gsfc.nasa.gov/) - Fermi Gamma-ray Space Telescope
305
+
306
+ ---
307
+
308
+ ## 🔄 Migration from astroquery-cli
309
+
310
+ If you were previously using `astroquery-cli`, simply change your command:
311
+
312
+ ```bash
313
+ # Old command
314
+ aqc simbad object "M31"
315
+
316
+ # New command
317
+ astrocli simbad object "M31"
318
+ ```
319
+
320
+ All aliases remain the same: `sim` for `simbad`, `viz` for `vizier`, `spl` for `splatalogue`, etc.
321
+
322
+ ---
323
+
324
+ ## 📝 FAQ
325
+
326
+ <details>
327
+ <summary><b>Common Questions</b></summary>
328
+
329
+ ### Can I use this without Node.js?
330
+
331
+ Yes! Install from source: `pip install -e .` or use Python directly after installing dependencies.
332
+
333
+ ### How do I add a new data service?
334
+
335
+ See the [Development](#-development) section above. Most services in Astroquery can be wrapped with similar patterns.
336
+
337
+ ### Why do some modules say "not fully implemented"?
338
+
339
+ Some advanced features or edge cases may not have full CLI coverage yet. Core query functionality works, but special parameters might need direct access to the underlying astroquery library.
340
+
341
+ ### What's the difference between this and astroquery?
342
+
343
+ **Astro CLI** is a command-line interface for Astroquery. Think of it as a user-friendly wrapper that makes common tasks easier. It doesn't replace Astroquery — it enhances it!
344
+
345
+ </details>
346
+
@@ -0,0 +1,317 @@
1
+ # Astro CLI 🚀
2
+
3
+ > Your gateway to cosmos — Query astronomical data from command line
4
+
5
+ [![License](https://img.shields.io/badge/License-BSD%203Clause-blue.svg)](LICENSE)
6
+ [![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/downloads/)
7
+ [![Astropy](https://img.shields.io/badge/astropy-6.0%2B-orange.svg)](https://www.astropy.org/)
8
+
9
+ ---
10
+
11
+ ## ✨ What is Astro CLI?
12
+
13
+ **Astro CLI** (working title: suggestions welcome!) is a modern command-line tool that provides quick access to multiple astronomical data services through the [Astroquery](https://astroquery.readthedocs.io/) library. It's designed for astronomers, researchers, and anyone who needs to query astronomical databases efficiently from the terminal.
14
+
15
+ *17 data sources. One command. Beautiful output. Multi-language support. Extensible for future services.*
16
+
17
+ ---
18
+
19
+ ## 🧩 Supported Data Sources
20
+
21
+ Query data from 17 different astronomical databases and services:
22
+
23
+ | Service | Description | Command | Alias |
24
+ |---------|------------|----------|--------|
25
+ | [SIMBAD](https://simbad.cds.unistra.fr/) | Basic astronomical data & object identification | `astrocli simbad` | `astrocli sim` |
26
+ | [VizieR](https://vizier.cds.unistra.fr/) | Catalog database search | `astrocli vizier` | `astrocli viz` |
27
+ | [ALMA](https://almascience.org/) | ALMA radio telescope observations | `astrocli alma` | - |
28
+ | [ESASky](https://www.esa.int/Enabling_Support/Operations/ESASky/) | Sky region visualization | `astrocli esasky` | - |
29
+ | [Gaia](https://www.cosmos.esa.int/gaia/) | ESA Gaia mission data | `astrocli gaia` | - |
30
+ | [IRSA](https://irsa.ipac.caltech.edu/) | Infrared Science Archive | `astrocli irsa` | - |
31
+ | [HEASARC](https://heasarc.gsfc.nasa.gov/) | X-ray and Gamma-ray data | `astrocli heasarc` | `astrocli hea` |
32
+ | [JPL Horizons](https://ssd.jpl.nasa.gov/) | Solar System ephemerides | `astrocli jpl` | - |
33
+ | [MAST](https://mast.stsci.edu/) | Space Telescope Archive (HST, JWST, etc.) | `astrocli mast` | - |
34
+ | [ADS](https://ui.adsabs.harvard.edu/) | Astrophysics literature search | `astrocli ads` | - |
35
+ | [NED](https://ned.ipac.caltech.edu/) | Extragalactic Database | `astrocli ned` | - |
36
+ | [NIST](https://physics.nist.gov/ASD/) | Atomic spectra database | `astrocli nist` | - |
37
+ | [NASA Exoplanet](https://exoplanetarchive.ipac.caltech.edu/) | Exoplanet catalog | `astrocli exoplanet` | `astrocli exo` |
38
+ | [SDSS](https://www.sdss.org/) | Sloan Digital Sky Survey | `astrocli sdss` | - |
39
+ | [ESO](https://www.eso.org/) | European Southern Observatory | `astrocli eso` | - |
40
+ | [Splatalogue](https://www.splatalogue.org/) | Molecular line database | `astrocli splatalogue` | `astrocli spl` |
41
+ | [**AAVSO VSX**](https://www.aavso.org/vsx/) | Variable Star Index | `astrocli aavso` | - |
42
+ | [**Fermi-LAT**](https://fermi.gsfc.nasa.gov/) | Gamma-ray telescope data | `astrocli fermi` | - |
43
+
44
+ ---
45
+
46
+ ## 🌟 Key Features
47
+
48
+ - **📦 Multi-Source Access**: Query 17+ astronomical databases from a single interface
49
+ - **🌏 Internationalized UI**: Built-in support for English, Chinese (Simplified), and Japanese
50
+ - **📊 Rich Output**: Beautifully formatted tables with support for exporting to CSV, ECSV, FITS, and more
51
+ - **⚡ Smart Defaults**: Sensible defaults with extensive customization options
52
+ - **🔍 Service Health**: Built-in connectivity testing (`--ping`) and field validation (`--field`)
53
+ - **🧑‍💻 Shell Completion**: Auto-completion support for Bash, Zsh, and Fish
54
+ - **🌌 Extensible**: Easy to add new astronomical data services
55
+
56
+ ---
57
+
58
+ ## 📦 Installation
59
+
60
+ ### Quick Start (via npx/pnpm)
61
+
62
+ Requires: Node.js ≥18 and Python 3.11+
63
+
64
+ ```bash
65
+ # Using pnpm (recommended)
66
+ pnpm astrocli --help
67
+
68
+ # Using npx
69
+ npx astrocli --help
70
+
71
+ # Example: Query SIMBAD for M31
72
+ pnpm astrocli simbad object "M31"
73
+ ```
74
+
75
+ ### Environment Variables
76
+
77
+ - `AC_PYTHON` - Specify Python interpreter path
78
+ - `AC_VENV_DIR` - Custom virtual environment cache directory (default: `~/.cache/astrocli`)
79
+ - `AC_FORCE_INSTALL=1` - Force reinstall/upgrade Python dependencies
80
+ - `AC_DEBUG` - Enable debug mode
81
+ - `AC_LANG` - Set default language (en/zh/ja)
82
+
83
+ ### Install from Source
84
+
85
+ ```bash
86
+ git clone https://github.com/yourusername/astrocli.git
87
+ cd astrocli
88
+ pip install -e .
89
+ ```
90
+
91
+ ---
92
+
93
+ ## 📚 Usage
94
+
95
+ ### View All Available Commands
96
+
97
+ ```bash
98
+ # Show all available modules and commands
99
+ astrocli --help
100
+
101
+ # Show help for a specific module
102
+ astrocli <module> --help
103
+ ```
104
+
105
+ ### Query Examples
106
+
107
+ #### 1. Query SIMBAD for an object
108
+
109
+ ```bash
110
+ astrocli simbad object "M31"
111
+ astrocli simbad object "Crab Nebula" --show-all-cols
112
+ ```
113
+
114
+ #### 2. Search VizieR catalogs
115
+
116
+ ```bash
117
+ # Find catalogs by keywords
118
+ astrocli vizier find-catalogs --keyword photometry --keyword galaxy
119
+
120
+ # Query a specific catalog
121
+ astrocli vizier object "M31" --radius 0.1 --catalog "I/261/gaiadr3"
122
+ ```
123
+
124
+ #### 3. Query AAVSO Variable Star Index (NEW!)
125
+
126
+ ```bash
127
+ # Query a variable star by name
128
+ astrocli aavso object "SS Cyg"
129
+
130
+ # Search variable stars in a sky region
131
+ astrocli aavso region 196.421 18.018 --radius 0.5
132
+
133
+ # Get results in JSON format
134
+ astrocli aavso object "T CrB" --format json
135
+ ```
136
+
137
+ #### 4. Query Fermi-LAT Data (NEW!)
138
+
139
+ ```bash
140
+ # Query Fermi data for a target
141
+ astrocli fermi object "Crab Nebula" --energy "1000,100000" --dates "2020-01-01 00:00:00, 2020-01-02 00:00:00"
142
+
143
+ # Clear Fermi cache
144
+ astrocli fermi clear-cache
145
+ ```
146
+
147
+ #### 5. Search ADS literature
148
+
149
+ ```bash
150
+ astrocli ads search --title "exoplanet detection"
151
+ astrocli ads bibcode "2023A&A...555..959W"
152
+ ```
153
+
154
+ ---
155
+
156
+ ## 🌐 Multi-Language Support
157
+
158
+ Change output language on-the-fly:
159
+
160
+ ```bash
161
+ astrocli --lang zh simbad object "M31" # Chinese
162
+ astrocli --lang ja simbad object "M31" # Japanese
163
+ astrocli --lang en simbad object "M31" # English
164
+ ```
165
+
166
+ ---
167
+
168
+ ## 🔧 Global Options
169
+
170
+ | Option | Description |
171
+ |---------|-------------|
172
+ | `-l, --lang` | Set output language (en/zh/ja) |
173
+ | `-p, --ping` | Test connectivity to all services (top-level only) |
174
+ | `-f, --field` | Check available fields for a module (top-level only) |
175
+ | `-d, --debug` | Enable debug mode with verbose output |
176
+ | `-v, --verbose` | Enable verbose output |
177
+
178
+ ---
179
+
180
+ ## 🧑‍💻 Shell Autocompletion
181
+
182
+ Install completion for your shell:
183
+
184
+ ```bash
185
+ astrocli --install-completion bash # Bash
186
+ astrocli --install-completion zsh # Zsh
187
+ astrocli --install-completion fish # Fish
188
+ ```
189
+
190
+ Add this to your shell config (e.g., `~/.zshrc`):
191
+
192
+ ```bash
193
+ # For zsh
194
+ eval "$(astrocli --install-completion zsh)"
195
+
196
+ # For bash
197
+ eval "$(astrocli --install-completion bash)"
198
+ ```
199
+
200
+ ---
201
+
202
+ ## 📊 Output & Export
203
+
204
+ Save query results to file:
205
+
206
+ ```bash
207
+ astrocli simbad object "M31" --output-file results.csv
208
+
209
+ # Specify format explicitly
210
+ astrocli simbad object "M31" --output-file data.ecsv --output-format ecsv
211
+ ```
212
+
213
+ Supported formats: `csv`, `ecsv`, `fits`, `votable`, `html`, `latex`, `ascii`
214
+
215
+ ---
216
+
217
+ ## 🔍 Testing Service Connectivity
218
+
219
+ Check if all data services are accessible:
220
+
221
+ ```bash
222
+ astrocli --ping
223
+ ```
224
+
225
+ ---
226
+
227
+ ## 🛠️ Development
228
+
229
+ ### Project Structure
230
+
231
+ ```
232
+ astrocli/
233
+ ├── astrocli/
234
+ │ ├── modules/ # Service-specific modules
235
+ │ │ ├── simbad_cli.py
236
+ │ │ ├── vizier_cli.py
237
+ │ │ ├── aavso_cli.py # NEW: AAVSO VSX
238
+ │ │ ├── fermi_cli.py # NEW: Fermi-LAT
239
+ │ │ └── ...
240
+ │ ├── utils.py # Common utilities
241
+ │ ├── common_options.py # Shared CLI options
242
+ │ ├── i18n.py # Internationalization
243
+ │ └── main.py # CLI entry point
244
+ ├── locales/ # Translation files
245
+ │ ├── zh/LC_MESSAGES/
246
+ │ ├── ja/LC_MESSAGES/
247
+ │ └── en/LC_MESSAGES/
248
+ ├── package.json # pnpm/npx configuration
249
+ ├── pyproject.toml # Python package config
250
+ └── README.md
251
+ ```
252
+
253
+ ### Adding a New Module
254
+
255
+ 1. Create `modules/<service>_cli.py` following existing patterns
256
+ 2. Import in `main.py`'s `setup_subcommands()`
257
+ 3. Add to README module list
258
+ 4. Add translations to `locales/` directories
259
+
260
+ ---
261
+
262
+ ## 📄 License
263
+
264
+ BSD 3-Clause License
265
+
266
+ This project uses [Astroquery](https://github.com/astropy/astroquery), which is licensed under the BSD 3-Clause License.
267
+
268
+ ---
269
+
270
+ ## 🙏 Acknowledgments
271
+
272
+ - [Astroquery](https://astroquery.readthedocs.io/) - Core library for astronomical data access
273
+ - [Typer](https://typer.tiangolo.com/) - Modern CLI framework
274
+ - [Rich](https://github.com/Textualize/rich) - Beautiful terminal output
275
+ - [AAVSO](https://www.aavso.org/) - American Association of Variable Star Observers
276
+ - [Fermi Team](https://fermi.gsfc.nasa.gov/) - Fermi Gamma-ray Space Telescope
277
+
278
+ ---
279
+
280
+ ## 🔄 Migration from astroquery-cli
281
+
282
+ If you were previously using `astroquery-cli`, simply change your command:
283
+
284
+ ```bash
285
+ # Old command
286
+ aqc simbad object "M31"
287
+
288
+ # New command
289
+ astrocli simbad object "M31"
290
+ ```
291
+
292
+ All aliases remain the same: `sim` for `simbad`, `viz` for `vizier`, `spl` for `splatalogue`, etc.
293
+
294
+ ---
295
+
296
+ ## 📝 FAQ
297
+
298
+ <details>
299
+ <summary><b>Common Questions</b></summary>
300
+
301
+ ### Can I use this without Node.js?
302
+
303
+ Yes! Install from source: `pip install -e .` or use Python directly after installing dependencies.
304
+
305
+ ### How do I add a new data service?
306
+
307
+ See the [Development](#-development) section above. Most services in Astroquery can be wrapped with similar patterns.
308
+
309
+ ### Why do some modules say "not fully implemented"?
310
+
311
+ Some advanced features or edge cases may not have full CLI coverage yet. Core query functionality works, but special parameters might need direct access to the underlying astroquery library.
312
+
313
+ ### What's the difference between this and astroquery?
314
+
315
+ **Astro CLI** is a command-line interface for Astroquery. Think of it as a user-friendly wrapper that makes common tasks easier. It doesn't replace Astroquery — it enhances it!
316
+
317
+ </details>