obsidian-cli-py 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,99 @@
1
+ Metadata-Version: 2.4
2
+ Name: obsidian-cli-py
3
+ Version: 0.1.0
4
+ Summary: A Python wrapper for the Obsidian CLI
5
+ Author: Author
6
+ Author-email: author@example.com
7
+ Requires-Python: >=3.9,<4.0
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.9
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Description-Content-Type: text/markdown
16
+
17
+ # obsidian-cli-py
18
+
19
+ [![PyPI version](https://img.shields.io/pypi/v/obsidian-cli-py.svg)](https://pypi.org/project/obsidian-cli-py/)
20
+ [![Obsidian CLI Docs](https://img.shields.io/badge/docs-Obsidian_CLI-blue.svg)](https://help.obsidian.md/cli)
21
+
22
+ **obsidian-cli-py** is an unofficial, easy-to-use Python bridge for the new [Obsidian CLI](https://help.obsidian.md/cli).
23
+
24
+ It allows you to programmatically interact with your Obsidian vaults, create notes, search your knowledge base, and much more, straight from Python!
25
+
26
+ ## Features
27
+
28
+ - 🚀 **Simple and Intuitive API**: Pythonic wrappers around `obsidian` terminal commands.
29
+ - 📦 **Lightweight**: Uses standard Python `subprocess` to communicate with the CLI.
30
+ - 📝 **Fully Typed**: Includes type hints for an excellent IDE experience (autocomplete, type checking).
31
+ - 📖 **In-Editor Documentation**: The official Obsidian CLI documentation has been integrated directly into the docstrings. You'll see all function explanations right in your IDE without needing to open the browser!
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ pip install obsidian-cli-py
37
+ ```
38
+
39
+ > **Note**: This library requires the official [Obsidian CLI](https://help.obsidian.md/cli) to be installed and enabled in your Obsidian app (requires Obsidian v1.12.4+). Check the official docs for troubleshooting and setup instructions.
40
+
41
+ ## Documentation
42
+
43
+ Currently, this library does not maintain its own separate web documentation.
44
+
45
+ Because **every function in this library corresponds 1:1 to the official CLI commands**, you can simply rely on the [official Obsidian CLI documentation](https://help.obsidian.md/cli). Operations like `obsidian search` become `client.search()`, `obsidian base:create` becomes `client.base_create()`, and so on.
46
+
47
+ ## Quick Start
48
+
49
+ ```python
50
+ from obsidian_cli import ObsidianClient
51
+
52
+ # Initialize the client. Optionally specify a vault name.
53
+ client = ObsidianClient(vault="My Vault")
54
+
55
+ # Create a new note and open it in Obsidian
56
+ client.create(name="My First programmatic note", content="# Hello World\n\nThis was created via Python!", open=True, overwrite=True)
57
+
58
+ # Read the contents of a note
59
+ content = client.read(file="My First programmatic note")
60
+ print(content)
61
+
62
+ # Search your vault
63
+ results = client.search(query="Python")
64
+ print(results)
65
+ ```
66
+
67
+ ## Available Commands
68
+
69
+ The wrapper aims to support all Obsidian CLI commands except developer commands.
70
+
71
+ ### Additional Commands
72
+
73
+ - **Run arbitrary/plugin commands**: You can run commands registered by third-party plugins (like QuickAdd) using the generic execution method:
74
+ ```python
75
+ client.execute(command="quickadd", choice="My Choice")
76
+ ```
77
+
78
+ ## How it works
79
+
80
+ The Python library simply translates your method calls into the corresponding terminal CLI syntax. Pretty self-explanatory 🐐.
81
+
82
+ For example:
83
+
84
+ ```python
85
+ client.create(name="Note", content="Hello", open=True)
86
+ ```
87
+ Translates to the shell command:
88
+ ```bash
89
+ obsidian vault="My Vault" create name="Note" content="Hello" open
90
+ ```
91
+
92
+ ## Contributing
93
+
94
+ Contributions are welcome! If a command is missing or something needs fixing, feel free to submit a Pull Request.
95
+
96
+ 1. Clone the repository.
97
+ 2. Run `poetry install` (or your preferred environment manager).
98
+ 3. Run tests with `pytest`.
99
+
@@ -0,0 +1,82 @@
1
+ # obsidian-cli-py
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/obsidian-cli-py.svg)](https://pypi.org/project/obsidian-cli-py/)
4
+ [![Obsidian CLI Docs](https://img.shields.io/badge/docs-Obsidian_CLI-blue.svg)](https://help.obsidian.md/cli)
5
+
6
+ **obsidian-cli-py** is an unofficial, easy-to-use Python bridge for the new [Obsidian CLI](https://help.obsidian.md/cli).
7
+
8
+ It allows you to programmatically interact with your Obsidian vaults, create notes, search your knowledge base, and much more, straight from Python!
9
+
10
+ ## Features
11
+
12
+ - 🚀 **Simple and Intuitive API**: Pythonic wrappers around `obsidian` terminal commands.
13
+ - 📦 **Lightweight**: Uses standard Python `subprocess` to communicate with the CLI.
14
+ - 📝 **Fully Typed**: Includes type hints for an excellent IDE experience (autocomplete, type checking).
15
+ - 📖 **In-Editor Documentation**: The official Obsidian CLI documentation has been integrated directly into the docstrings. You'll see all function explanations right in your IDE without needing to open the browser!
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ pip install obsidian-cli-py
21
+ ```
22
+
23
+ > **Note**: This library requires the official [Obsidian CLI](https://help.obsidian.md/cli) to be installed and enabled in your Obsidian app (requires Obsidian v1.12.4+). Check the official docs for troubleshooting and setup instructions.
24
+
25
+ ## Documentation
26
+
27
+ Currently, this library does not maintain its own separate web documentation.
28
+
29
+ Because **every function in this library corresponds 1:1 to the official CLI commands**, you can simply rely on the [official Obsidian CLI documentation](https://help.obsidian.md/cli). Operations like `obsidian search` become `client.search()`, `obsidian base:create` becomes `client.base_create()`, and so on.
30
+
31
+ ## Quick Start
32
+
33
+ ```python
34
+ from obsidian_cli import ObsidianClient
35
+
36
+ # Initialize the client. Optionally specify a vault name.
37
+ client = ObsidianClient(vault="My Vault")
38
+
39
+ # Create a new note and open it in Obsidian
40
+ client.create(name="My First programmatic note", content="# Hello World\n\nThis was created via Python!", open=True, overwrite=True)
41
+
42
+ # Read the contents of a note
43
+ content = client.read(file="My First programmatic note")
44
+ print(content)
45
+
46
+ # Search your vault
47
+ results = client.search(query="Python")
48
+ print(results)
49
+ ```
50
+
51
+ ## Available Commands
52
+
53
+ The wrapper aims to support all Obsidian CLI commands except developer commands.
54
+
55
+ ### Additional Commands
56
+
57
+ - **Run arbitrary/plugin commands**: You can run commands registered by third-party plugins (like QuickAdd) using the generic execution method:
58
+ ```python
59
+ client.execute(command="quickadd", choice="My Choice")
60
+ ```
61
+
62
+ ## How it works
63
+
64
+ The Python library simply translates your method calls into the corresponding terminal CLI syntax. Pretty self-explanatory 🐐.
65
+
66
+ For example:
67
+
68
+ ```python
69
+ client.create(name="Note", content="Hello", open=True)
70
+ ```
71
+ Translates to the shell command:
72
+ ```bash
73
+ obsidian vault="My Vault" create name="Note" content="Hello" open
74
+ ```
75
+
76
+ ## Contributing
77
+
78
+ Contributions are welcome! If a command is missing or something needs fixing, feel free to submit a Pull Request.
79
+
80
+ 1. Clone the repository.
81
+ 2. Run `poetry install` (or your preferred environment manager).
82
+ 3. Run tests with `pytest`.
@@ -0,0 +1,16 @@
1
+ """
2
+ obsidian-cli-py
3
+
4
+ A Python wrapper for the Obsidian CLI.
5
+ """
6
+
7
+ from .client import ObsidianClient
8
+ from .exceptions import ObsidianCLIError, ObsidianCLINotFoundError, ObsidianCLICommandError
9
+
10
+ __version__ = "0.1.0"
11
+ __all__ = [
12
+ "ObsidianClient",
13
+ "ObsidianCLIError",
14
+ "ObsidianCLINotFoundError",
15
+ "ObsidianCLICommandError",
16
+ ]