moneyflow 0.1.2__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.
- moneyflow-0.1.2/.claude/hooks/edit +9 -0
- moneyflow-0.1.2/.github/CNAME +1 -0
- moneyflow-0.1.2/.github/workflows/docs.yml +41 -0
- moneyflow-0.1.2/.github/workflows/test.yml +50 -0
- moneyflow-0.1.2/.gitignore +48 -0
- moneyflow-0.1.2/.python-version +1 -0
- moneyflow-0.1.2/CLAUDE.md +308 -0
- moneyflow-0.1.2/LICENSE +21 -0
- moneyflow-0.1.2/MANIFEST.in +7 -0
- moneyflow-0.1.2/PKG-INFO +475 -0
- moneyflow-0.1.2/PUBLISHING.md +127 -0
- moneyflow-0.1.2/README.md +423 -0
- moneyflow-0.1.2/SECURITY.md +85 -0
- moneyflow-0.1.2/docs/README.md +65 -0
- moneyflow-0.1.2/docs/config/advanced.md +5 -0
- moneyflow-0.1.2/docs/config/caching.md +5 -0
- moneyflow-0.1.2/docs/config/credentials.md +5 -0
- moneyflow-0.1.2/docs/development/architecture.md +5 -0
- moneyflow-0.1.2/docs/development/contributing.md +5 -0
- moneyflow-0.1.2/docs/development/developing.md +410 -0
- moneyflow-0.1.2/docs/development/testing.md +5 -0
- moneyflow-0.1.2/docs/getting-started/first-run.md +144 -0
- moneyflow-0.1.2/docs/getting-started/installation.md +116 -0
- moneyflow-0.1.2/docs/getting-started/quickstart.md +123 -0
- moneyflow-0.1.2/docs/guide/editing.md +15 -0
- moneyflow-0.1.2/docs/guide/filters.md +5 -0
- moneyflow-0.1.2/docs/guide/keyboard-shortcuts.md +257 -0
- moneyflow-0.1.2/docs/guide/time-navigation.md +5 -0
- moneyflow-0.1.2/docs/guide/views.md +52 -0
- moneyflow-0.1.2/docs/index.md +164 -0
- moneyflow-0.1.2/docs/reference/cli.md +5 -0
- moneyflow-0.1.2/docs/reference/faq.md +5 -0
- moneyflow-0.1.2/docs/reference/troubleshooting.md +5 -0
- moneyflow-0.1.2/docs/stylesheets/extra.css +45 -0
- moneyflow-0.1.2/docs/stylesheets/terminal.css +150 -0
- moneyflow-0.1.2/licenses/monarchmoney-LICENSE +29 -0
- moneyflow-0.1.2/mkdocs.yml +121 -0
- moneyflow-0.1.2/moneyflow/__init__.py +28 -0
- moneyflow-0.1.2/moneyflow/__main__.py +6 -0
- moneyflow-0.1.2/moneyflow/app.py +1792 -0
- moneyflow-0.1.2/moneyflow/backends/__init__.py +101 -0
- moneyflow-0.1.2/moneyflow/backends/base.py +156 -0
- moneyflow-0.1.2/moneyflow/backends/demo.py +165 -0
- moneyflow-0.1.2/moneyflow/backends/monarch.py +155 -0
- moneyflow-0.1.2/moneyflow/cache_manager.py +218 -0
- moneyflow-0.1.2/moneyflow/commit_orchestrator.py +245 -0
- moneyflow-0.1.2/moneyflow/credentials.py +283 -0
- moneyflow-0.1.2/moneyflow/data_manager.py +614 -0
- moneyflow-0.1.2/moneyflow/demo_data_generator.py +701 -0
- moneyflow-0.1.2/moneyflow/duplicate_detector.py +219 -0
- moneyflow-0.1.2/moneyflow/keybindings.py +108 -0
- moneyflow-0.1.2/moneyflow/monarchmoney.py +2935 -0
- moneyflow-0.1.2/moneyflow/screens/__init__.py +1 -0
- moneyflow-0.1.2/moneyflow/screens/credential_screens.py +667 -0
- moneyflow-0.1.2/moneyflow/screens/duplicates_screen.py +305 -0
- moneyflow-0.1.2/moneyflow/screens/edit_screens.py +456 -0
- moneyflow-0.1.2/moneyflow/screens/review_screen.py +140 -0
- moneyflow-0.1.2/moneyflow/screens/search_screen.py +83 -0
- moneyflow-0.1.2/moneyflow/screens/transaction_detail_screen.py +137 -0
- moneyflow-0.1.2/moneyflow/state.py +482 -0
- moneyflow-0.1.2/moneyflow/styles/moneyflow.tcss +104 -0
- moneyflow-0.1.2/moneyflow/time_navigator.py +303 -0
- moneyflow-0.1.2/moneyflow/view_presenter.py +429 -0
- moneyflow-0.1.2/moneyflow/views/__init__.py +1 -0
- moneyflow-0.1.2/moneyflow/widgets/__init__.py +5 -0
- moneyflow-0.1.2/moneyflow/widgets/help_screen.py +71 -0
- moneyflow-0.1.2/pyproject.toml +90 -0
- moneyflow-0.1.2/pytest.ini +16 -0
- moneyflow-0.1.2/requirements.txt +10 -0
- moneyflow-0.1.2/scripts/README.md +103 -0
- moneyflow-0.1.2/scripts/bump-version.sh +64 -0
- moneyflow-0.1.2/scripts/publish-pypi.sh +102 -0
- moneyflow-0.1.2/scripts/publish-testpypi.sh +62 -0
- moneyflow-0.1.2/scripts/test-build.sh +64 -0
- moneyflow-0.1.2/tests/__init__.py +1 -0
- moneyflow-0.1.2/tests/conftest.py +156 -0
- moneyflow-0.1.2/tests/mock_backend.py +283 -0
- moneyflow-0.1.2/tests/test_cache.py +848 -0
- moneyflow-0.1.2/tests/test_cache_manager.py +393 -0
- moneyflow-0.1.2/tests/test_commit_orchestrator.py +651 -0
- moneyflow-0.1.2/tests/test_credentials.py +496 -0
- moneyflow-0.1.2/tests/test_data_manager.py +750 -0
- moneyflow-0.1.2/tests/test_demo.py +944 -0
- moneyflow-0.1.2/tests/test_duplicate_detection.py +591 -0
- moneyflow-0.1.2/tests/test_editing.py +737 -0
- moneyflow-0.1.2/tests/test_state.py +772 -0
- moneyflow-0.1.2/tests/test_time_navigator.py +465 -0
- moneyflow-0.1.2/tests/test_view_presenter.py +657 -0
- moneyflow-0.1.2/tests/test_workflows.py +227 -0
- moneyflow-0.1.2/uv.lock +1836 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
moneyflow.dev
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Deploy Documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths:
|
|
8
|
+
- 'docs/**'
|
|
9
|
+
- 'mkdocs.yml'
|
|
10
|
+
- '.github/workflows/docs.yml'
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
deploy:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Set up Python
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: '3.11'
|
|
26
|
+
|
|
27
|
+
- name: Install uv
|
|
28
|
+
uses: astral-sh/setup-uv@v4
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: |
|
|
32
|
+
uv pip install --system mkdocs-material mkdocs-material-extensions
|
|
33
|
+
|
|
34
|
+
- name: Build and deploy
|
|
35
|
+
run: |
|
|
36
|
+
mkdocs gh-deploy --force
|
|
37
|
+
|
|
38
|
+
- name: Summary
|
|
39
|
+
run: |
|
|
40
|
+
echo "📚 Documentation deployed to GitHub Pages" >> $GITHUB_STEP_SUMMARY
|
|
41
|
+
echo "🌐 Site will be available at: https://moneyflow.dev" >> $GITHUB_STEP_SUMMARY
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Test Python ${{ matrix.python-version }}
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
22
|
+
uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: ${{ matrix.python-version }}
|
|
25
|
+
|
|
26
|
+
- name: Install uv
|
|
27
|
+
uses: astral-sh/setup-uv@v4
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: |
|
|
31
|
+
uv sync
|
|
32
|
+
|
|
33
|
+
- name: Run type checker (pyright)
|
|
34
|
+
run: |
|
|
35
|
+
uv run pyright moneyflow/
|
|
36
|
+
|
|
37
|
+
- name: Run tests with coverage
|
|
38
|
+
run: |
|
|
39
|
+
uv run pytest --cov --cov-report=xml --cov-report=term-missing
|
|
40
|
+
|
|
41
|
+
- name: Upload coverage to Codecov
|
|
42
|
+
uses: codecov/codecov-action@v4
|
|
43
|
+
if: matrix.python-version == '3.11'
|
|
44
|
+
with:
|
|
45
|
+
file: ./coverage.xml
|
|
46
|
+
fail_ci_if_error: false
|
|
47
|
+
|
|
48
|
+
- name: Test summary
|
|
49
|
+
run: |
|
|
50
|
+
echo "✅ All tests passed on Python ${{ matrix.python-version }}" >> $GITHUB_STEP_SUMMARY
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual environments
|
|
24
|
+
venv/
|
|
25
|
+
ENV/
|
|
26
|
+
env/
|
|
27
|
+
.venv/
|
|
28
|
+
|
|
29
|
+
# Testing
|
|
30
|
+
.pytest_cache/
|
|
31
|
+
.coverage
|
|
32
|
+
htmlcov/
|
|
33
|
+
.tox/
|
|
34
|
+
|
|
35
|
+
# IDEs
|
|
36
|
+
.vscode/
|
|
37
|
+
.idea/
|
|
38
|
+
*.swp
|
|
39
|
+
*.swo
|
|
40
|
+
*~
|
|
41
|
+
|
|
42
|
+
# moneyflow specific
|
|
43
|
+
.mm/
|
|
44
|
+
.moneyflow/
|
|
45
|
+
*.log
|
|
46
|
+
|
|
47
|
+
# macOS
|
|
48
|
+
.DS_Store
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
# moneyflow - Development Guide
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
|
|
5
|
+
moneyflow is a terminal-based UI for power users to manage personal finance transactions efficiently. Built with Python using Textual for the UI and Polars for data processing. Supports multiple backends including Monarch Money, with more platforms planned (YNAB, Lunch Money, etc.).
|
|
6
|
+
|
|
7
|
+
## Development Setup
|
|
8
|
+
|
|
9
|
+
### Using uv (REQUIRED)
|
|
10
|
+
|
|
11
|
+
**IMPORTANT**: This project uses **uv** exclusively for all development workflows. Always use `uv run` for executing scripts and `uv pip` for package management. Never use pip, pipenv, poetry, or other package managers.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Install uv if not already installed
|
|
15
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
16
|
+
|
|
17
|
+
# FIRST TIME SETUP: Sync dependencies (includes dev dependencies for testing)
|
|
18
|
+
uv sync
|
|
19
|
+
|
|
20
|
+
# This creates a virtual environment and installs all dependencies
|
|
21
|
+
# You MUST run this before running tests or the TUI for the first time
|
|
22
|
+
|
|
23
|
+
# After sync, run the TUI
|
|
24
|
+
uv run moneyflow
|
|
25
|
+
|
|
26
|
+
# Run tests (ALWAYS before committing)
|
|
27
|
+
uv run pytest
|
|
28
|
+
|
|
29
|
+
# Run tests with coverage
|
|
30
|
+
uv run pytest --cov --cov-report=html
|
|
31
|
+
|
|
32
|
+
# View coverage report
|
|
33
|
+
open htmlcov/index.html
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**If you get `ModuleNotFoundError`**: Run `uv sync` first!
|
|
37
|
+
|
|
38
|
+
### Test-Driven Development (CRITICAL)
|
|
39
|
+
|
|
40
|
+
**This project handles financial data. We cannot afford slip-ups.**
|
|
41
|
+
|
|
42
|
+
**MANDATORY WORKFLOW**:
|
|
43
|
+
1. **Write tests first** for any new feature or bug fix
|
|
44
|
+
2. **Run tests** - verify they fail as expected
|
|
45
|
+
3. **Implement** the feature/fix
|
|
46
|
+
4. **Run tests again** - verify all tests pass
|
|
47
|
+
5. **Check coverage** - ensure new code is tested
|
|
48
|
+
6. **Only commit when tests are green**
|
|
49
|
+
|
|
50
|
+
**Before EVERY commit**:
|
|
51
|
+
```bash
|
|
52
|
+
# Run full test suite
|
|
53
|
+
uv run pytest -v
|
|
54
|
+
|
|
55
|
+
# Run type checker
|
|
56
|
+
uv run pyright moneyflow/
|
|
57
|
+
|
|
58
|
+
# Check coverage
|
|
59
|
+
uv run pytest --cov --cov-report=term-missing
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**All tests must pass and type checking must be clean before committing.** No exceptions.
|
|
63
|
+
|
|
64
|
+
### Project Structure
|
|
65
|
+
|
|
66
|
+
**IMPORTANT**: All Python source code must be in the `moneyflow/` package. No Python files should live at the top level.
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
moneyflow/
|
|
70
|
+
├── moneyflow/ # Main package (ALL code goes here)
|
|
71
|
+
│ ├── app.py # Main Textual application (~1750 lines)
|
|
72
|
+
│ ├── monarchmoney.py # GraphQL client (keep separate for upstream diffs)
|
|
73
|
+
│ ├── data_manager.py # Data layer with Polars
|
|
74
|
+
│ ├── state.py # App state management
|
|
75
|
+
│ ├── credentials.py # Encrypted credential storage
|
|
76
|
+
│ ├── duplicate_detector.py # Duplicate detection
|
|
77
|
+
│ ├── view_presenter.py # Presentation logic (NEW - fully typed & tested)
|
|
78
|
+
│ ├── time_navigator.py # Time period calculations (NEW - 100% coverage)
|
|
79
|
+
│ ├── commit_orchestrator.py # DataFrame update logic (NEW - critical, 100% tested)
|
|
80
|
+
│ ├── backends/ # Backend implementations
|
|
81
|
+
│ ├── screens/ # UI screens and modals
|
|
82
|
+
│ ├── widgets/ # Custom UI widgets
|
|
83
|
+
│ └── styles/ # Textual CSS
|
|
84
|
+
├── tests/ # Test suite (465+ tests)
|
|
85
|
+
│ ├── conftest.py # Pytest fixtures
|
|
86
|
+
│ ├── mock_backend.py # Mock MonarchMoney API
|
|
87
|
+
│ ├── test_state.py # State management tests
|
|
88
|
+
│ ├── test_data_manager.py # Data operations tests
|
|
89
|
+
│ ├── test_view_presenter.py # Presentation logic tests (NEW - 48 tests)
|
|
90
|
+
│ ├── test_time_navigator.py # Time navigation tests (NEW - 52 tests)
|
|
91
|
+
│ ├── test_commit_orchestrator.py # DataFrame updates (NEW - 30 tests)
|
|
92
|
+
│ └── test_workflows.py # Edit workflow tests
|
|
93
|
+
├── pyproject.toml # Project metadata and dependencies
|
|
94
|
+
├── README.md # User documentation
|
|
95
|
+
└── CLAUDE.md # This file - development guide
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**File Organization Rules**:
|
|
99
|
+
- ✅ All business logic in `moneyflow/` package
|
|
100
|
+
- ✅ All tests in `tests/` directory
|
|
101
|
+
- ✅ Entry point via `moneyflow` command (configured in pyproject.toml)
|
|
102
|
+
- ❌ No `.py` files at top level
|
|
103
|
+
- ❌ No duplicate files between top-level and package
|
|
104
|
+
|
|
105
|
+
## Testing Strategy
|
|
106
|
+
|
|
107
|
+
**IMPORTANT**: All business logic must be tested before running against real data.
|
|
108
|
+
|
|
109
|
+
### Testing Architecture
|
|
110
|
+
|
|
111
|
+
1. **Mock Backend**: `tests/mock_backend.py` provides a `MockMonarchMoney` class that simulates the API without making real network calls.
|
|
112
|
+
|
|
113
|
+
2. **Test Fixtures**: `tests/conftest.py` provides reusable test data and fixtures.
|
|
114
|
+
|
|
115
|
+
3. **Separation of Concerns**:
|
|
116
|
+
- `state.py`: Pure state management (no I/O) - easily testable
|
|
117
|
+
- `data_manager.py`: Takes MonarchMoney instance via dependency injection - can use mock
|
|
118
|
+
- UI layer: Testable with Textual pilot tests
|
|
119
|
+
|
|
120
|
+
### What We Test
|
|
121
|
+
|
|
122
|
+
- ✅ State management: undo/redo, change tracking
|
|
123
|
+
- ✅ Data operations: aggregation, filtering, search
|
|
124
|
+
- ✅ Edit workflows: merchant rename, category change, hide toggle
|
|
125
|
+
- ✅ Bulk operations: multi-select, bulk edit
|
|
126
|
+
- ✅ Duplicate detection: finding and handling duplicates
|
|
127
|
+
- ✅ **Presentation logic**: View formatting, flag computation (100% coverage)
|
|
128
|
+
- ✅ **Time navigation**: Date calculations, leap years, boundaries (100% coverage)
|
|
129
|
+
- ✅ **DataFrame updates**: Critical commit logic (100% coverage)
|
|
130
|
+
- ✅ Edge cases: empty datasets, invalid data, API failures
|
|
131
|
+
|
|
132
|
+
### Running Tests
|
|
133
|
+
|
|
134
|
+
**ALWAYS use `uv run` for running tests:**
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Run all tests (run before EVERY commit)
|
|
138
|
+
uv run pytest -v
|
|
139
|
+
|
|
140
|
+
# Run with coverage report
|
|
141
|
+
uv run pytest --cov --cov-report=html --cov-report=term-missing
|
|
142
|
+
|
|
143
|
+
# Run specific test file
|
|
144
|
+
uv run pytest tests/test_state.py -v
|
|
145
|
+
|
|
146
|
+
# Run tests matching a pattern
|
|
147
|
+
uv run pytest -k "test_undo" -v
|
|
148
|
+
|
|
149
|
+
# Run and stop on first failure
|
|
150
|
+
uv run pytest -x
|
|
151
|
+
|
|
152
|
+
# Run and show local variables on failure
|
|
153
|
+
uv run pytest -l
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Coverage Requirements
|
|
157
|
+
|
|
158
|
+
**Business Logic Coverage Target: >90%**
|
|
159
|
+
|
|
160
|
+
Core modules must maintain high coverage:
|
|
161
|
+
- `state.py`: State management (target: 90%+, current: 85%)
|
|
162
|
+
- `data_manager.py`: Data operations and API integration (target: 90%+, current: 97%)
|
|
163
|
+
- `duplicate_detector.py`: Duplicate detection (target: 95%+, current: 84%)
|
|
164
|
+
- `view_presenter.py`: Presentation logic (**100% - keep at 100%**)
|
|
165
|
+
- `time_navigator.py`: Time period calculations (**100% - keep at 100%**)
|
|
166
|
+
- `commit_orchestrator.py`: DataFrame updates (**100% - CRITICAL, keep at 100%**)
|
|
167
|
+
|
|
168
|
+
UI layer coverage is less critical but still valuable.
|
|
169
|
+
|
|
170
|
+
View coverage report:
|
|
171
|
+
```bash
|
|
172
|
+
uv run pytest --cov --cov-report=html
|
|
173
|
+
open htmlcov/index.html
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Test-Driven Development Workflow
|
|
177
|
+
|
|
178
|
+
1. Write tests first for new features
|
|
179
|
+
2. Run tests to verify they fail
|
|
180
|
+
3. Implement the feature
|
|
181
|
+
4. Run tests to verify they pass
|
|
182
|
+
5. Refactor while keeping tests green
|
|
183
|
+
|
|
184
|
+
## Code Style
|
|
185
|
+
|
|
186
|
+
- Use type hints for all function signatures
|
|
187
|
+
- Document complex logic with comments
|
|
188
|
+
- Keep functions focused and single-purpose
|
|
189
|
+
- Use meaningful variable names
|
|
190
|
+
|
|
191
|
+
## Making Changes to monarchmoney.py
|
|
192
|
+
|
|
193
|
+
The `monarchmoney.py` file is kept separate to make it easy to generate diffs for upstream contributions:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
# Generate a diff against the original
|
|
197
|
+
cd moneyflow
|
|
198
|
+
diff monarchmoney.py /path/to/original/monarchmoney.py > my_changes.patch
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Security Notes
|
|
202
|
+
|
|
203
|
+
- Credentials are encrypted with Fernet (AES-128)
|
|
204
|
+
- Never commit `.mm/` directory (session data)
|
|
205
|
+
- Never commit `~/.moneyflow/` directory (encrypted credentials)
|
|
206
|
+
- Never commit test data with real credentials
|
|
207
|
+
- See SECURITY.md for full security documentation
|
|
208
|
+
|
|
209
|
+
## Common Tasks
|
|
210
|
+
|
|
211
|
+
### Adding a New Feature
|
|
212
|
+
|
|
213
|
+
1. Create tests in `tests/test_*.py`
|
|
214
|
+
2. Implement in appropriate module
|
|
215
|
+
3. Update keyboard shortcuts in `keybindings.py`
|
|
216
|
+
4. Update README.md with new functionality
|
|
217
|
+
5. Run full test suite
|
|
218
|
+
|
|
219
|
+
### Debugging
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# Enable Textual dev tools
|
|
223
|
+
uv run textual console
|
|
224
|
+
|
|
225
|
+
# Then in another terminal
|
|
226
|
+
uv run python monarch_tui.py
|
|
227
|
+
|
|
228
|
+
# View logs in the console
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Updating Dependencies
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# Add new dependency to pyproject.toml manually, then:
|
|
235
|
+
uv sync
|
|
236
|
+
|
|
237
|
+
# Or add directly
|
|
238
|
+
uv add package-name
|
|
239
|
+
|
|
240
|
+
# Update all dependencies
|
|
241
|
+
uv lock --upgrade
|
|
242
|
+
uv sync
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Git Workflow
|
|
246
|
+
|
|
247
|
+
**CRITICAL**: Never commit without running tests first!
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
# MANDATORY: Run tests before committing
|
|
251
|
+
uv run pytest -v
|
|
252
|
+
|
|
253
|
+
# Only if all tests pass, then commit
|
|
254
|
+
git add -A
|
|
255
|
+
git commit -m "Descriptive commit message"
|
|
256
|
+
|
|
257
|
+
# Use conventional commit format
|
|
258
|
+
# feat: New feature
|
|
259
|
+
# fix: Bug fix
|
|
260
|
+
# test: Adding tests
|
|
261
|
+
# refactor: Code refactoring
|
|
262
|
+
# docs: Documentation updates
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**Pre-commit Checklist**:
|
|
266
|
+
- [ ] All tests pass (`uv run pytest -v`)
|
|
267
|
+
- [ ] Type checking passes (`uv run pyright moneyflow/`)
|
|
268
|
+
- [ ] Coverage hasn't decreased
|
|
269
|
+
- [ ] No debug print statements left in code
|
|
270
|
+
- [ ] Updated tests for any changed behavior
|
|
271
|
+
- [ ] Ran with real test data if changing API logic
|
|
272
|
+
|
|
273
|
+
### Static Type Checking (NEW)
|
|
274
|
+
|
|
275
|
+
**Pyright** is integrated for static type analysis. Use comprehensive type hints for all new code.
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
# Type-check specific module
|
|
279
|
+
uv run pyright moneyflow/view_presenter.py
|
|
280
|
+
|
|
281
|
+
# Type-check all application code
|
|
282
|
+
uv run pyright moneyflow/
|
|
283
|
+
|
|
284
|
+
# Type checking is also run in CI on every push
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Type Hint Requirements**:
|
|
288
|
+
- All function signatures must have full type hints
|
|
289
|
+
- Use `TypedDict` for complex dictionaries
|
|
290
|
+
- Use `Literal` types for string enums
|
|
291
|
+
- Use `NamedTuple` for data transfer objects
|
|
292
|
+
- Prefer `Callable[[Args], Return]` for function types
|
|
293
|
+
|
|
294
|
+
## Performance Considerations
|
|
295
|
+
|
|
296
|
+
- Bulk fetch transactions on startup (1000 per batch)
|
|
297
|
+
- All aggregations done locally with Polars
|
|
298
|
+
- Batch API updates to minimize round trips
|
|
299
|
+
- Cache data in AppState to avoid re-fetching
|
|
300
|
+
|
|
301
|
+
## Known Issues / TODOs
|
|
302
|
+
|
|
303
|
+
- [ ] Add transaction deletion with confirmation
|
|
304
|
+
- [ ] Implement time range picker UI
|
|
305
|
+
- [ ] Add CSV export functionality
|
|
306
|
+
- [ ] Improve duplicate detection algorithm
|
|
307
|
+
- [ ] Add split transaction support
|
|
308
|
+
- [ ] Implement transaction notes editing
|
moneyflow-0.1.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Wes McKinney
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|