daro - Python Package
A CLI tool for managing personal board data with IM sync - Python bindings for the daro Rust CLI.
Features
- Hybrid CLI: Automatically uses Rust daro binary if installed, falls back to Python implementation
- Full Rust API Access: All core daro functionality available in Python via maturin bindings
- CLI Commands: Complete CLI interface matching the Rust daro commands
- TUI Interface: Direct access to the full-featured Rust TUI with real-time IM sync
- Type Safety: Strongly-typed Python bindings using PyO3
How It Works
The daro Python CLI uses a smart hybrid approach:
- Rust Binary Preferred: When you run
darocommand, it first checks if the Rust daro binary is installed on your system - Seamless Delegation: If Rust daro is found, all commands are delegated to it for maximum performance and features
- Python Fallback: If Rust daro is not available, it falls back to the Python implementation using Rust bindings
- Check Status: Run
daro doctorto see which implementation is being used
$ daro doctor
Daro CLI
========
Version: 0.1.0
Build time: 2026-03-28T09:36:33.389017+00:00
Rust version: 1.91.0
Platform: macos aarch64
Config directory: /Users/jintian/.config/daro
Installation
Prerequisites
-
Rust toolchain (for building from source):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Python 3.8+
-
maturin (for building):
pip install maturin
Install from PyPI (recommended)
pip install daro
Install from source
# Clone the repository
cd daro-py
# Install with maturin
maturin develop --release
# Or build and install
maturin build --release
pip install target/wheels/daro-*.whl
Usage
CLI Commands
# Check version
daro --version
# Login
daro login -u your_username
# Check login status
daro status
# Logout
daro logout
# Add a new board item
daro add -T "My Todo" -c "Description" -y Todo
# Add interactively
daro add -i
# List items
daro list
daro list -t Todo --page 1
daro list -s "search term"
# Edit an item
daro edit <id> -T "New Title" -c "New content"
# Delete an item
daro delete <id>
# Show statistics
daro stats
# Run TUI (full Rust TUI experience)
daro tui
Python API
from daro import DaroDb, DaroAuth, PyBoardDataType, PyBoardDataStatus
# Authentication
auth = DaroAuth()
# Login
user = auth.login("username", "password")
print(f"Logged in as: {user.user_nick_name}")
# Check login status
if auth.is_logged_in():
print(f"Username: {auth.get_username()}")
# Database operations
db = DaroDb() # Uses default path ~/.config/daro/daro.db
# Create a board item
item = db.create_board(
title="My Task",
content="Task description",
board_type=PyBoardDataType.Todo,
)
print(f"Created: {item.id}")
# Get a board item
item = db.get_board(item.id)
print(f"Title: {item.title}")
print(f"Type: {item.type.label()}") # Chinese label: 待办
# Update a board item
updated = db.update_board(
id=item.id,
title="Updated Title",
status=PyBoardDataStatus.Done,
)
# List board items
items = db.list_boards(page=0, per_page=20)
for item in items:
print(f"{item.title} - {item.status}")
# Filter by type
todos = db.list_boards(page=0, per_page=20, board_type=PyBoardDataType.Todo)
# Search
results = db.search_boards("keyword")
# Get statistics
stats = db.get_stats()
print(f"Total: {stats['total']}")
print(f"By type: {stats['by_type']}")
print(f"By status: {stats['by_status']}")
# Delete a board item
db.delete_board(item.id)
# Logout
auth.logout()
Board Data Types
from daro import PyBoardDataType
# All available types
PyBoardDataType.Todo # 待办
PyBoardDataType.Thought # 思考
PyBoardDataType.Note # 笔记
PyBoardDataType.Diary # 日记
PyBoardDataType.Clip # 碎碎念
PyBoardDataType.Image # 图片
PyBoardDataType.Link # 链接
PyBoardDataType.Word # 单词
PyBoardDataType.Video # 视频
PyBoardDataType.Audio # 声音
PyBoardDataType.Prompt # 提示词
PyBoardDataType.Feed # Feed流
PyBoardDataType.Book # 书籍
PyBoardDataType.Paper # 论文
PyBoardDataType.Transaction # 记账
PyBoardDataType.Quote # 慧语
PyBoardDataType.Group # 分组
PyBoardDataType.Other # 其他
Board Data Status
from daro import PyBoardDataStatus
PyBoardDataStatus.Todo
PyBoardDataStatus.Doing
PyBoardDataStatus.Done
PyBoardDataStatus.Archived
TUI Mode
The daro tui command launches the full Rust TUI with all features:
- Real-time IM sync with memox messages
- Keyboard shortcuts:
n- Create new iteme- Edit selected itemd- Delete selected itemTab- Switch focusEnter- Toggle previews- Cycle view modeh- Show helpq- Quit
- Content-only editing mode (
ikey) - Settings popup (
Shift+S) - Preview panel (
pkey)
Configuration
Configuration is stored at ~/.config/daro/config.toml:
api_url = "http://ark.manaai.cn/api/v1"
im_broker_url = "ark.manaai.cn"
mqtt_port = 1883
base_url = "https://ark.manaai.cn"
database = { path = "daro.db" }
Credentials are encrypted and stored at ~/.config/daro/credential.
Development
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black daro/
ruff check daro/
# Build wheel
maturin build --release
# Test installation
pip install target/wheels/daro-*.whl
Architecture
daro Python Package
├── daro._daro (Rust extension module via maturin)
│ ├── DaroDb - Database operations
│ ├── DaroAuth - Authentication
│ ├── PyBoardDataType - Type enum
│ ├── PyBoardDataStatus - Status enum
│ └── PyBoardData - Data class
├── daro.cli (Python CLI using click)
│ ├── login/logout/status
│ ├── add/edit/delete/list
│ ├── stats
│ └── tui (calls Rust TUI)
└── daro.tui (Python wrapper)
└── Invokes Rust daro tui command
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues and feature requests, please use the GitHub issue tracker.
Metadata
Release files for daro 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| daro-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ x86-64 | Details for daro-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| daro-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ ARM64 | Details for daro-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
| daro-0.1.1-cp38-abi3-macosx_11_0_arm64.whl | CPython 3.8 | abi3 | macOS 11.0+ ARM64 | Details for daro-0.1.1-cp38-abi3-macosx_11_0_arm64.whl |
Total release size: 21.2 MB
Release files / daro-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | daro-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 7.5 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
649bd77e606fc80cc2a3ba3c3cdaeb9feeb7e54fba7047161a1551831491ba24
|
|
BLAKE2b-256 checksum How to use checksums |
ad639c137946280fbea4a3feee81e0e5329c71f50f267da7c18ab07c2aaee50d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Release files / daro-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | daro-0.1.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 7.0 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
7ddee3e4b53e27e2726f89ff2fd8d3aec565f945c8f8e3e0553b12517bf5d039
|
|
BLAKE2b-256 checksum How to use checksums |
c31ef53eea2b58845bb93d1459d3397521f20773f9bfb2c1413c09ca19153d78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Release files / daro-0.1.1-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | daro-0.1.1-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 6.7 MB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
01d2ff7eeebd79cb99d745e94bf43d57ac4d2f40dbfe4b49acad9adf4c42e307
|
|
BLAKE2b-256 checksum How to use checksums |
93b096aa15ea6bdf81a3fb07b94fdefafc60762f3597f2f2223fed9f295ac540
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Security for daro 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.