tcga-downloader/examples/using_config.py
yunpeng.zhang a01a59b371
Some checks failed
CI / Lint (push) Failing after 9m32s
CI / Test (3.11) (push) Successful in 6m41s
CI / Test (3.12) (push) Successful in 4m21s
feat: add interactive cli
2026-02-09 13:13:39 +08:00

32 lines
785 B
Python
Executable File

#!/usr/bin/env python3
"""
Example: Use configuration file for downloads.
"""
from pathlib import Path
from tcga_downloader.cli import main
from tcga_downloader.config import save_default_config
def main():
config_path = Path("config.json")
print("Creating default configuration file...")
save_default_config(config_path)
print(f"Config file created at: {config_path}")
print("\nEdit the config file to customize:")
print(" - project: TCGA project ID")
print(" - data_type: Type of data to query")
print(" - out_dir: Directory for downloads")
print("\nYou can use the config file with:")
print(" tcga-downloader query --file config.json")
print(" tcga-downloader run --file config.json")
if __name__ == "__main__":
main()