ynab-amazon-categorizer 0.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. ynab_amazon_categorizer-0.0.0/.claude/tdd-guard/data/.claude/tdd-guard/data/instructions.md +50 -0
  2. ynab_amazon_categorizer-0.0.0/.claude/tdd-guard/data/config.json +1 -0
  3. ynab_amazon_categorizer-0.0.0/.claude/tdd-guard/data/instructions.md +118 -0
  4. ynab_amazon_categorizer-0.0.0/.claude/tdd-guard/data/modifications.json +10 -0
  5. ynab_amazon_categorizer-0.0.0/.env.example +14 -0
  6. ynab_amazon_categorizer-0.0.0/.github/workflows/release.yml +125 -0
  7. ynab_amazon_categorizer-0.0.0/.gitignore +50 -0
  8. ynab_amazon_categorizer-0.0.0/LICENSE +661 -0
  9. ynab_amazon_categorizer-0.0.0/PKG-INFO +226 -0
  10. ynab_amazon_categorizer-0.0.0/README.md +195 -0
  11. ynab_amazon_categorizer-0.0.0/install.bat +81 -0
  12. ynab_amazon_categorizer-0.0.0/pyproject.toml +52 -0
  13. ynab_amazon_categorizer-0.0.0/setup.cfg +4 -0
  14. ynab_amazon_categorizer-0.0.0/src/ynab_amazon_categorizer/__init__.py +18 -0
  15. ynab_amazon_categorizer-0.0.0/src/ynab_amazon_categorizer/__main__.py +6 -0
  16. ynab_amazon_categorizer-0.0.0/src/ynab_amazon_categorizer/cli.py +1057 -0
  17. ynab_amazon_categorizer-0.0.0/src/ynab_amazon_categorizer.egg-info/PKG-INFO +226 -0
  18. ynab_amazon_categorizer-0.0.0/src/ynab_amazon_categorizer.egg-info/SOURCES.txt +21 -0
  19. ynab_amazon_categorizer-0.0.0/src/ynab_amazon_categorizer.egg-info/dependency_links.txt +1 -0
  20. ynab_amazon_categorizer-0.0.0/src/ynab_amazon_categorizer.egg-info/entry_points.txt +2 -0
  21. ynab_amazon_categorizer-0.0.0/src/ynab_amazon_categorizer.egg-info/requires.txt +2 -0
  22. ynab_amazon_categorizer-0.0.0/src/ynab_amazon_categorizer.egg-info/top_level.txt +1 -0
  23. ynab_amazon_categorizer-0.0.0/ynab_amazon_categorizer.py.backup +1020 -0
