Refactors weekly-template's Notion client setup into a shared helper (with .env/dotenv support and full pagination), and adds a dedicated evening-prep script so both commands can fall back to script-based fetching instead of the MCP search/fetch pattern. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
62 lines
1.8 KiB
Markdown
62 lines
1.8 KiB
Markdown
# Daily/Weekly Planning Scripts
|
|
|
|
## Setup
|
|
|
|
### 1. Install dependencies
|
|
```bash
|
|
cd /Users/aj.siegel/Projects/FullFocus
|
|
pip3 install -r scripts/requirements.txt
|
|
```
|
|
|
|
### 2. Get your Notion API Token
|
|
|
|
1. Go to https://www.notion.so/my-integrations
|
|
2. Click "+ New integration"
|
|
3. Name it "Weekly Planning Script" (or whatever you prefer)
|
|
4. Select your workspace
|
|
5. Click "Submit"
|
|
6. Copy the "Internal Integration Token"
|
|
|
|
### 3. Share databases with your integration
|
|
|
|
For each database (Projects, Tasks Tracker, Reading List):
|
|
1. Open the database page in Notion
|
|
2. Click "..." menu → "Connections"
|
|
3. Add your "Weekly Planning Script" integration
|
|
|
|
### 4. Set your Notion token
|
|
|
|
Create a `.env` file in the project root:
|
|
```bash
|
|
NOTION_TOKEN="secret_your_token_here"
|
|
```
|
|
|
|
(`.env` is gitignored, and the script loads it automatically via `python-dotenv`.)
|
|
|
|
## Usage
|
|
|
|
### `fetch_weekly_data.py`
|
|
```bash
|
|
python3 scripts/fetch_weekly_data.py
|
|
```
|
|
|
|
This outputs JSON with:
|
|
- Active, non-personal projects (candidates for the weekly focus selection)
|
|
- Tasks due within the next 7 days
|
|
- Reading list articles (To Read or In Progress)
|
|
|
|
The `/weekly-template` command calls this script to generate your weekly note, reducing AI inference costs. If the script fails, the command falls back to the Notion MCP search/fetch pattern.
|
|
|
|
### `fetch_evening_tasks.py`
|
|
```bash
|
|
python3 scripts/fetch_evening_tasks.py
|
|
```
|
|
|
|
This outputs JSON with:
|
|
- All open tasks (not Done, not Blocked) — paginated, so it stays complete as the tracker grows
|
|
- Every task currently marked `Top Task = true` (any status), for unmarking stale ones
|
|
|
|
The `/evening-prep` command calls this script to build the day's Suggested Tasks and manage the `Top Task` checkbox, with the same MCP fallback if the script fails.
|
|
|
|
Both scripts share Notion client setup, database IDs, and pagination logic in `notion_helpers.py`.
|