Skip to main content

CLI utilities for Obsidian vault notes: initialize note bases, search markdown files, and read note content.

Project description

notekey

CLI utilities for working with Markdown notes in an Obsidian vault.

notekey can:

  • initialize a folder with an Obsidian .base file and a matching Markdown note
  • search vault notes by tag, filename, or content
  • read a single note by filename or path match

Requirements

  • Python 3.11+
  • An Obsidian vault directory containing a .obsidian/ folder

Installation

After the package is published to PyPI:

pip install notekey

Usage

notekey init [path]
notekey search [path] [--tags TAGS] [--filename NAME] [--content TEXT]
notekey read FILENAME

For init, omitting path uses the current directory.

For search and read, omitting path uses the OBSIDIAN_VAULT environment variable. If that variable is not set, it uses the current directory.

export OBSIDIAN_VAULT="/path/to/your/vault"

Initialize a note folder

cd /path/to/vault/Projects/MyProject
notekey init

Or pass the target folder explicitly:

notekey init /path/to/vault/Projects/MyProject

This creates:

  • MyProject.base
  • MyProject.md

Add extra base filters with comma-separated tags:

notekey init /path/to/vault/Projects/MyProject --tags python,docs

Overwrite existing generated files with:

notekey init /path/to/vault/Projects/MyProject --force

Search notes

Search by tag:

notekey search --tags python

Search by multiple tags. Files must match all tags:

notekey search --tags python,web

Search by filename:

notekey search --filename flask

Search by content:

notekey search --content pandas

Use = for exact matches:

notekey search --tags "=python"
notekey search --filename "=deep/hidden-note"

Read a note

notekey read flask-app

For an exact filename match:

notekey read "=flask-app"

Development

Run tests with:

pytest

Build distribution files with:

python -m build

Upload is intentionally manual. Use TestPyPI or PyPI with your API token when ready.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

notekey-0.2.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

notekey-0.2.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file notekey-0.2.0.tar.gz.

File metadata

  • Download URL: notekey-0.2.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for notekey-0.2.0.tar.gz
Algorithm Hash digest
SHA256 70fbf59e4d85c8e2459221fac3fb982ae102abd9fc6fd42bf204bec1ba8d7867
MD5 73bd6d323139bc1e022d627d0a26a554
BLAKE2b-256 ec39001639ddb96c87a64ad2418791a0d73c8960f24ecb259359b97e850e6872

See more details on using hashes here.

File details

Details for the file notekey-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: notekey-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for notekey-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82b623a12870afd23f196d807462dfc2ad1770372102eb34e18376400c1bb4a5
MD5 42484486f221f41d5750fedef3fed625
BLAKE2b-256 925bc7d50b16b1b57b4d2fbdcf8befe39e389c21fe26a5901970671b57c2ed2f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page