Metadata-Version: 2.4
Name: obsidian-workflow
Version: 0.0.4
Summary: Obsidian workflow tools for automating my obsidian workflow
Author: Brandt Beal
License-Expression: MIT
Project-URL: Homepage, https://github.com/babeal/obsidian-workflow
Project-URL: Changelog, https://github.com/babeal/obsidian-workflow/releases
Project-URL: Issues, https://github.com/babeal/obsidian-workflow/issues
Project-URL: CI, https://github.com/babeal/obsidian-workflow/actions
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click
Dynamic: license-file

# Obsidian Workflow

Obsidian Workflow is a command line application to automate my obsidian workflows. This application is specific to my workflow and might not fit yours. See each command for more details.

## Commands

### Daily

The daily note in Obsidian serves as a scratchpad for capturing ideas and information throughout the day. Each train of thought is organized under a top-level heading and linked to relevant indexes, maps of content (MOCs), projects, and other atomic notes. This flexible approach allows for quick note-taking without worrying about where in the hierarchy to create a one. However, keeping content in the daily note creates an issue with backlinks, as references show the date (e.g., 2025-01-01-Monday) rather than descriptive titles, making them harder to recognize in linked mentions or unmapped backlink views. To resolve this, each top-level heading is extracted into its own standalone note with a meaningful name. This improves backlink readability and prepares the notes for migration to a folder in the permanent hierarchy when necessary during gardening.

Daily Note Format: YYYY/MM-MMMM/YYYY-MM-DD-dddd

See [Python Scripter Plugin directory](./plugins/python%20scripter/README.md) for how to use this within the Obsidian application.

#### Process a Single File

```bash
obsidian-workflow daily --file /path/to/note.md
```

#### Process the Last `N` Days

`--days N` processes the `N` calendar days *before* today. Today is not included
unless `--include-today` is passed. `--root-dir` is the directory holding the
`YYYY/` year directories.

```bash
obsidian-workflow daily --days 7 --root-dir /path/to/notes
```

#### Include Today in Processing

To also process today’s note (8 days in total here):

```bash
obsidian-workflow daily --days 7 --include-today --root-dir /path/to/notes
```

#### Preview Without Writing

`--dry-run` reports the plan — every output path, which headings merge, and any
conflicts — and exits without touching a file. It uses the same planner as a real
run, so what it prints is what a real run would do. It exits nonzero if the plan
has blocking conflicts.

```bash
obsidian-workflow daily --days 7 --root-dir /path/to/notes --dry-run
```

#### Conflicts

If a heading already has a note of that name, the default `--on-conflict error`
aborts the whole run before anything is written and lists each conflict. Use
`--on-conflict append` to append the new body to the existing note instead.

```bash
obsidian-workflow daily --file /path/to/note.md --on-conflict append
```

#### Timezone

Today’s date comes from system-local time by default. Pass an IANA timezone to
pin it, which matters when the command runs on a machine in another zone:

```bash
obsidian-workflow daily --days 1 --timezone America/Chicago --root-dir /path/to/notes
```

Month and weekday names in generated paths are always English, regardless of the
process locale.

#### Default Behavior

Running the `daily` workflow without arguments processes today’s daily note:

```bash
obsidian-workflow daily
```

---

#### Examples

##### Input:

Daily note contains:

```markdown
# Header 1

Content A

# Header 1

Content B

# Header 2

Content C
```

##### Output:

**File: `header 1.md`**

```markdown
# Header 1

Content A

Extracted from: [[2024-12-05-Thursday]]

---

Content B

Extracted from: [[2024-12-05-Thursday]]
```

**File: `header 2.md`**

```markdown
# Header 2

Content C

Extracted from: [[2024-12-05-Thursday]]
```

**Daily Note After Processing**

```markdown
![[header 1]]

![[header 2]]
```

---

## Installation

1. Clone the repository:

   ```bash
   git clone https://github.com/babeal/obsidian-workflow.git
   cd obsidian-workflow
   ```

2. Install the CLI:

   ```bash
   uv tool install .
   ```

   Or install it into an existing environment:

   ```bash
   uv pip install .
   ```

## Development commands

After cloning

### Install packages

```sh
uv sync
```

### Run Tests

```sh
uv run pytest
```

### To publish

```sh
rm -rf dist
uv build
uv publish --token <pypi-token>
```
