Skip to main content

No project description provided

Project description

habits.txt

habits.txt is a plain text habit tracker.

Concepts

Time-bound

A habit is time-bound. It has a start date, and eventually an end date. It means with habits.txt, you can track habits for a specific period of time. When you want to stop tracking a habit, you can just stop tracking it.

Frequency

A habit is defined by a frequency, else it's called a task. The minimum frequency supported by habits.txt is daily (it doesn't support intra-day habits).

Boolean or Numeric

A habit can be boolean or numeric. A boolean habit is either done or not done. A numeric habit is a value, like the number of pages read in a day.

Format

Habits are tracked in what I call a "journal" which is just a plain text file. A journal contains "directives".

A directive is composed of a date, a directive type, a habit name, and other metadata specific to the directive type. For example, here is a sample directive:

2024-01-01 track "Read 5 pages a day"

You can comment lines in your journal by starting them with a # character. You can't add comments at the end of a line.

# Start tracking a habit
2024-01-01 track "Read 5 pages a day"

Directives

track

To start tracking a habit, you use the track directive and specify the frequency of the habit.

The frequency follows a simplified cron syntax, omitting the minute and the hour.

Example:

2024-01-01 track "Read 5 pages a day" * * *
2024-01-01 track "Exercise" * * 1,3,5

untrack

To stop tracking a habit, you use the untrack directive.

Example:

2024-02-01 untrack "Read 5 pages a day"

record

To record a habit, you use the record directive and specify a value.

The allowed values are yes, no, or a number. You should not mix boolean and numeric values for the same habit.

You can write directives but omit the directive type, it will default to record.

Example:

2024-01-01 record "Read 5 pages a day" 5
2024-01-01 record "Workout" yes
2024-01-01 "Weight" 70.5

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

habits_txt-0.1.2.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

habits_txt-0.1.2-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file habits_txt-0.1.2.tar.gz.

File metadata

  • Download URL: habits_txt-0.1.2.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.8.9-arch1-2

File hashes

Hashes for habits_txt-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9d9785756012a65e1fcbe9109a4d6f31393690e98facd0f0083d1c282c85e204
MD5 3fc754a2c41f8f1b075b7dab7a60805b
BLAKE2b-256 6f73678d5b6dd6bff83dda96d32cf2e1c89ae6a601a271b4291263643498c7db

See more details on using hashes here.

File details

Details for the file habits_txt-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: habits_txt-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.8.9-arch1-2

File hashes

Hashes for habits_txt-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a17de2da24473469e1c99ee6e56f9890478918c12444bb368bc2bec9b8c5f9bb
MD5 c4c6de8b2f931e1173ea2161b2b51d8f
BLAKE2b-256 139e4e0db06e3fcb18339112b37058264fcbb41f359fbb13ed83a043afd532f8

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