take-note-cli


Nametake-note-cli JSON
Version 2.1.4 PyPI version JSON
download
home_pagehttps://github.com/wsinned/take-note
SummaryCreate and open notes in your favourite editor.
upload_time2024-11-27 15:49:35
maintainerNone
docs_urlNone
authorwsinned
requires_python<4.0,>=3.8
licenseMIT
keywords note tool utility cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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, navigate 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, created from a template so that eveything is consistent, if needed. 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.13.
- 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
  - VSCode and Obsidian are supported with dedicated handlers
  - Fallback generic handler will open anything ou can call from the terminal e.g. vi, emacs.
- 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.

### Obsidian Integration

Support for opening using [Obsidian application uris](https://help.obsidian.md/Extending+Obsidian/Obsidian+URI):

```bash
xdg-open "obsidian://open?path=/home/wsinned/Documents/Personal/WorkNotes/2024/11/2024-11-11-Weekly-log.md

```
This handler opens the vault 'Personal' and the note file in the WorkNotes/2024/11/ folder of the vault.

The command called adapts according to `sys.platform` e.g. `open`, `start` or `xdg-open`.

## Future features

- Support for daily notes options.

## Installation

### pipx

The recommended way to install the published package is through [pipx](https://pypa.github.io/pipx/).

```bash
# 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

```bash
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.

```bash
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.

```bash
> thisWeek
> lastWeek
> nextWeek
```

## Other Installation Methods

### Virtual Environment

```bash
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.

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

Then follow the instructions for other OS.

### Other Linux or macOS

```bash
# 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](https://github.com/charliermarsh/ruff) for linting and optionally for formatting.

```bash
poetry run ruff . --config pyproject.toml
```

## Build & Publish

From an installed and tested venv, do the following:

Bump the version in pyproject.toml

```bash
# build the package
poetry build

# ensure your pypi token is registered with Poetry
poetry config pypi-token.pypi <fresh-token>

# publish the package
poetry publish
```

TODO: add poetry publishing to GitHub workflow


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/wsinned/take-note",
    "name": "take-note-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "note, tool, utility, cli",
    "author": "wsinned",
    "author_email": "wsinned@tutanota.com",
    "download_url": "https://files.pythonhosted.org/packages/6b/28/6cc51cc4db0af236299d452d5038cf88d2f73cc8cdf19712265b77331b90/take_note_cli-2.1.4.tar.gz",
    "platform": null,
    "description": "# Take Note\n\n**Create, organise and open notes in your favourite editor.**\n\nI like having a quick, reliable and repeatable way of taking notes. If I have to open an editor, navigate 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, created from a template so that eveything is consistent, if needed. This really scratches my itch. If it works for you great! If not, create your own solution.\n\n## Features\n\n- 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.\n  - Works on Python 3.8 - 3.13.\n- Open notes files for specified week using the `code` command line for VS Code.\n  - --thisWeek, --lastWeek and --nextWeek are supported.\n- Organises notes in a date based folder structure from your root notes folder, e.g. 2023/08\n  - 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.\n  - set the root notes folder using --notesFolder\n- Choose which editor to use with --editor\n  - VSCode and Obsidian are supported with dedicated handlers\n  - Fallback generic handler will open anything ou can call from the terminal e.g. vi, emacs.\n- Specify a VS Code workspace to open along with the note file with --workspace\n  - This will automatically override the --editor setting to `code`. I have my default workspace set up with:\n    - Zen mode\n    - Word wrap\n- 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.\n- 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.\n- Config file allows base options to be set and reduce command line arguments needed.\n\n### Obsidian Integration\n\nSupport for opening using [Obsidian application uris](https://help.obsidian.md/Extending+Obsidian/Obsidian+URI):\n\n```bash\nxdg-open \"obsidian://open?path=/home/wsinned/Documents/Personal/WorkNotes/2024/11/2024-11-11-Weekly-log.md\n\n```\nThis handler opens the vault 'Personal' and the note file in the WorkNotes/2024/11/ folder of the vault.\n\nThe command called adapts according to `sys.platform` e.g. `open`, `start` or `xdg-open`.\n\n## Future features\n\n- Support for daily notes options.\n\n## Installation\n\n### pipx\n\nThe recommended way to install the published package is through [pipx](https://pypa.github.io/pipx/).\n\n```bash\n# from PyPI\npipx install take-note-cli\n\n# direct from github\npipx install git+https://github.com/wsinned/take-note\n```\n\n## Usage\n\n### Config File\n\nA 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.\n\n#### Config File Default Options\n\n- notesFolder: Notes\n- editor: code\n- workspace:\n- template:\n- batch:\n- verbose: False\n\n### Command Line\n\nCommand line arguments will override any specified in the config file.\nSpecify a folder using the --notesFolder option.\nA week option must be supplied from --thisWeek, --lastWeek or --nextWeek\n\n```bash\ntake-note --notesFolder=$HOME/MyNotes --thisWeek\n```\n\nA 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\n\n### Aliases\n\nSetting up aliases in you preferred shell is a great way to make accessing your notes quick and easy.\n\n```bash\nNOTES_FOLDER=\"$HOME/SomePath/MyNotes\"\n\nalias thisWeek=\"take-note --thisWeek --notesFolder $NOTES_FOLDER --workspace notes.code-workspace\"\nalias nextWeek=\"take-note --nextWeek --notesFolder $NOTES_FOLDER --workspace notes.code-workspace --batch 5\"\nalias lastWeek=\"take-note --lastWeek --editor hx\"\n```\n\nAll you have to do now is type one of the following to open the desired note file.\n\n```bash\n> thisWeek\n> lastWeek\n> nextWeek\n```\n\n## Other Installation Methods\n\n### Virtual Environment\n\n```bash\npython -m venv venv \n\nsource venv/bin/activate\n\nvenv/bin/pip install -r requirements.txt\n\n# install with tests as editable src\nvenv/bin/pip install -e .\n\n```\n\n## Development\n\n### Nix & NixOS\n\nThe supplied shell.nix definition provides support for entering a nix-shell directly in the repository with all dependencies.\n\n```bash\nnix-shell --run zsh # ensure using zsh over default bash session\n```\n\nThen follow the instructions for other OS.\n\n### Other Linux or macOS\n\n```bash\n# only needed once, or to recreate the virtual environment\n# install dependencies\npoetry install\n\n# enter an activated shell and run tests\npoetry shell\npytest\nruff . --config pyproject.toml\n\n# run the tests without activating a shell\npoetry run pytest\n\n# run the installed app\npoetry run take-note-cli --thisWeek\n\n# exit the shell\nexit\n```\n\n## Linting\n\nThe project uses [ruff](https://github.com/charliermarsh/ruff) for linting and optionally for formatting.\n\n```bash\npoetry run ruff . --config pyproject.toml\n```\n\n## Build & Publish\n\nFrom an installed and tested venv, do the following:\n\nBump the version in pyproject.toml\n\n```bash\n# build the package\npoetry build\n\n# ensure your pypi token is registered with Poetry\npoetry config pypi-token.pypi <fresh-token>\n\n# publish the package\npoetry publish\n```\n\nTODO: add poetry publishing to GitHub workflow\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Create and open notes in your favourite editor.",
    "version": "2.1.4",
    "project_urls": {
        "Homepage": "https://github.com/wsinned/take-note",
        "Repository": "https://github.com/wsinned/take-note"
    },
    "split_keywords": [
        "note",
        " tool",
        " utility",
        " cli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8891e9070b92aa400b2ffe3241cd97269a48b10b32950b2097fcd9bd6171b9e0",
                "md5": "e57d1d437dd5edf417c562b829a47847",
                "sha256": "f0302aec3ee6068e826ce0a3167b71bb22d0e7ccf13f62c0029f667081e1737b"
            },
            "downloads": -1,
            "filename": "take_note_cli-2.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e57d1d437dd5edf417c562b829a47847",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 10455,
            "upload_time": "2024-11-27T15:49:34",
            "upload_time_iso_8601": "2024-11-27T15:49:34.283939Z",
            "url": "https://files.pythonhosted.org/packages/88/91/e9070b92aa400b2ffe3241cd97269a48b10b32950b2097fcd9bd6171b9e0/take_note_cli-2.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b286cc51cc4db0af236299d452d5038cf88d2f73cc8cdf19712265b77331b90",
                "md5": "4492e0eea02e68f0fb212627e87c890e",
                "sha256": "1e37ff8e9964a48682a732a03d64698ccea821a0fae80bc272a5ea4f2bba87cb"
            },
            "downloads": -1,
            "filename": "take_note_cli-2.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "4492e0eea02e68f0fb212627e87c890e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 9647,
            "upload_time": "2024-11-27T15:49:35",
            "upload_time_iso_8601": "2024-11-27T15:49:35.309254Z",
            "url": "https://files.pythonhosted.org/packages/6b/28/6cc51cc4db0af236299d452d5038cf88d2f73cc8cdf19712265b77331b90/take_note_cli-2.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-27 15:49:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wsinned",
    "github_project": "take-note",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "take-note-cli"
}
        
Elapsed time: 0.42390s