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.AsyncClientsupport
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
-
Fork this repository
-
Clone your fork and create a branch:
git clone https://github.com/YOUR_USERNAME/aiobsidian.git cd aiobsidian git checkout -b feature/your-feature
-
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 -
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5b32793cfbcfef57d0c953613d8c85e1b93c3f50469caa5ac15190047ad1335
|
|
| MD5 |
ae58f32189459d67441938976bbbf943
|
|
| BLAKE2b-256 |
675e8c08c94ad6005ec61cb5a16b6ed4a31557c18190eeadd40ca97bcd72d465
|
Provenance
The following attestation bundles were made for aiobsidian-0.1.0.tar.gz:
Publisher:
release.yml on kudato/aiobsidian
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiobsidian-0.1.0.tar.gz -
Subject digest:
f5b32793cfbcfef57d0c953613d8c85e1b93c3f50469caa5ac15190047ad1335 - Sigstore transparency entry: 953544347
- Sigstore integration time:
-
Permalink:
kudato/aiobsidian@7003c77300ed698443b50c61d8806f9a7d25ea64 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/kudato
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7003c77300ed698443b50c61d8806f9a7d25ea64 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c315564dd7063324b7dbc30b6db6164dde0ee8439019dc9b51befe07a9c47d1
|
|
| MD5 |
848c6f9069feafe81fe92590e8ee3d65
|
|
| BLAKE2b-256 |
29add057c566749d9432ad902a0d3866c4438ac21475e08a1f3ddbca8704dc49
|
Provenance
The following attestation bundles were made for aiobsidian-0.1.0-py3-none-any.whl:
Publisher:
release.yml on kudato/aiobsidian
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiobsidian-0.1.0-py3-none-any.whl -
Subject digest:
9c315564dd7063324b7dbc30b6db6164dde0ee8439019dc9b51befe07a9c47d1 - Sigstore transparency entry: 953544348
- Sigstore integration time:
-
Permalink:
kudato/aiobsidian@7003c77300ed698443b50c61d8806f9a7d25ea64 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/kudato
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7003c77300ed698443b50c61d8806f9a7d25ea64 -
Trigger Event:
push
-
Statement type: