Skip to main content

A simple and light-weight notepad for the command line

Project description

sjournal GitHub release (latest SemVer including pre-releases)

A simple and light-weight notepad for the command line:

Demo

Installation

Latest release via pip

> pip install sjournal

Usage

Sjournal commands can be invoked using either sjournal or sj

Creating and Loading Journals

If using Sjournal for the first time, a blank journal called "notes" will be automatically created:

> sjournal

No config file found. Creating new one at <HOME_DIR>/sjournal/sjournal_config.json

                 notes
┌────┬───────────┬──────────┬─────────┐
│ ID  Timestamp  Category  Content │
├────┼───────────┼──────────┼─────────┤
└────┴───────────┴──────────┴─────────┘

To create a new Journal or load an Existing one, use sjournal load:

> sjournal load MyJournal
Set journal to <HOME_DIR>/sjournal/journals/MyJournal.db

> sjournal

               MyJournal
┌────┬───────────┬──────────┬─────────┐
│ ID  Timestamp  Category  Content │
├────┼───────────┼──────────┼─────────┤
└────┴───────────┴──────────┴─────────┘

Adding Notes

Add notes with sjournal add:

  • Set the category with -c/--category. Default category is "General"
  • Set the Style (Rich Markup) with -s/--style
> sjournal add -c TODO -s "bold red" "Update the README ASAP"
~ OR ~
> sjournal add --category="TODO" --style="bold red" "Update the README ASAP"

> sjournal

Demo_Add

Listing and Searching Notes

Show notes with sjournal or sjournal list:

Show most recent 5 notes by default:
> sjournal list
                     MyJournal
┌────┬───────────────────┬──────────┬──────────────┐
│ ID  Timestamp          Category  Content      │
├────┼───────────────────┼──────────┼──────────────┤
│ 5   03-20-22 15:55:40  General   Misc. Note 5 │
│ 4   03-20-22 15:55:39  General   Misc. Note 4 │
│ 3   03-20-22 15:55:38  General   Misc. Note 3 │
│ 2   03-20-22 15:55:37  General   Misc. Note 2 │
│ 1   03-20-22 15:55:35  General   Misc. Note 1 │
└────┴───────────────────┴──────────┴──────────────┘

Show all notes:
> sjournal list -a 
                          MyJournal
┌────┬───────────────────┬──────────┬────────────────────────┐
│ ID  Timestamp          Category  Content                │
├────┼───────────────────┼──────────┼────────────────────────┤
│ 5   03-20-22 15:55:40  General   Misc. Note 5           │
│ 4   03-20-22 15:55:39  General   Misc. Note 4           │
│ 3   03-20-22 15:55:38  General   Misc. Note 3           │
│ 2   03-20-22 15:55:37  General   Misc. Note 2           │
│ 1   03-20-22 15:55:35  General   Misc. Note 1           │
│ 0   03-20-22 15:30:55  TODO      Update the readme ASAP │
└────┴───────────────────┴──────────┴────────────────────────┘

Show the last N notes:
> sjournal list 2
                     MyJournal
┌────┬───────────────────┬──────────┬──────────────┐
│ ID  Timestamp          Category  Content      │
├────┼───────────────────┼──────────┼──────────────┤
│ 5   03-20-22 15:55:40  General   Misc. Note 5 │
│ 4   03-20-22 15:55:39  General   Misc. Note 4 │
└────┴───────────────────┴──────────┴──────────────┘

Show notes with a given category:
> sjournal list -c TODO
                          MyJournal
┌────┬───────────────────┬──────────┬────────────────────────┐
│ ID  Timestamp          Category  Content                │
├────┼───────────────────┼──────────┼────────────────────────┤
│ 0   03-20-22 15:30:55  TODO      Update the readme ASAP │
└────┴───────────────────┴──────────┴────────────────────────┘

Search note content with a specific word or phrase (regex allowed)
> sjournal search readme
                          MyJournal
┌────┬───────────────────┬──────────┬────────────────────────┐
│ ID  Timestamp          Category  Content                │
├────┼───────────────────┼──────────┼────────────────────────┤
│ 0   03-20-22 15:30:55  TODO      Update the readme ASAP │
└────┴───────────────────┴──────────┴────────────────────────┘

Editing and Deleting Notes

Edit the most recent note, or edit by ID:

> sjournal edit
Editing Note #0 (copied to clipboard): "Update the README ASAP"
Enter new note text ([bold red]Update the README ASAP[/]): Update the readme eventually

