Metadata-Version: 2.4
Name: tinet-data-foundry-cli
Version: 0.1.1
Summary: Tinet Data Foundry 取数 CLI（catalog / query / schema）
Author: Tinet
License: MIT
Project-URL: Homepage, https://data-foundry.tinetcloud.com
Project-URL: Documentation, https://data-foundry.tinetcloud.com
Keywords: data-foundry,tinet,cli
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Environment :: Console
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# tinet-data-foundry-cli

Tinet Data Foundry 取数 CLI。包名 `tinet-data-foundry-cli`，命令 **`tdf`**（避开系统磁盘命令 `df`）。

鉴权只用环境变量，**不要**把 AccessKey / SecretKey 写入本地文件。

```bash
pip install -U tinet-data-foundry-cli

export DF_ENDPOINT="https://data-foundry-data-api.tinetcloud.com"
export DF_AK="你的_AccessKey"
export DF_SK="你的_SecretKey"

tdf catalog
tdf schema --dataset "DATASET_ID"
tdf query \
  --dataset "DATASET_ID" \
  --fields "id" \
  --filter '{"op":"eq","field":"id","value":"sample"}' \
  --sort '[{"field":"id","direction":"DESC"}]' \
  --page-no 1 \
  --page-size 10
```

需要 Python **≥ 3.10**。若 pip 提示 scripts 目录不在 PATH，把该目录加入 PATH，或用 `python3 -m tinet_data_foundry_cli`。

| 命令 | 接口 |
| --- | --- |
| `tdf catalog` | `GET /data-api/v1/catalog` |
| `tdf query` | `POST /data-api/v1/datasets/{id}/query` |
| `tdf schema` | `GET /data-api/v1/datasets/{id}/schema` |

签名：`canonical = METHOD + "\n" + PATH + "\n" + TIMESTAMP + "\n" + NONCE + "\n" + hex(SHA256(body))`，`X-DF-Signature = Base64(HMAC-SHA256(canonical, SK))`。GET 的 body 为空字节。PATH 不含域名、不含 query。

## 发布到 PyPI

版本号改 `pyproject.toml` 与 `src/tinet_data_foundry_cli/__init__.py`。

```bash
python -m pip install -U build twine
python -m build
python -m twine check dist/*
python -m twine upload --repository testpypi dist/*
python -m twine upload dist/*
```

已发布版本号不可覆盖。
