Skip to content

Commit baf96da

Browse files
committed
refactor: rename astroquery_cli to src and update documentation
BREAKING CHANGE: Source directory renamed from astroquery_cli to src - Rename source directory: astroquery_cli -> src - Update all Python imports to use src module - Update pyproject.toml package configuration - Update npx-entry.js module path - Update README.md with: - Add French language support (fr) - Add command aliases: aav (AAVSO), fer (Fermi) - Update project structure documentation - Add language switch links (EN/ZH) - Update locales scripts for new path - Remove PUBLISH_GUIDE.md and publish.sh (security) - Sync package.json version to 1.2.0
1 parent 9741d28 commit baf96da

36 files changed

Lines changed: 374 additions & 190 deletions

README.md

Lines changed: 50 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
# Astro CLI 🚀
22

3+
**[中文文档](README_ZH.md)** | **English**
4+
35
> Your gateway to cosmos — Query astronomical data from command line
46
57
[![License](https://img.shields.io/badge/License-BSD%203Clause-blue.svg)](LICENSE)
68
[![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/downloads/)
79
[![Astropy](https://img.shields.io/badge/astropy-6.0%2B-orange.svg)](https://www.astropy.org/)
10+
[![npm version](https://img.shields.io/npm/v/astroquery-cli.svg)](https://www.npmjs.com/package/astroquery-cli)
811

912
---
1013

1114
## ✨ What is Astro CLI?
1215

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.
16+
**Astro CLI** 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.
1417

1518
*17 data sources. One command. Beautiful output. Multi-language support. Extensible for future services.*
1619

@@ -38,8 +41,8 @@ Query data from 17 different astronomical databases and services:
3841
| [SDSS](https://www.sdss.org/) | Sloan Digital Sky Survey | `astrocli sdss` | - |
3942
| [ESO](https://www.eso.org/) | European Southern Observatory | `astrocli eso` | - |
4043
| [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` | - |
44+
| [**AAVSO VSX**](https://www.aavso.org/vsx/) | Variable Star Index | `astrocli aavso` | `astrocli aav` |
45+
| [**Fermi-LAT**](https://fermi.gsfc.nasa.gov/) | Gamma-ray telescope data | `astrocli fermi` | `astrocli fer` |
4346

4447
---
4548

@@ -57,48 +60,48 @@ Query data from 17 different astronomical databases and services:
5760

5861
## 📦 Installation
5962

60-
Astro CLI 提供多种安装方式,选择适合你的方式:
63+
Astro CLI offers multiple installation methods. Choose the one that suits you:
6164

62-
### 方式一:npm 全局安装(推荐)
65+
### Method 1: npm Global Install (Recommended)
6366

6467
```bash
65-
# 全局安装(需要 Node.js ≥18 Python 3.11+
68+
# Global install (requires Node.js ≥18 and Python 3.11+)
6669
npm install -g astroquery-cli
6770

68-
# 安装后可使用以下任一命令:
69-
astroquery-cli --help # 完整命令
70-
aqc --help # 短命令
71-
astrocli --help # 别名命令
71+
# After installation, all three commands are available:
72+
astroquery-cli --help # Full command name
73+
aqc --help # Short command (recommended)
74+
astrocli --help # Alias command
7275

73-
# 示例:查询 SIMBAD 中的 M31
76+
# Example: Query SIMBAD for M31
7477
astrocli simbad object "M31"
7578
```
7679

77-
### 方式二:npx/pnpm 直接运行
80+
### Method 2: npx/pnpm (No Install Required)
7881

7982
```bash
80-
# 使用 npx(无需安装)
83+
# Using npx (no installation needed)
8184
npx astroquery-cli --help
8285

83-
# 使用 pnpm
86+
# Using pnpm
8487
pnpm astroquery-cli --help
8588

86-
# 示例
89+
# Example
8790
npx astroquery-cli simbad object "M31"
8891
```
8992

90-
### 方式三:PyPI 安装(Python 用户)
93+
### Method 3: PyPI Install (For Python Users)
9194

9295
```bash
93-
# 从 PyPI 安装 Python 包
96+
# Install Python package from PyPI
9497
pip install aqc-cli
9598

96-
# 安装后可使用命令:
99+
# After installation, available commands:
97100
aqc --help
98101
astrocli --help
99102
```
100103

101-
### 方式四:从源码安装
104+
### Method 4: Install from Source
102105

103106
```bash
104107
git clone https://github.com/inoribea/astroquery-cli.git
@@ -108,27 +111,27 @@ pip install -e .
108111

109112
---
110113

111-
### 📋 包名说明
114+
### 📋 Package Naming
112115

113-
| 平台 | 包名 | 安装命令 |
114-
|------|------|---------|
116+
| Platform | Package Name | Install Command |
117+
|----------|--------------|-----------------|
115118
| **npm** | `astroquery-cli` | `npm install -g astroquery-cli` |
116119
| **PyPI** | `aqc-cli` | `pip install aqc-cli` |
117120

118-
安装后,三个命令均可使用:
119-
- `astroquery-cli` - 完整命令名
120-
- `aqc` - 短命令(推荐)
121-
- `astrocli` - 别名命令
121+
After installation, all three commands are available:
122+
- `astroquery-cli` - Full command name
123+
- `aqc` - Short command (recommended)
124+
- `astrocli` - Alias command
122125

123126
---
124127

125-
### 环境变量
128+
### Environment Variables
126129

127-
- `AC_PYTHON` - 指定 Python 解释器路径
128-
- `AC_VENV_DIR` - 自定义虚拟环境缓存目录(默认:`~/.cache/astrocli`
129-
- `AC_FORCE_INSTALL=1` - 强制重新安装/升级 Python 依赖
130-
- `AC_DEBUG` - 启用调试模式
131-
- `AC_LANG` - 设置默认语言(en/zh/ja
130+
- `AC_PYTHON` - Specify Python interpreter path
131+
- `AC_VENV_DIR` - Custom virtual environment cache directory (default: `~/.cache/astrocli`)
132+
- `AC_FORCE_INSTALL=1` - Force reinstall/upgrade Python dependencies
133+
- `AC_DEBUG` - Enable debug mode
134+
- `AC_LANG` - Set default language (en/zh/ja)
132135

133136
---
134137

@@ -200,17 +203,20 @@ astrocli ads bibcode "2023A&A...555..959W"
200203
Change output language on-the-fly:
201204

202205
```bash
203-
astrocli --lang zh simbad object "M31" # Chinese
204-
astrocli --lang ja simbad object "M31" # Japanese
205206
astrocli --lang en simbad object "M31" # English
207+
astrocli --lang zh simbad object "M31" # Chinese (Simplified)
208+
astrocli --lang ja simbad object "M31" # Japanese
209+
astrocli --lang fr simbad object "M31" # French
206210
```
207211

212+
Supported languages: **English (en)**, **Chinese (zh)**, **Japanese (ja)**, **French (fr)**
213+
208214
---
209215

210216
## 🔧 Global Options
211217

212218
| Option | Description |
213-
|---------|-------------|
219+
|--------|-------------|
214220
| `-l, --lang` | Set output language (en/zh/ja) |
215221
| `-p, --ping` | Test connectivity to all services (top-level only) |
216222
| `-f, --field` | Check available fields for a module (top-level only) |
@@ -272,22 +278,23 @@ astrocli --ping
272278

273279
```
274280
astrocli/
275-
├── astrocli/
281+
├── src/ # Source code (renamed from astroquery_cli)
276282
│ ├── modules/ # Service-specific modules
277283
│ │ ├── simbad_cli.py
278284
│ │ ├── vizier_cli.py
279-
│ │ ├── aavso_cli.py # NEW: AAVSO VSX
280-
│ │ ├── fermi_cli.py # NEW: Fermi-LAT
285+
│ │ ├── aavso_cli.py # AAVSO VSX
286+
│ │ ├── fermi_cli.py # Fermi-LAT
281287
│ │ └── ...
282288
│ ├── utils.py # Common utilities
283289
│ ├── common_options.py # Shared CLI options
284290
│ ├── i18n.py # Internationalization
285291
│ └── main.py # CLI entry point
286292
├── locales/ # Translation files
287-
│ ├── zh/LC_MESSAGES/
288-
│ ├── ja/LC_MESSAGES/
289-
│ └── en/LC_MESSAGES/
290-
├── package.json # pnpm/npx configuration
293+
│ ├── en/LC_MESSAGES/ # English
294+
│ ├── zh/LC_MESSAGES/ # Chinese
295+
│ ├── ja/LC_MESSAGES/ # Japanese
296+
│ └── fr/LC_MESSAGES/ # French
297+
├── package.json # npm/npx configuration
291298
├── pyproject.toml # Python package config
292299
└── README.md
293300
```
@@ -319,22 +326,6 @@ This project uses [Astroquery](https://github.com/astropy/astroquery), which is
319326

320327
---
321328

322-
## 🔄 Migration from astroquery-cli
323-
324-
If you were previously using `astroquery-cli`, simply change your command:
325-
326-
```bash
327-
# Old command
328-
aqc simbad object "M31"
329-
330-
# New command
331-
astrocli simbad object "M31"
332-
```
333-
334-
All aliases remain the same: `sim` for `simbad`, `viz` for `vizier`, `spl` for `splatalogue`, etc.
335-
336-
---
337-
338329
## 📝 FAQ
339330

340331
<details>
@@ -356,4 +347,4 @@ Some advanced features or edge cases may not have full CLI coverage yet. Core qu
356347

357348
**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!
358349

359-
</details>
350+
</details>

locales/check-update.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ done
2828
pybabel compile -d "./locales"
2929
echo "Compiled .po files to locales/ directory."
3030

31-
# Also compile to astroquery_cli/locales/ directory where the application expects them
32-
echo "Compiling .mo files to astroquery_cli/locales/ directory..."
31+
# Also compile to src/locales/ directory where the application expects them
32+
echo "Compiling .mo files to src/locales/ directory..."
3333
for po_file in locales/*/LC_MESSAGES/messages.po; do
3434
if [ -f "$po_file" ]; then
3535
# Extract language code from path (e.g., locales/zh/LC_MESSAGES/messages.po -> zh)
3636
lang=$(echo "$po_file" | sed 's|locales/\([^/]*\)/LC_MESSAGES/messages.po|\1|')
37-
37+
3838
# Create target directory if it doesn't exist
39-
target_dir="astroquery_cli/locales/$lang/LC_MESSAGES"
39+
target_dir="src/locales/$lang/LC_MESSAGES"
4040
mkdir -p "$target_dir"
41-
41+
4242
# Compile .po to .mo in the target location
4343
msgfmt "$po_file" -o "$target_dir/messages.mo"
4444
echo " Compiled $po_file -> $target_dir/messages.mo"

npx-entry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function ensureCliInstalled() {
9090
}
9191

9292
function runCli() {
93-
const execution = tryCommand(venvPython, ["-m", "astroquery_cli.main", ...args]);
93+
const execution = tryCommand(venvPython, ["-m", "src.main", ...args]);
9494
process.exit(execution.status ?? 1);
9595
}
9696

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors = ["inoribea <inoribea@outlook.com>"]
66
license = "BSD-3-Clause"
77
readme = "README.md"
88

9-
packages = [{include = "astroquery_cli"}]
9+
packages = [{include = "src"}]
1010

1111
include = [{path = "locales/*/LC_MESSAGES/messages.mo"}]
1212

@@ -32,8 +32,8 @@ Repository = "https://github.com/inoribea/astroquery-cli"
3232
Issues = "https://github.com/inoribea/astroquery-cli/issues"
3333

3434
[tool.poetry.scripts]
35-
aqc = "astroquery_cli.main:cli"
36-
astrocli = "astroquery_cli.main:cli"
35+
aqc = "src.main:cli"
36+
astrocli = "src.main:cli"
3737

3838
[build-system]
3939
requires = ["poetry-core"]
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)