Skip to main content

Async Python client for Obsidian CLI and Local REST API

Project description

aiobsidian

CI PyPI Python License Docs

Async Python client for Obsidian. CLI-first: works out of the box with the Obsidian CLI (v1.12+). Optional REST support via the Local REST API plugin.


Installation

pip install aiobsidian

For REST API support (requires httpx):

pip install aiobsidian[rest]

Quick start

CLI (primary)

import asyncio
from aiobsidian import ObsidianCLI

async def main():
    async with ObsidianCLI("MyVault") as cli:
        # Read a note
        content = await cli.vault.read("notes/hello.md")
        print(content)

        # Search the vault
        results = await cli.search.query("python")

        # List tags
        tags = await cli.tags.list()

        # Daily note
        await cli.daily.append("- [ ] New task")

asyncio.run(main())

REST (optional)

import asyncio
from aiobsidian import ObsidianClient

async def main():
    async with ObsidianClient("your-api-key") as client:
        status = await client.system.status()
        print(status.versions.obsidian)

        content = await client.vault.get("notes/hello.md")
        print(content)

asyncio.run(main())

Features

CLI resources

Resource Access Description
vault cli.vault Read, create, append, prepend, move, rename, delete, list
daily cli.daily Daily note operations
search cli.search Full-text search
properties cli.properties YAML frontmatter properties
tags cli.tags Tag listing, lookup, rename
links cli.links Outgoing links, backlinks, unresolved, orphans
tasks cli.tasks Task listing, creation, completion, toggle
commands cli.commands List and execute Obsidian commands
templates cli.templates List, read, insert templates
bookmarks cli.bookmarks List and add bookmarks
plugins cli.plugins Plugin management
themes cli.themes Theme management
snippets cli.snippets CSS snippet management
sync cli.sync Obsidian Sync operations
publish cli.publish Obsidian Publish operations
history cli.history Local file history
workspaces cli.workspaces Workspace management
hotkeys cli.hotkeys Hotkey operations
outline cli.outline Document outline (headings)
random cli.random Random note
aliases cli.aliases Note aliases
bases cli.bases Obsidian Bases / databases
system cli.system Version, reload, restart, vaults
tabs cli.tabs Tab management, recents
web cli.web Open URLs in web viewer
dev cli.dev Developer/debugging tools

REST resources

Resource Access Description
vault client.vault CRUD operations on any file
active client.active Operations on the currently open file
periodic client.periodic Daily, weekly, monthly, quarterly, yearly notes
commands client.commands List and execute Obsidian commands
search client.search Simple text search, Dataview DQL, JsonLogic
open client.open Open files in Obsidian UI
system client.system Server status, OpenAPI spec

General

  • Full async/await support
  • Pydantic v2 models for type-safe responses
  • Custom exception hierarchy for both CLI and REST errors
  • Context manager lifecycle management
  • No external dependencies for CLI (only stdlib)

Documentation

Full documentation is available at kudato.github.io/aiobsidian.

Contributing

Contributions are welcome! Please see the Contributing Guide for details.

License

MIT

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

aiobsidian-0.4.0.tar.gz (102.8 kB view details)

Uploaded Source

Built Distribution

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

aiobsidian-0.4.0-py3-none-any.whl (42.8 kB view details)

Uploaded Python 3

File details

Details for the file aiobsidian-0.4.0.tar.gz.

File metadata

  • Download URL: aiobsidian-0.4.0.tar.gz
  • Upload date:
  • Size: 102.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aiobsidian-0.4.0.tar.gz
Algorithm Hash digest
SHA256 31117baaa63315d0962426adfefd74b2360a099ad1dfcbb0ee08c8a8671e8fb9
MD5 ecde5f3c9edc3825bfaf717ac9f47088
BLAKE2b-256 b866161e70560c0e4f60b7decea9d52491ab3f13dd03ce010f15aacf04b0773d

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiobsidian-0.4.0.tar.gz:

Publisher: release.yml on kudato/aiobsidian

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiobsidian-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: aiobsidian-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 42.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aiobsidian-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca4009044c51f5d5d2a10dc178bc6abcaf5fc6493606faa6da48cf160102b2aa
MD5 902dda51d356966f6616d03c3097b3af
BLAKE2b-256 49212094a461eeb6f96c1731c8de90f0d27aa3649a1d62a9cad4fd4bb621dc7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiobsidian-0.4.0-py3-none-any.whl:

Publisher: release.yml on kudato/aiobsidian

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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