Journaling kit for long-term self-analysis.
Project description
Perennial 🌱
Journaling kit for long-term self-analysis.
Journaling can help identify patterns and themes in one's thoughts and behaviors. Tracking mood can provide valuable information about what triggers certain moods and how to manage them. And tracking goals or tasks can help to stay focused and motivated and can provide a sense of accomplishment and progress as one works toward achieving them.
By combining these, an individual can gain a more complete picture of themselves and their behavior and can more easily achieve personal growth.
This journal kit was originally intended just for personal journaling, but I can also envision it being used for more specialized stories, such as documenting the course of projects, recording meeting minutes, or tracking pain across medical recovery.
Getting started
Install
pip install perennial
Or alternatively, download the source directly.
git clone https://almonds.dev/git/perennial
cd perennial
pip install -e .
Example usage
See the quickstart page for getting started using the command line arguments.
Load a journal
Start a new journal in the current working directory that keeps track of a daily streak:
>>> from perennial import Journal
>>>
>>> j = Journal(content="Example journal", streak_checker=StreakCheck.DAILY)
>>>
If the database file already exists, it is loaded:
>>> j = Journal()
>>>
Adding entries
>>> content = "I had a nice day today. I visited some friends and made progress on my journal project."
>>> e1 = j.record(content, mood=4)
>>> e1.streak # number of days logged in a row
22
>>>
Reflect on past entries
>>> search_results = j.search("dog") # retrieve entries with search terms
>>> e2 = search_results[0]
>>> e2.content
'Today I saw a cute dog. (:'
>>>
>>> e3 = j.random() # retrieve a random entry
>>> e3.date
datetime.datetime(2022, 12, 12, 10, 5, 0, 0)
>>>
Track mood
>>> from datetime import datetime, timedelta
>>> one_week_ago = datetime.today() - timedelta(days=7)
>>> today = datetime.today()
>>>
>>> entries = j.search(start_date=one_week_ago, end_date=today)
>>> moods = [e.mood if e.mood is not None for e in entries]
>>> moods
[3, 4, 3, 3, 2, 5, 3]
>>>
Goal or task tracking
Goals or tasks are associated with their states of completion.
>>> j.time_in_state("Submit PhD apps", "DOING")
datetime.timedelta(days=65)
>>>
>>> _ = j.goal("Submit PhD apps", "DONE")
>>> _ = j.goal("Meeting with Alex, Bailey, and Casey", "CANCELED")
>>> _ = j.goal("Fold laundry", "TODO")
>>>
Personally, I'm fond of this tetrad of task states, as used in Logseq:
TODO
DOING
DONE
CANCELED
Documentation
I'll also set this up eventually.
To-do
Accept Markdown files as entriesAbility to sync database streak info (important for adding latent entries)- CLI
- Tweak streak-tracking functions so they can be generalized
- Open new files automatically?
- Superjournals and subjournals? (kind of already have that)
- Eventually switch to a Rust implementation with SurrealDB?
Implementation
The journal entries are saved in a SQLite table called entries
:
Column name | Data type | Description |
---|---|---|
id |
INTEGER |
Primary key |
date |
TEXT |
Date of the journal entry |
content |
TEXT |
Journal entry summary |
streak |
INTEGER |
Daily streak |
mood |
INTEGER |
Mood level (e.g. scale 1-5) (may be NULL ) |
file |
TEXT |
Associated file (may be NULL ) |
And the goals and their states are stored in a table called goals
:
Column name | Data type | Description |
---|---|---|
id |
INTEGER |
Primary key |
date |
TEXT |
Date of goal update |
name |
TEXT |
Name of goal |
state |
TEXT |
State of goal (e.g. "TODO" , "DOING" , "DONE" , "CANCELED" ) |
Information about the journal itself is in a table called meta
, which always has a single row:
Column name | Data type | Description |
---|---|---|
id |
INTEGER |
Primary key |
date |
TEXT |
Date of journal creation |
content |
TEXT |
Journal summary |
streak_mode |
TEXT |
i.e. "daily", "weekly", "monthly", or "yearly" |
template |
TEXT |
Path to the template to use when touching a file for a new entry |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file perennial-0.1.0.tar.gz
.
File metadata
- Download URL: perennial-0.1.0.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc53984c552e11c5330c7061ab2521be78d98b9934e96ca1e1ef7b01c52124af |
|
MD5 | 1a351e0919efade7db1dcf279c0427a3 |
|
BLAKE2b-256 | 99128094422e46e6f1a1de0b890a9120f1628485698d4206e7d081a7217eeb54 |
File details
Details for the file perennial-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: perennial-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 881a53d20477ddc9d15de09746c0e32caf61b00b8a432fac7f4bf53295eba514 |
|
MD5 | c9c0c9c5d9d40c706b1cb38509006303 |
|
BLAKE2b-256 | 44029ff4285ab3d8add2f31e78d9ebab6321ed79b9d8ba59ca5381cc58285b60 |