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
  • 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

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.6.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.6.0
File Size Uploaded Provenance Actions
notekey-0.6.0.tar.gz 23.3 kB Without provenance Details for notekey-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 36.0 kB

Release files / notekey-0.6.0.tar.gz

Download URL notekey-0.6.0.tar.gz
Size 23.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b4d56d9533ed73a81205b2aa4b08a21c177d48bba76ad6d9166648c12bb78a1d
BLAKE2b-256 checksum
How to use checksums
1ef22ddd858d9c54f24eb97c3e9dedfdc55ac50c3f4f3f2300b73d600de46e4c
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.6.0-py3-none-any.whl

Download URL notekey-0.6.0-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd9ffe70b816dda54b4d28b24963546fb98e562b1841a888100a0f17dddf6673
BLAKE2b-256 checksum
How to use checksums
a9b769dba6564613bcbcbb3efe5a5033030610ca4ad7974068ecd16c33e5d12c
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.6.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