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.3.0.tar.gz (18.3 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.3.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for notekey-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f020cfefb7fd5da7ccf4d349c0ee2773f937ccaf36ae9b7e8ec988b1046e3322
MD5 f8c6b9a0fb11bc905f12e220c2ff9ce8
BLAKE2b-256 155c8f921f324ad0b66b08b70be17a231da9f3c9779af1d8bb8712793bcfb084

See more details on using hashes here.

File details

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

File metadata

  • Download URL: notekey-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c1bd789b4aa513b13341717e45e452e259d6f7ae649d0ab44f6b9d78b03760f
MD5 2642114eadc03db352889f6768a47705
BLAKE2b-256 bf3429a53488ab7ad3762fcfa743bd6883cebe568913d547c081dc2512af0f9a

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