CLI tool to add tags to markdown frontmatter
Project description
tagitmd
CLI tool to add tags to markdown frontmatter.
tagitmd scans markdown files in a directory and adds tags to their YAML frontmatter. It intelligently handles existing frontmatter, creating it if needed, and can optionally skip files that already have tags. You can also specify the path and disable recursion.
Installation
pip install -e .
Usage
tagitmd TAG [TAG...] [OPTIONS]
Examples
# Add tags to all markdown files in current directory
tagitmd python tutorial
# Add tags to files in a specific directory
tagitmd python --path /path/to/notes
# Preview changes without modifying files
tagitmd python tutorial --dry-run
# Only add tags to files that don't have any tags yet
tagitmd python --only-untagged
# Process only the target directory (not subdirectories)
tagitmd python --no-recursive
Flags
--path, -p
- Type: Directory path
- Default: Current directory (
.) - Description: Directory to process for markdown files
--dry-run
- Type: Flag
- Default: False
- Description: Preview changes without modifying any files. Shows what would be changed.
--only-untagged
- Type: Flag
- Default: False
- Description: Only modify files that don't have any existing tags in their frontmatter
--recursive / --no-recursive
- Type: Boolean flag
- Default: True (recursive)
- Description: Whether to search subdirectories recursively
Development Guide
Setup
# Create virtual environment and install dependencies
make install
This will:
- Create a virtual environment in
venv/ - Install the required dependencies
- Install the package in editable mode
Manual Setup
If you prefer to set up manually:
# Create virtual environment
make venv
# Activate virtual environment
source venv/bin/activate
# Install dependencies and package
make install
Available Make Commands
make venv # Create virtual environment
make install # Install dependencies and package in dev mode
make test # Run tests with coverage
make clean # Clean build artifacts
make publish # Build and publish to PyPI
Running Tests
make test
This runs pytest with coverage reporting.
Requirements
- Python 3.8 or higher
- click >= 8.0
- python-frontmatter >= 1.0.0
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tagitmd-0.2.0.tar.gz.
File metadata
- Download URL: tagitmd-0.2.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2e02d0fef830c725bc107bf8d8bd3b0463c815bab894eae527db10a39828536
|
|
| MD5 |
2cdcfd33b5c389b0665eb9f0720723a9
|
|
| BLAKE2b-256 |
ab66ee70cd9a171fcb2fedab6fb73268b88ef8e5972cba7872cfb85553ee4d85
|
File details
Details for the file tagitmd-0.2.0-py3-none-any.whl.
File metadata
- Download URL: tagitmd-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b429c694a7ab0bdf3a39001c4258f1a13ee85fd0b56459f005e0759094467559
|
|
| MD5 |
ebc04987d8a082703986b3fd8ae7d34e
|
|
| BLAKE2b-256 |
bccf3528ce59697bb5a9a656969d66acc23f2e7ab6e9350da6944eec8475a3e2
|