Skip to content

Add wildcard support for data source file paths#45

Open
davidfowl wants to merge 1 commit intomainfrom
glob-pattern-support
Open

Add wildcard support for data source file paths#45
davidfowl wants to merge 1 commit intomainfrom
glob-pattern-support

Conversation

@davidfowl
Copy link
Owner

Summary

Adds support for glob patterns in data source file paths, allowing users to match multiple files with a single configuration entry.

Based on PR #44 by @vechiato, with added tests for cross-platform verification.

Changes

  • Added _expand_file_pattern() function to handle wildcard patterns (*, ?, [])
  • Updated cmd_run(), cmd_discover(), cmd_explain(), and cmd_diag() to process multiple matched files
  • Files are processed in sorted order for consistency
  • Improved error messages to show pattern matching results
  • Updated documentation with wildcard examples in README.md and settings.yaml.example
  • Added comprehensive tests for glob pattern functionality

Example Usage

data_sources:
  - name: AMEX
    file: data/amex*.csv      # Matches amex-2024.csv, amex-2025.csv, etc.
    account_type: credit_card
    format: "{date:%m/%d/%Y},{description},{amount}"

Test Plan

  • Glob pattern matches multiple files
  • Single file path (no wildcards) still works
  • No matches shows helpful error message
  • Diag command shows matched files
  • Files processed in sorted order

Closes #44

🤖 Generated with Claude Code

Adds support for glob patterns in data source file paths, allowing users
to match multiple files with a single configuration entry.

Changes:
- Added `_expand_file_pattern()` function to handle wildcards (*, ?, [])
- Updated cmd_run(), cmd_discover(), cmd_explain(), cmd_diag() to process
  multiple matched files
- Files are processed in sorted order for consistency
- Improved error messages to show pattern matching results
- Updated documentation with wildcard examples
- Added comprehensive tests for glob pattern functionality

Example usage:
```yaml
data_sources:
  - name: AMEX
    file: data/amex*.csv  # Matches amex-2024.csv, amex-2025.csv, etc.
    format: "{date:%m/%d/%Y},{description},{amount}"
```

Based on PR #44 by @vechiato with added tests.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

PR Build Available

Version: 0.0.45-b11baad

Install from this PR

Linux / macOS:

curl -fsSL https://raw.githubusercontent.com/davidfowl/tally/main/docs/install-pr.sh | bash -s -- 45

Windows PowerShell:

iex "& { $(irm https://raw.githubusercontent.com/davidfowl/tally/main/docs/install-pr.ps1) } 45"

Manual download: View workflow run and download artifacts.

Requirements
  • GitHub CLI (gh) must be installed and authenticated
  • Run gh auth login if not already authenticated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant