feat: Click CLI wrapper for cantaloupe export #4

Closed
opened 2026-05-21 22:37:24 +00:00 by shawn · 0 comments
Owner

Summary

Built a Click-based CLI wrapper (python -m cantaloupe export) around the existing auth + download modules.

New files

  • cantaloupe/__init__.py - package marker
  • cantaloupe/__main__.py - entry point for python -m cantaloupe
  • cantaloupe/cli.py - Click CLI with export and configure commands
  • cantaloupe/config.py - credential management for ~/.cantaloupe.env
  • tests/test_cli.py - 39 tests (config, formatting, CLI commands, auth integration)

Modified files

  • src/auth.py - _get_credentials() now checks ~/.cantaloupe.env as fallback
  • tests/test_auth.py - 4 updated tests to mock env file path

Features

  • python -m cantaloupe export --output ./exports/ - download Excel
  • --headless / --visible - Playwright debug flag (future fallback)
  • --scheduled - non-interactive cron mode
  • --email / --password - CLI credential overrides
  • python -m cantaloupe configure - save credentials to ~/.cantaloupe.env
  • Reports file size, row count (via openpyxl), and elapsed time

Tests

86/86 pass (47 existing + 39 new)

Commit: 9c3d3ef (pushed to main)

## Summary Built a Click-based CLI wrapper (`python -m cantaloupe export`) around the existing auth + download modules. ## New files - `cantaloupe/__init__.py` - package marker - `cantaloupe/__main__.py` - entry point for `python -m cantaloupe` - `cantaloupe/cli.py` - Click CLI with `export` and `configure` commands - `cantaloupe/config.py` - credential management for `~/.cantaloupe.env` - `tests/test_cli.py` - 39 tests (config, formatting, CLI commands, auth integration) ## Modified files - `src/auth.py` - `_get_credentials()` now checks `~/.cantaloupe.env` as fallback - `tests/test_auth.py` - 4 updated tests to mock env file path ## Features - `python -m cantaloupe export --output ./exports/` - download Excel - `--headless / --visible` - Playwright debug flag (future fallback) - `--scheduled` - non-interactive cron mode - `--email / --password` - CLI credential overrides - `python -m cantaloupe configure` - save credentials to `~/.cantaloupe.env` - Reports file size, row count (via openpyxl), and elapsed time ## Tests 86/86 pass (47 existing + 39 new) Commit: 9c3d3ef (pushed to main)
shawn closed this issue 2026-05-21 22:37:42 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shawn/cantaloupe-downloader#4