Skip to main content

Create and open notes in your favourite editor.

Project description

Take Note

Create, organise and open notes in your favourite editor.

I like having a quick, reliable and repeatable way of taking notes. If I have to open an editor, nvigate to the correct file, or create one in the correct place when it doesn't exist, then I find that I end up taking notes in random places. With Take Note, I have a few simple aliases set up so that typing thisWeek in my shell gets me to the right place in my DropBox with a new file if needed, created from a template so that eveything is consistent. This really scratches my itch. If it works for you great! If not, create your own solution.

Features

  • Written in Python with minimal runtime dependencies. Initially there were none, but I recently added Confuse (in v2.0.0) to allow a config file to do some of the heavy lifting that made aliases cumbersome.
    • Works on Python 3.8 - 3.12.
  • Open notes files for specified week using the code command line for VS Code.
    • --thisWeek, --lastWeek and --nextWeek are supported.
  • Organises notes in a date based folder structure from your root notes folder, e.g. 2023/08
    • The default folder is $HOME/Notes. I prefer to keep them in Google Drive or DropBox so I can access from mobile, tablet or my spare laptop.
    • set the root notes folder using --notesFolder
  • Choose which editor to use with --editor
  • Specify a VS Code workspace to open along with the note file with --workspace
    • This will automatically override the --editor setting to code. I have my default workspace set up with:
      • Zen mode
      • Word wrap
  • Specify a template file relative to the root notes folder to use when a new file is created using --template. This also performs a simple replacement of the text HEADER_DATE with the date formatted as "%A %d %B %Y" to use in the document title.
  • Support for batch creation of files in advance. This is useful if you use a device where you can edit files, but can't easily create them. Use --batch 5 along with any of the --*Week options to create that week and the following 4 weeks too.
  • Config file allows base options to be set and reduce command line arguments needed.

Future features

  • Support for daily notes options.

Installation

pipx

The recommended way to install the published package is through pipx.

# from PyPI
pipx install take-note-cli

# direct from github
pipx install git+https://github.com/wsinned/take-note

Usage

Config File

A basic config file will be created in ~/.config/TakeNote/config.yaml if it doesn't already exist. Specifying default values here simplifies use of the command line by reducing the number of options needed to be supplied or added to an alias.

Config File Default Options

  • notesFolder: Notes
  • editor: code
  • workspace:
  • template:
  • batch:
  • verbose: False

Command Line

Command line arguments will override any specified in the config file. Specify a folder using the --notesFolder option. A week option must be supplied from --thisWeek, --lastWeek or --nextWeek

take-note --notesFolder=$HOME/MyNotes --thisWeek

A note will be created in the under the MyNotes/YYYY/mm folder named with the date of the Monday of this week, e.g. 2023-08-07-Weekly-log.md

Aliases

Setting up aliases in you preferred shell is a great way to make accessing your notes quick and easy.

NOTES_FOLDER="$HOME/SomePath/MyNotes"

alias thisWeek="take-note --thisWeek --notesFolder $NOTES_FOLDER --workspace notes.code-workspace"
alias nextWeek="take-note --nextWeek --notesFolder $NOTES_FOLDER --workspace notes.code-workspace --batch 5"
alias lastWeek="take-note --lastWeek --editor hx"

All you have to do now is type one of the following to open the desired note file.

> thisWeek
> lastWeek
> nextWeek

Other Installation Methods

Virtual Environment

python -m venv venv 

source venv/bin/activate

venv/bin/pip install -r requirements.txt

# install with tests as editable src
venv/bin/pip install -e .

Development

Nix & NixOS

The supplied shell.nix definition provides support for entering a nix-shell directly in the repository with all dependencies.

nix-shell --run zsh # ensure using zsh over default bash session

Then follow the instructions for other OS.

Other Linux or macOS

# only needed once, or to recreate the virtual environment
# install dependencies
poetry install

# enter an activated shell and run tests
poetry shell
pytest
ruff . --config pyproject.toml

# run the tests without activating a shell
poetry run pytest

# run the installed app
poetry run take-note-cli --thisWeek

# exit the shell
exit

Linting

The project uses ruff for linting and optionally for formatting.

poetry run ruff . --config pyproject.toml

Build & Publish

From an installed and tested venv, do the following:

Bump the version in pyproject.toml

# build the package
poetry build

# publish the package
poetry publish

Credentials for twine should be either: - stored in .pypirc in the [pypi] section - entered at the prompt, username = token and password = your_api_key

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

take_note_cli-2.0.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

take_note_cli-2.0.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file take_note_cli-2.0.0.tar.gz.

File metadata

  • Download URL: take_note_cli-2.0.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.6.43

File hashes

Hashes for take_note_cli-2.0.0.tar.gz
Algorithm Hash digest
SHA256 40c38a1a8ec7c36c49f5f4b839bbff6f4c8815d030e4ca7ea2dd92d5568734dc
MD5 fd80d2f48a716548ec81f52e16063dbe
BLAKE2b-256 038fad4c72fea8562c88bb87c6c9b8724e864f7961b265347fad4ce11f66e337

See more details on using hashes here.

File details

Details for the file take_note_cli-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: take_note_cli-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.6.43

File hashes

Hashes for take_note_cli-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81678a029b173dd4135b944bec7d2e6366aa7c141edbd300c6389ee292283a90
MD5 251d309204bdfb92c583b2ebf424ea50
BLAKE2b-256 7373f1a57281439011afc40f99053b25d9ae3251ee136afdba08cee16b01b195

See more details on using hashes here.

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