> sjournal edit 0
Editing Note #0 (copied to clipboard): "Update the readme eventually"
Enter new note text (Update the readme eventually): Update the readme [bold red]RIGHT NOW[/]

Delete notes by a single ID, mutiple IDs, or a range of IDs:

> sjournal
                     MyJournal
┌────┬───────────────────┬──────────┬──────────────┐
│ ID  Timestamp          Category  Content      │
├────┼───────────────────┼──────────┼──────────────┤
│ 5   03-20-22 15:48:38  General   Misc. Note 5 │
│ 4   03-20-22 15:48:37  General   Misc. Note 4 │
│ 3   03-20-22 15:48:34  General   Misc. Note 3 │
│ 2   03-20-22 15:48:33  General   Misc. Note 2 │
│ 1   03-20-22 15:48:30  General   Misc. Note 1 │
└────┴───────────────────┴──────────┴──────────────┘

> sjournal delete 4
DELETED NOTE #4

> sjournal delete 1 2 3
DELETED NOTE #1
DELETED NOTE #2
DELETED NOTE #3

> sjournal delete 2-5
DELETED NOTE #2
DELETED NOTE #3
DELETED NOTE #4
DELETED NOTE #5

Backup and Restore Journals

Journals can be backed up and restored with sjournal backup and sjournal restore

Specific filenames can be given with -f <filename>. Othewise, the current time at backup will be used.

> sjournal backup
BACKING UP C:/Users/samue/sjournal/journals/MyJournal.db 
TO FILE C:/Users/samue/sjournal/journals/backups/MyJournal/backup_MyJournal_22_03_20_16_00_45.db

> sjournal restore
RESTORING BACKUP FROM C:\Users\samue\sjournal\journals\backups\MyJournal\backup_MyJournal_22_03_20_16_00_45.db
REPLACING C:\Users\samue\sjournal\journals\MyJournal.db

Custom Aliases (Windows)

If you want to run Sjournal with a different shorthand within Cmder or Windows Cmd (such as myalias):

Setting up an alias in Cmder

> alias myalias=sjournal $*

Setting up an alias in Windows Cmd

> cd c:/
> mkdir alias
> cd alias
> echo @echo off >> myalias.bat
> echo echo. >> myalias.bat
> echo sjournal %* >> myalias.bat

Finally, add c:/alias to PATH in your system environment variables.

After restarting the terminal, sjournal can be used by calling the new alias in the command line:

> myalias --version

Full List of Commands

To see help for a specific command, use sjournal [COMMAND] --help

usage: sjournal [-h] [-d] [-v] {add,backup,categories,delete,edit,erase,help,list,load,restore,search} ...

options:
  -h, --help            show this help message and exit
  -d, --debug           Output to reports/debug.log instead of stdout
  -v, --version         Show sjournal information

Commands:
  {add,backup,categories,delete,edit,erase,help,list,load,restore,search}
                        Commands
    add                 Add a note to the database
    backup              Backup the current journal
    categories          List all categories in the current journal
    delete              Delete one or multiple notes from the database
    edit                Edit a note to the database
    erase               Delete all notes from the current journal
    help                Display help text
    list                List notes in the database
    load                Load a journal or create a new one if it doesn't exist
    restore             Restore the database from a file. If --filename is not given, restore the latest backup
    search              List notes matching search term

To see help for specific commands, use sjournal [COMMAND] --help

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

sjournal-0.2.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

sjournal-0.2.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file sjournal-0.2.1.tar.gz.

File metadata

  • Download URL: sjournal-0.2.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.3

File hashes

Hashes for sjournal-0.2.1.tar.gz
Algorithm Hash digest
SHA256 013e2e0eeeb350184eb5469797f74764496b981bff16d412e0c82089eff627b4
MD5 3aaf11fc090a05fa12f0db0d625c36f8
BLAKE2b-256 826973f4f13e4f8f414058aee8f0a34a97eb81830ce3b59d5aca9e5e2ed71787

See more details on using hashes here.

File details

Details for the file sjournal-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: sjournal-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.3

File hashes

Hashes for sjournal-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f13855340c3b8cf743379c2524a4300cf0292a7102b31832d809463c1a849911
MD5 be897993a1cefa0ff16ccabebee3b844
BLAKE2b-256 c5388004e807568888a60e78e369c979a1900f603af41b512c91d1895e6d2ad9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page