Getting Started
Getting Started
Section titled “Getting Started”Requirements
Section titled “Requirements”- Python 3.10+
- SQLite (bundled with Python)
- Dependencies (installed automatically):
jdatetime,prompt_toolkit
Install
Section titled “Install”git clone https://github.com/MSadraShakouri/DailyDriver.gitcd DailyDriverpip install .To work on the code and run the tests, install the test extra in editable mode:
pip install -e '.[test]'python -m pytestFrom the repository directory:
./main.py # or: python main.pyYou’ll see the daily header followed by a > prompt. Type ? for a command summary, add -h after any command for its details, or just start writing a journal entry:
> today was a productive dayPress q to quit. All data is saved instantly to data/daily.db.
The da alias (recommended)
Section titled “The da alias (recommended)”Most day-to-day use is single-shot: run one command and exit immediately. Set up a shell alias so logging is a single keystroke away.
Add to ~/.bashrc or ~/.zshrc:
alias da='python /path/to/DailyDriver/main.py'Then log without entering the interactive prompt:
da p # log the current prayerda s 23:00 07:15 # log sleepda "worked on the report 9-11" # a journal entryAnything you pass as arguments is run as one command, then the app exits. This is the fastest workflow for muscle-memory logging.
The rich interactive prompt (history + autocompletion) only activates in the full REPL on an interactive terminal. Single-shot
dacalls and piped input fall back to plain prompts automatically, so nothing slows down or breaks.
Tab completion
Section titled “Tab completion”Both the REPL and the da CLI complete with Tab: subcommands (qada log,
nazr counter_reset), flags (-h, --txt, -n), and live database values
(target names, qada entries, category paths, active state slots).
- REPL: built in — just press
Tabat the>prompt. - CLI: install a script from
completions/(bash, zsh, fish supported), e.g. for bash add to~/.bashrc:
source /path/to/DailyDriver/completions/daily.bashValues match fuzzily and best-first: alex, rel/ale, or alemor all find the
category relatives/alex_morgan. Command names stay plain substring matches.
In plain zsh, completion is prefix-based as usual. With the
fzf-tab plugin, zsh hands every candidate
to fzf, so fzf’s own search rules apply (see
completions/). Open a new terminal after
updating the zsh script.
Then da qada log <TAB> offers prayer slots and backlog names, and
da travel <TAB> offers on / off / status.
Termux quick-entry dialog (Android)
Section titled “Termux quick-entry dialog (Android)”On Termux you can pop a native Android text dialog for a fast journal entry:
da -md # or: da --termux-dialogThis opens termux-dialog, takes your typed text, and logs it as a journal entry (running category selection afterwards in the terminal). Outside Termux it prints a short notice and exits.
How input works
Section titled “How input works”DailyDriver upgrades input with prompt_toolkit (command autocompletion, persistent history, and an autocompleting category picker) when it runs in an interactive terminal. When that isn’t possible — piped input, redirects, a dumb terminal, or if prompt_toolkit is unavailable — it silently falls back to plain prompts and behaves exactly as before. Output (headers, tables, calendars) is always plain text.
Data & privacy
Section titled “Data & privacy”Everything lives in data/daily.db (SQLite). There are no analytics; the only network calls are optional weather lookups (Tehran, IRIMO). Inspect the database directly if you like:
sqlite3 data/daily.db ".tables"sqlite3 data/daily.db "SELECT * FROM entries LIMIT 5;"You can point the app or the tests at a different database with the DAILYDRIVER_DB environment variable.