Skip to main content

Async Python client for Obsidian Local REST API

Project description

aiobsidian

CI PyPI Python License Docs

Async Python client for the Obsidian Local REST API plugin.


Installation

pip install aiobsidian

Or with uv:

uv add aiobsidian

Quick start

import asyncio
from aiobsidian import ObsidianClient

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

        # Read a note
        content = await client.vault.get("notes/hello.md")
        print(content)

        # Create a note
        await client.vault.update("notes/new.md", "# New Note\n\nContent here.")

        # Search
        results = await client.search.simple("hello")
        for r in results:
            print(r.filename, r.score)

        # Execute a command
        await client.commands.execute("daily-notes")

asyncio.run(main())

Features

  • Full async/await support via httpx

  • Complete API coverage — all Obsidian Local REST API endpoints:

    Resource Description
    Vault CRUD operations on any file
    Active Operations on the currently open file
    Periodic Daily, weekly, monthly, quarterly, yearly notes
    Commands List and execute Obsidian commands
    Search Simple text search, Dataview DQL, JsonLogic
    Open Open files in Obsidian UI
    System Server status, OpenAPI spec
  • Pydantic v2 models for type-safe responses

  • Custom exception hierarchy with error codes

  • Bring-your-own httpx.AsyncClient support

  • Context manager lifecycle management

Configuration

client = ObsidianClient(
    "your-api-key",
    host="127.0.0.1",      # default
    port=27124,             # default (HTTPS)
    scheme="https",         # default
    timeout=30.0,           # default
    verify_ssl=False,       # default (self-signed cert)
)

External HTTP client

You can provide your own httpx.AsyncClient for full control over transport settings:

import httpx
from aiobsidian import ObsidianClient

async with httpx.AsyncClient(timeout=60.0, verify=False) as http:
    async with ObsidianClient("your-api-key", http_client=http) as client:
        status = await client.system.status()

When an external client is provided, aiobsidian will not close it — you manage its lifecycle.

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.2.0.tar.gz (29.4 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.2.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aiobsidian-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fea0d19ff29277c3742db87196af08af3fd2daad8be374a3502e68a96e3a95b7
MD5 abc169ab4a8eceb4e687e579fa1b964d
BLAKE2b-256 2bcee2ce5c0d1625a629dd2938fec0dde1f3d45ffb7d60a018af63b61c7cca91

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiobsidian-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: aiobsidian-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.2 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a31d3486a24b3187b3c3046c5a9deabec9006128ee52d6906d856e497e4fb8e
MD5 33e74048155bbd771d4f5e3a54309f30
BLAKE2b-256 34060cf4993acdc54dc88bdd56c1b1d2fe41a0e3f7c071f3bc9ba3dafbf25cf7

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiobsidian-0.2.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