Skip to main content

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, discover its headings, or read a specific heading section

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 [--sections | --section SECTION] [--json]

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 or section

notekey read flask-app

For an exact filename match:

notekey read "=flask-app"

List the headings in a note before choosing a section:

notekey read flask-app --sections

Example output:

flask-app.md

  1  # Flask App
  2  ## Setup
  3  ## Open Questions
  4  ### API Shape

Read a section by its 1-based outline number:

notekey read flask-app --section 3

Read a section by a case-insensitive title substring:

notekey read flask-app --section api

Section reads include the selected heading and its nested child headings, stopping at the next heading of the same or higher level. If a title search matches multiple headings, notekey prints the matching outline entries so you can retry with a number or a more specific title.

For exact section title matching, prefix the section query with =:

notekey read flask-app --section "=API Shape"

Section discovery and section reads can return JSON:

notekey read flask-app --sections --json
notekey read flask-app --section 4 --json

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.

Metadata

Release files for notekey 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for notekey 0.5.0
File Size Uploaded Provenance
notekey-0.5.0.tar.gz 22.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for notekey 0.5.0
File Interpreter ABI Platform
notekey-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.3 kB

Release files / notekey-0.5.0.tar.gz

Download URL notekey-0.5.0.tar.gz
Size 22.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9ad16b95272fcd0e548c7f1a59b3f474824f59e62574ea44546d31dd30e9d60f
BLAKE2b-256 checksum
How to use checksums
708bd4ffbd669f088c3d8d6ecaec7585cb24afa331cd3256ad8b07f12f72b1b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / notekey-0.5.0-py3-none-any.whl

Download URL notekey-0.5.0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6eb6e053595406ef97a2b603aa9a4fbdcce9645f4b40452af3406b5f022b15d3
BLAKE2b-256 checksum
How to use checksums
28f86d6e160eaec7fd964c4e566ab4bff6df26ea26e602306ac568aaf62804a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Security for notekey 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page