Skip to main content

Async Python client for Obsidian Local REST API

Project description

aiobsidian

Async Python client for Obsidian Local REST API plugin.

Installation

pip install aiobsidian

Quick start

import asyncio
from aiobsidian import ObsidianClient

async def main():
    async with ObsidianClient("your-api-key") as client:
        # Get 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
        commands = await client.commands.list()
        await client.commands.execute("daily-notes")

asyncio.run(main())

Features

  • Full async/await support via httpx
  • All Obsidian Local REST API endpoints covered:
    • 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 all responses
  • Custom exception hierarchy with error codes
  • Context manager lifecycle management
  • Bring-your-own httpx.AsyncClient support

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

Contributing

For contributors

  1. Fork this repository

  2. Clone your fork and create a branch:

    git clone https://github.com/YOUR_USERNAME/aiobsidian.git
    cd aiobsidian
    git checkout -b feature/your-feature
    
  3. Make changes and commit using Conventional Commits:

    feat: add new feature
    fix: fix bug in vault resource
    docs: update README
    refactor: extract helper method
    test: add search tests
    chore: update dependencies
    
  4. Push to your fork and open a Pull Request:

    git push origin feature/your-feature
    gh pr create  # or use GitHub UI
    

For maintainers

# Update version in pyproject.toml
sed -i '' 's/version = ".*/version = "X.Y.Z"/' pyproject.toml
git add pyproject.toml
git commit -m "chore: release vX.Y.Z"
git tag vX.Y.Z
git push origin main --tags

CI will automatically create a GitHub Release and publish to PyPI.

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.1.0.tar.gz (25.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.1.0-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiobsidian-0.1.0.tar.gz
  • Upload date:
  • Size: 25.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.1.0.tar.gz
Algorithm Hash digest
SHA256 f5b32793cfbcfef57d0c953613d8c85e1b93c3f50469caa5ac15190047ad1335
MD5 ae58f32189459d67441938976bbbf943
BLAKE2b-256 675e8c08c94ad6005ec61cb5a16b6ed4a31557c18190eeadd40ca97bcd72d465

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: aiobsidian-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.7 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c315564dd7063324b7dbc30b6db6164dde0ee8439019dc9b51befe07a9c47d1
MD5 848c6f9069feafe81fe92590e8ee3d65
BLAKE2b-256 29add057c566749d9432ad902a0d3866c4438ac21475e08a1f3ddbca8704dc49

See more details on using hashes here.

Provenance

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