Giter Site home page Giter Site logo

py-five-minute-journal's Introduction

The Python Five Minute Journal

A simple Python application inspired by The Five Minute Journal - Intelligent Change.

Python Five Minute Journal Cover

Read the article featured on Hashnode

brignoni.dev/the-python-five-minute-journal


Requirements

  • Python >=3.7
  • pip
  • requests
  • python-dotenv==0.21.0
  • Jinja2==3.1.2

Installation

pip install -r requirements.txt

Start your daily Five Minute Journal

In the morning run the command. Running it again in the evening will give you a different set of questions.

python3 journal.py

Your journal markdown files will be saved in the journals directory.

2022/5MJ-2022-12-31.md
2023/5MJ-2023-01-01.md
2023/5MJ-2023-01-02.md
2023/5MJ-2023-01-02.md
2023/5MJ-2023-01-04.md
2023/5MJ-2023-01-05.md

The Markdown file.

Five Minute Journal | Wednesday, Jan 18 2023

> Dwell on the beauty of life. Watch the stars, and see yourself running with them.
> 
> ~ Marcus Aurelius, Meditations

---
07:55 AM

### I am grateful for...
1. My family
2. My incredible friends
3. The warm bed that a sleep in

### What would make today great?
1. Walk around the park
2. Go to the coffeeshop
3. Publish this blog article

### Daily affirmations
1. I traveled to Portugal
2. I am grateful for everything I have
3. I am a better Software Engineer than yesterday

---
09:05 PM

### Highlights of the day
1. Had breakfast with family
2. Met a friend at the coffeeshop
3. Practiced Portuguese with my language partner

### What did I learn today?
1. New Portuguese vocabulary
2. Completed an AWS hands-on lab
3. Studied for AWS Certified SysOps Admin Associate

Environment Variables

To customize some behaviors, copy the .env.example file and rename it to .env. For example, you can set the locale to Portuguese.

# .env
LOCALE=pt

These are the available variables.

# .env.example
LOCALE=en
TITLE="Five Minute Journal"
NAMESPACE="5MJ"
DEFAULT_ANSWER_COUNT=3
HEADER_TEMPLATE="header-template.md"
QUESTION_TEMPLATE="question-template.md"
OUTPUT_DIR="journals"

Available Locales

  • en - English. (Default)
  • es - Spanish.
  • it - Italian. Thanks @dariocast
  • pt - Portuguese.
  • sv - Swedish. Thanks @SambhaviPD

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Contributing a locale

  1. Copy the locale template locales/journal.[locale].yml.
  2. Substitute the placeholders and translations.
  3. Send a pull request.
# locales/journal.pt.yml
pt:
  title: Diário de Cinco Minutos
  complete: Já está completo!
  saved: O diário de hoje foi salvo
  questions:
    i_am_grateful_for: Estou agradecido por...
    what_would_make_today_great: O que é que hoje em dia seria óptimo?
    daily_affirmations: Afirmações diárias
    highlights_of_the_day: Destaques do dia
    what_did_i_learn_today: O que é que aprendi hoje?

License

MIT

py-five-minute-journal's People

Contributors

bam92 avatar brignoni avatar dariocast avatar sambhavipd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

py-five-minute-journal's Issues

PackageLoader exception

When I run the application, I get:

Traceback (most recent call last):
  File "/Users/dariocastellano/Projects/py-five-minute-journal/journal.py", line 37, in <module>
    main()
  File "/Users/dariocastellano/Projects/py-five-minute-journal/journal.py", line 16, in main
    storage = MarkdownStorageProvider(
  File "/Users/dariocastellano/Projects/py-five-minute-journal/providers/MarkdownStorageProvider.py", line 15, in __init__
    loader=PackageLoader('journal', dir),
  File "/Users/dariocastellano/Projects/py-five-minute-journal/venv/lib/python3.9/site-packages/jinja2/loaders.py", line 323, in __init__
    raise ValueError(
ValueError: The 'journal' package was not installed in a way that PackageLoader understands.

It seems an error on package loader but they assure they fixed it. I report here but I don't know how to solve at the moment. If I come out with a fix I will PR it

Packaging the code and running it like a Python module

Hey @brignoni,

Great initiative!

Have you thought about packaging the code using pyproject.toml?
I recently learned about it and it's great for running the python code as a module (from anywhere in the terminal).

If so, please let me know, happy to contribute!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.