@@ -0,0 +1,50 @@
1
+ ## TDD Fundamentals
2
+
3
+ ### The TDD Cycle
4
+ The foundation of TDD is the Red-Green-Refactor cycle:
5
+
6
+ 1. **Red Phase**: Write ONE failing test that describes desired behavior
7
+ - The test must fail for the RIGHT reason (not syntax/import errors)
8
+ - Only one test at a time - this is critical for TDD discipline
9
+ - **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
10
+ - Starting TDD for a new feature is always valid, even if test output shows unrelated work
11
+
12
+ 2. **Green Phase**: Write MINIMAL code to make the test pass
13
+ - Implement only what's needed for the current failing test
14
+ - No anticipatory coding or extra features
15
+ - Address the specific failure message
16
+
17
+ 3. **Refactor Phase**: Improve code structure while keeping tests green
18
+ - Only allowed when relevant tests are passing
19
+ - Requires proof that tests have been run and are green
20
+ - Applies to BOTH implementation and test code
21
+ - No refactoring with failing tests - fix them first
22
+
23
+ ### Core Violations
24
+
25
+ 1. **Multiple Test Addition**
26
+ - Adding more than one new test at once
27
+ - Exception: Initial test file setup or extracting shared test utilities
28
+
29
+ 2. **Over-Implementation**
30
+ - Code that exceeds what's needed to pass the current failing test
31
+ - Adding untested features, methods, or error handling
32
+ - Implementing multiple methods when test only requires one
33
+
34
+ 3. **Premature Implementation**
35
+ - Adding implementation before a test exists and fails properly
36
+ - Adding implementation without running the test first
37
+ - Refactoring when tests haven't been run or are failing
38
+
39
+ ### Critical Principle: Incremental Development
40
+ Each step in TDD should address ONE specific issue:
41
+ - Test fails "not defined" → Create empty stub/class only
42
+ - Test fails "not a function" → Add method stub only
43
+ - Test fails with assertion → Implement minimal logic only
44
+
45
+ ### General Information
46
+ - Sometimes the test output shows as no tests have been run when a new test is failing due to a missing import or constructor. In such cases, allow the agent to create simple stubs. Ask them if they forgot to create a stub if they are stuck.
47
+ - It is never allowed to introduce new logic without evidence of relevant failing tests. However, stubs and simple implementation to make imports and test infrastructure work is fine.
48
+ - In the refactor phase, it is perfectly fine to refactor both teest and implementation code. That said, completely new functionality is not allowed. Types, clean up, abstractions, and helpers are allowed as long as they do not introduce new behavior.
49
+ - Adding types, interfaces, or a constant in order to replace magic values is perfectly fine during refactoring.
50
+ - Provide the agent with helpful directions so that they do not get stuck when blocking them.
@@ -0,0 +1 @@
1
+ {"guardEnabled":false}
@@ -0,0 +1,118 @@
1
+ ## Rules
2
+
3
+ TDD follows a strict Red-Green-Refactor cycle:
4
+
5
+ ### Red Phase - Write a Failing Test
6
+ - Write ONE test that describes desired behavior
7
+ - The test must fail for the right reason (not syntax/import errors)
8
+ - No prior test output required - writing the first test starts the cycle
9
+ - Starting a new cycle is always valid, even with no test output, all tests passing, or test output showing unrelated work
10
+ - **Rule**: Only one new test at a time, regardless of operation type (Edit, MultiEdit, or Write)
11
+
12
+ ### Green Phase - Make the Test Pass
13
+ - Write MINIMAL code to pass the current failing test
14
+ - Match implementation precisely to the failure type:
15
+
16
+ | Test Failure Message | Required Implementation |
17
+ |---------------------|------------------------|
18
+ | "not defined" / "undefined" / "not found" | Create empty stub/class/module only |
19
+ | "not a constructor" / "cannot instantiate" | Create empty class only |
20
+ | "not a function" / "not callable" / "not a method" | Add method/function stub only |
21
+ | Assertion error (e.g., "expected X to be Y") | Implement minimal logic for assertion only |
22
+
23
+ - **Rule**: No anticipatory coding, extra features, or untested error handling
24
+
25
+ ### Refactor Phase - Improve Existing Code
26
+ - Only enter this phase when relevant tests are passing
27
+ - Requires evidence of green tests before any refactoring
28
+ - Applies to BOTH test and implementation code
29
+ - Allowed: Type additions, extracting helpers, reorganizing code, replacing magic values
30
+ - Allowed in tests: Moving setup to beforeEach, extracting test helpers
31
+ - **Rule**: No new functionality during refactoring
32
+
33
+ ## Validation Rules
34
+
35
+ ### Absolute Violations
36
+ These always result in blocking:
37
+
38
+ 1. **Multiple Test Addition**: Adding more than one new test (single test additions are always allowed)
39
+ 2. **Over-Implementation**: Code exceeding current test requirements
40
+ 3. **Premature Implementation**: Writing code without a failing test
41
+ 4. **Refactoring with Red Tests**: Attempting refactor when tests are failing or missing
42
+
43
+ ### File-Specific Rules
44
+
45
+ #### New File Creation
46
+ - **Test files**: Must contain exactly ONE test initially
47
+ - **Implementation files**: Must have failing test evidence justifying creation
48
+
49
+ #### Existing File Modification
50
+ - **Test files**: Can add ONE new test, modify existing tests, or refactor (if green)
51
+ - **Implementation files**: Changes must match current test failure type
52
+
53
+ ### Permitted Exceptions
54
+ - Configuration files (generally allowed)
55
+ - Initial test file setup with utilities
56
+ - Test helper and utility files
57
+ - Stubs to fix import/infrastructure issues
58
+ - Simple stubs when test output shows no tests due to missing imports or constructors
59
+ - Removing code, tests, validations, or functionality
60
+ - **Important**: Never introduce new logic without evidence of relevant failing tests
61
+
62
+ ## How to Analyze Changes
63
+
64
+ ### Counting New Tests
65
+ A test is "new" only if it doesn't exist in the old content. Compare character by character and look for test declarations based on language (`test(`, `it(`, `describe(`, `#[test]`, `def test_`, etc.).
66
+
67
+ **Example**: File has 3 existing tests, edit adds 2 more
68
+ - Old content: `test("A")...`, `test("B")...`, `test("C")...`
69
+ - New content: `test("A")...`, `test("B")...`, `test("C")...`, `test("D")...`, `test("E")...`
70
+ - **Count**: 2 new tests added (D and E), not 5 tests total
71
+
72
+ Not considered new:
73
+ - Moving, renaming, or reformatting existing tests
74
+ - Converting to parameterized tests or splitting into multiple tests
75
+
76
+ ### Identifying Relevant Tests
77
+ Tests are "relevant" when they:
78
+ - Exercise the code being modified
79
+ - Would fail if the modified code broke
80
+ - Import or depend on the changed module
81
+
82
+ ### Using Context Clues
83
+ - **Test output**: Shows current phase and required implementation
84
+ - **File paths**: Identify test vs implementation files
85
+
86
+ ## Decision Framework
87
+
88
+ ### When to Block
89
+ Block when detecting clear TDD violations. Provide:
90
+ 1. Specific violation type
91
+ 2. Why it violates TDD
92
+ 3. Correct next step
93
+
94
+ Provide helpful directions so the agent doesn't get stuck when blocking them. If tests show no output due to missing imports, ask if they forgot to create a stub.
95
+
96
+ Example: "Multiple test addition violation - adding 2 tests simultaneously. Add only ONE test first."
97
+
98
+ ### When to Approve
99
+ Approve when:
100
+ - Changes follow TDD principles
101
+ - Insufficient information to determine violation
102
+
103
+ Example: "Adding single test to test file - follows TDD red phase"
104
+
105
+ ## Quick Reference Examples
106
+
107
+ ### Blocked Scenarios
108
+ - Test shows "Calculator not defined" → Implementation adds class WITH methods
109
+ - No test output → Creating new implementation file
110
+ - Test failures present → Attempting to refactor
111
+ - Single operation → Adding two or more tests
112
+
113
+ ### Approved Scenarios
114
+ - Test shows "Calculator not defined" → Implementation adds empty class only
115
+ - No test output → Adding first test to test file
116
+ - Tests passing → Refactoring code structure
117
+ - Single operation → Adding exactly one test
118
+ - Any phase -> Removing implementation or test code
@@ -0,0 +1,10 @@
1
+ {
2
+ "session_id": "bffb4a40-5bd7-47b6-b7d2-ce8ec612b0c6",
3
+ "transcript_path": "C:\\Users\\ksutk\\.claude\\projects\\C--Users-ksutk-projects-ynab-amazon-categorizer\\bffb4a40-5bd7-47b6-b7d2-ce8ec612b0c6.jsonl",
4
+ "hook_event_name": "PreToolUse",
5
+ "tool_name": "Write",
6
+ "tool_input": {
7
+ "file_path": "C:\\Users\\ksutk\\projects\\ynab-amazon-categorizer\\src\\ynab_amazon_categorizer\\__main__.py",
8
+ "content": "\"\"\"Allow running the package as a module with python -m ynab_amazon_categorizer.\"\"\"\n\nfrom .cli import main\n\nif __name__ == \"__main__\":\n main()"
9
+ }
10
+ }
@@ -0,0 +1,14 @@
1
+ # YNAB Amazon Categorizer Configuration
2
+ # Copy this file to '.env' and fill in your values
3
+
4
+ # Your YNAB Personal Access Token
5
+ # Get this from: https://app.ynab.com/settings/developer
6
+ YNAB_API_KEY=your_api_key_here
7
+
8
+ # Your YNAB Budget ID
9
+ # Find this in your YNAB URL: https://app.ynab.com/[budget_id]/budget
10
+ YNAB_BUDGET_ID=your_budget_id_here
11
+
12
+ # Optional: Specific Account ID to process (leave as 'none' to process all accounts)
13
+ # Find this in your YNAB URL when viewing an account
14
+ YNAB_ACCOUNT_ID=none
@@ -0,0 +1,125 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Checkout code
13
+ uses: actions/checkout@v4
14
+
15
+ - name: Set up Python
16
+ uses: actions/setup-python@v4
17
+ with:
18
+ python-version: '3.9'
19
+
20
+ - name: Install dependencies
21
+ run: |
22
+ python -m pip install --upgrade pip
23
+ pip install -e .
24
+
25
+ - name: Test package can be imported and run
26
+ run: |
27
+ python -c "from ynab_amazon_categorizer.cli import main; print('Package imports successfully')"
28
+
29
+ publish:
30
+ needs: test
31
+ runs-on: ubuntu-latest
32
+ permissions:
33
+ id-token: write
34
+ contents: read
35
+
36
+ steps:
37
+ - name: Checkout code
38
+ uses: actions/checkout@v4
39
+
40
+ - name: Set up Python
41
+ uses: actions/setup-python@v4
42
+ with:
43
+ python-version: '3.9'
44
+
45
+ - name: Install build dependencies
46
+ run: |
47
+ python -m pip install --upgrade pip
48
+ pip install build twine
49
+
50
+ - name: Build package
51
+ run: python -m build
52
+
53
+ - name: Check package
54
+ run: twine check dist/*
55
+
56
+ - name: Publish to PyPI
57
+ uses: pypa/gh-action-pypi-publish@release/v1
58
+
59
+ create-release:
60
+ needs: [test, publish]
61
+ runs-on: ubuntu-latest
62
+ permissions:
63
+ contents: write
64
+
65
+ steps:
66
+ - name: Checkout code
67
+ uses: actions/checkout@v4
68
+ with:
69
+ fetch-depth: 0
70
+
71
+ - name: Extract version from tag
72
+ id: version
73
+ run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
74
+
75
+ - name: Generate changelog
76
+ id: changelog
77
+ run: |
78
+ # Get commits since last tag
79
+ LAST_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
80
+ if [ -n "$LAST_TAG" ]; then
81
+ CHANGELOG=$(git log --pretty=format:"- %s" $LAST_TAG..HEAD)
82
+ else
83
+ CHANGELOG=$(git log --pretty=format:"- %s" --max-count=10)
84
+ fi
85
+
86
+ # Create changelog file
87
+ cat > CHANGELOG.md << EOF
88
+ ## What's Changed
89
+
90
+ $CHANGELOG
91
+
92
+ ## Installation
93
+
94
+ This package is now available on PyPI! Install it with:
95
+
96
+ \`\`\`bash
97
+ # Install with pipx (recommended for CLI tools)
98
+ pipx install ynab-amazon-categorizer
99
+
100
+ # Or install with pip
101
+ pip install ynab-amazon-categorizer
102
+ \`\`\`
103
+
104
+ ## Usage
105
+
106
+ After installation, run:
107
+ \`\`\`bash
108
+ ynab-amazon-categorizer
109
+ \`\`\`
110
+
111
+ See README.md for detailed setup and configuration instructions.
112
+ EOF
113
+
114
+ - name: Create GitHub Release
115
+ uses: softprops/action-gh-release@v1
116
+ with:
117
+ tag_name: ${{ steps.version.outputs.VERSION }}
118
+ name: Release ${{ steps.version.outputs.VERSION }}
119
+ body_path: CHANGELOG.md
120
+ files: |
121
+ README.md
122
+ draft: false
123
+ prerelease: false
124
+ env:
125
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,50 @@
1
+ # YNAB API Credentials - NEVER COMMIT THESE!
2
+ .env
3
+ ynab_config.txt
4
+ api_key.txt
5
+
6
+ # Python
7
+ __pycache__/
8
+ *.py[cod]
9
+ *$py.class
10
+ *.so
11
+ .Python
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+
28
+ # Virtual environments
29
+ venv/
30
+ env/
31
+ ENV/
32
+
33
+ # IDE
34
+ .vscode/
35
+ .idea/
36
+ *.swp
37
+ *.swo
38
+
39
+ # OS
40
+ .DS_Store
41
+ Thumbs.db
42
+
43
+ # History files
44
+ .ynab_amazon_cat_history
45
+ .ynab_amazon_memo_history
46
+
47
+ # Release files
48
+ RELEASE_NOTES.md
49
+ temp_release.json
50
+ release/