Metadata-Version: 2.4
Name: pyjournaling
Version: 1.0.1
Summary: An encrypted, colorful terminal journal
Author-email: Ty Strong <megaman12122121@gmail.com>
License: MIT
Keywords: journal,diary,terminal,cli,encrypted
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: bcrypt>=4.0
Requires-Dist: cryptography>=44.0
Requires-Dist: python-dotenv>=1.0
Requires-Dist: rich>=13.0
Dynamic: license-file

# PyJournal

An encrypted, password-protected terminal journal written in Python and
distributed through PyPI.

- **PyPI:** [pyjournaling](https://pypi.org/project/pyjournaling/)
- **Install:** `pipx install pyjournaling`
- **Command:** `pyjournal`

## Features

- Local encryption at rest using Fernet authenticated encryption
- Password-based key derivation with PBKDF2-SHA256
- Random master key that is stored only in encrypted form
- One-time recovery code for resetting a forgotten password
- Password changes without re-encrypting every journal entry
- Rich terminal interface with built-in and custom themes
- Entry creation, reading, counting, and password-confirmed deletion
- Cross-platform data directory under `~/.pyjournal/`

## Security model

```text
password       -> PBKDF2-SHA256 -> wrapping key -> decrypts master key
recovery code  -> PBKDF2-SHA256 -> wrapping key -> decrypts master key
                                                     |
                                                     v
                                            encrypts journal entries
```

PyJournal stores salts, a password-verification hash, and encrypted copies of
the master key in `~/.pyjournal/.env`. The plaintext master key is not written
to disk by the application. Journal confidentiality therefore depends on the
strength of the password or recovery code and the security of the local
computer. PyJournal has not undergone an independent security audit and should
not be treated as a replacement for professionally audited secret-management
software.

## Installation

### Recommended: pipx

```bash
pipx install pyjournaling
pyjournal
```

Upgrade an existing installation with:

```bash
pipx upgrade pyjournaling
```

### Development setup

```bash
git clone https://github.com/Tystr12/PyJournal.git
cd PyJournal
python -m venv .venv
```

Activate the environment:

```bash
# macOS/Linux
source .venv/bin/activate

# Windows PowerShell
.venv\Scripts\Activate.ps1
```

Install and run the project:

```bash
pip install -r requirements.txt
python journal.py
```

## Usage

```bash
pyjournal                   # launch the journal
pyjournal --reset-password  # recover access using the recovery code
```

On first launch, PyJournal asks you to create a password and displays a
recovery code once. Store the recovery code somewhere safe. If both the
password and recovery code are lost, the journal entries cannot be recovered.

### Menu options

| Option | Action |
|---:|---|
| 1 | Create a journal entry |
| 2 | Read previous entries |
| 3 | Exit |
| 4 | Show all options |
| 5 | Change password |
| 6 | Change display name |
| 7 | Delete an entry |
| 8 | About PyJournal |
| 9 | Change theme |

## Data location

All user data is stored under `~/.pyjournal/`:

| File | Contents |
|---|---|
| `.env` | Salts, verification hash, preferences, and encrypted master-key blobs |
| `something.txt` | Encrypted journal entries |
| `saves.txt` | Entry count |

Set `JOURNAL_DOTENV_PATH` to use a different configuration and data location.

## Technology

- Python
- `cryptography` and Fernet
- PBKDF2-SHA256
- bcrypt
- Rich
- python-dotenv

## License

Licensed under the [MIT License](LICENSE).
