Skip to main content

Write a journal

Project description

PyPI PyPI - Python Version Code style: black

jrnl

jrnl is a personal journal management application.

Usage

Setup

Set up your journal by printing out a config file, like so:

jrnl --setup

and fill out the path to the root of your journal.

Using jrnl

Open up today's journal entry with

jrnl

which will open up today's journal entry in your favourite text editor.

Using jrnl grep

jrnl also comes with a grep wrapper which you can invoke as follows:

jrnl grep [OPTIONS] PATTERN

where OPTIONS are normal grep options.

Advanced usage

Timestamps

You can generate a timestamp before opening the entry by using the -t flag:

jrnl -t

or you can have timestamps always written by specifying so in your config file.

Negative date offsets

You can open up another date's journal entry by specifying a date as an argument. One way of doing this is with negative date offsets: for example, to open up yesterday's journal run

jrnl -1

Fuzzy dates

Another way to pass a date to jrnl is with a date string (wrapped in quotes if it contains spaces). jrnl uses dateutil's fuzzy date parser to parse the strings you pass in, which lets you specify dates like "Nov 7 2017":

jrnl "Nov 7 2017"

dateutil can do more: for example, specifying the 4th of the current month's date with

jrnl 4

Accessing the latest existing entry

You can open the latest existing journal entry with HEAD like so:

jrnl HEAD

Aliases for HEAD are LAST and LATEST—all of which are case insensitive.

Accessing an existing entry's ancestor

You can access the ancestor of an existing entry with suffixes ^ or ~N (for the Nth ancestor). These work almost identically to the same suffixes in git. For example, to find the fifth last existing journal enty, you can do

jrnl HEAD~5

Accessing the closest existing entry to a given date

To access the closest existing journal entry for a given date, add the @ prefix to the date. For example, to find the closest entry to 2017-01-01, you'd do

jrnl @2017-01-01

Opening multiple entries

To open up multiple entries simply pass in multiple date arguments. For example,

jrnl -7 "Jan 01 2016" 20180504

will open entries for a week ago, 2018-01-01, and 2018-05-04.

Extending a date past midnight

If in your config file you have

hours_past_midnight_included_in_date: N

where N is some postive integer; then for a given date, at 0N:00 or earlier, jrnl will open up the day before's journal entry.

:confused: What? Here's the motivation:

When it's 02:00, we're likely to refer to this time as night, rather than morning. Likewise, you might want a journal chunk (for lack of a better term) written at 02:00 to be in the same entry as chunks from (technically) the previous day. If you do want such a thing, you can specify a time in your config file: at any time before this specified time (inclusive), jrnl will open up the day before's journal entry.

Journal structure

Right now you're constrained to having a journal structure like so:

journal_root/
journal_root/2017/
journal_root/2017/2017-07-05.txt
journal_root/2017/2017-09-01.txt

and if you want to use all the features you're going to need to be okay with ISO 8601-based timestamps:

2017-09-01
21:06

You'd write stuff here.

22:30

And more stuff here.

How do I install this?

pipx install jrnl-mw

or just run the run_jrnl.py script directly.

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

jrnl_mw-1.4.1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

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

jrnl_mw-1.4.1-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file jrnl_mw-1.4.1.tar.gz.

File metadata

  • Download URL: jrnl_mw-1.4.1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.2 cpython/3.13.5 HTTPX/0.28.1

File hashes

Hashes for jrnl_mw-1.4.1.tar.gz
Algorithm Hash digest
SHA256 8a276963e3d91ec6e61f9b51601de441b451b76376bde0357240c35ec1273b84
MD5 70de5801e585a5f01789a3f70aec0973
BLAKE2b-256 904092e6607d49aba183b5d1ed78462e46154d68dd3fa71aff0d3acfab665dad

See more details on using hashes here.

File details

Details for the file jrnl_mw-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: jrnl_mw-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.2 cpython/3.13.5 HTTPX/0.28.1

File hashes

Hashes for jrnl_mw-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f873c37c2acc6b7202804be7e74376b20a190f4210de6cf292fdde5c5d802740
MD5 d248a03fa60b5626d5d704c9eb8a67c3
BLAKE2b-256 b7d2e46940ef980e53adbc4589750d25dad5c209dcac5092fa046225a3d1243b

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