Last active
December 31, 2024 23:52
-
-
Save afrolino02/8937a99dbe54c6041d853a96d011cab7 to your computer and use it in GitHub Desktop.
Gist para crear bullet journal en python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from datetime import datetime, timedelta | |
from xmlrpc.client import DateTime | |
import calendar | |
import locale | |
locale.setlocale(locale.LC_TIME, 'es_CO.UTF-8') | |
# Templates | |
# Función para crear carpetas y archivos | |
def create_note(path, filename, content): | |
# Crear directorios si no existen | |
if not os.path.exists(path): | |
os.makedirs(path) | |
# Crear archivo con el template | |
with open(os.path.join(path, filename), 'w') as file: | |
file.write(content) | |
# Función para generar las notas diarias dentro de las semanas | |
def generate_daily_notes_in_weeks(year, month): | |
base_path = f"./{year}/{year}-{month:02d} {datetime(year, month, 1).strftime('%B')}" | |
# Día inicial del mes | |
current_date = datetime(year, month, 1) | |
last_day = (current_date + timedelta(days=32)).replace(day=1) - timedelta(days=1) | |
week_num = 1 | |
fecha = datetime(year, month, datetime.now().day) | |
while current_date <= last_day: | |
date_str = current_date.strftime("%Y-%m-%d") | |
# Si es lunes, empezamos una nueva semana | |
if current_date.weekday() == 0 or current_date.day == 1: | |
week_name = f"SEMANA {week_num} DE {current_date.strftime('%B').upper()} DEL {year}" | |
weekly_template = f""" | |
# {week_name} | |
## Objetivos de la Semana | |
## Tareas | |
[[GTD SPACE]] | |
```tasks | |
path includes 01 Proyectos/GTD SPACE | |
filter by function task.urgency > 8.9999 | |
hide backlinks | |
not done | |
``` | |
## Eventos | |
## Notas | |
## Reflexión Semanal | |
- Lo mejor de la semana: | |
- Lo que puedo mejorar: | |
""" | |
week_path = os.path.join(base_path, week_name) | |
create_note(week_path, f"{week_name}.md", weekly_template) | |
week_num += 1 | |
# Crear la nota diaria dentro de la semana | |
daily_template = f"""--- | |
created: {date_str} | |
tags: | |
- Diario | |
--- | |
# **Diario - {date_str}** | |
## Tareas | |
```tasks | |
path includes 01 Proyectos/GTD SPACE | |
hide backlinks | |
not done | |
``` | |
[[GTD SPACE]]***si estoy en movil*** | |
## Que hare hoy? | |
- [ ] Aqui empiezo.. | |
# Notas | |
- | |
- | |
## Eventos | |
- | |
- | |
# Repetibles | |
## Pastillas | |
- [ ] 🌅 Pastilla de la mañana #pastillas | |
- [ ] 🏙️ Pastilla del medio día #pastillas | |
- [ ] 🌆 Pastilla de la tarde #pastillas | |
- [ ] 💊 Vitaminas #pastillas | |
## Habitos | |
- [ ] 💻 Minutos de Programación #habitos | |
- [ ] 📚 Minutos de Lectura #habitos | |
- [ ] 💪 Minutos de Ejercicio #habitos | |
- [ ] 📝 Minutos de Dibujo #habitos | |
- [ ] 🎸 Minutos de Guitarra y piano #habitos | |
- [ ] ✖️ Minutos de Matematicas #habitos | |
- [ ] 🧘♂️ Minutos de Meditacion #habitos | |
## Me paro de la cama | |
- [ ] bajar ropa 🔼 🔁 | |
- [ ] Bañarme 🔼 🔁 | |
- [ ] Organizar mesa del computador 🔼 🔁 | |
- [ ] arreglar cama 🔼 🔁 | |
# Vasos de agua | |
Numero de vasos🥛: | |
### Analisis de emociones final del dia | |
# | |
- [ ] Anki en la mañana | |
- [ ] Anki en la tarde | |
### **Emociones** | |
[Escribe tus emociones aquí] | |
calidadEmociones:: 🟥🟩🟨 | |
--- | |
### **Ideas** | |
[Escribe tus ideas aquí] | |
calidadIdeas:: 🟥🟩🟨 | |
--- | |
### **Sentimientos** | |
[Describe tus sentimientos aquí] | |
calidadSentimientos::🟥🟩🟨 | |
--- | |
### **Acciones** | |
[Describe las acciones importantes del día] | |
calidadAcciones:: 🟥🟩🟨 | |
--- | |
### **Logros** | |
[Escribe los logros alcanzados] | |
calidadLogros:: 🟥🟩🟨 | |
--- | |
### **Puntaje Diario** | |
- **Concentración:** | |
[Escribe tu nivel de concentración] | |
- **Emociones positivas:** | |
[Describe las emociones positivas] | |
- **Emociones negativas:** | |
[Describe las emociones negativas] | |
- **Sentimientos positivos:** | |
[Describe los sentimientos positivos] | |
- **Sentimientos negativos:** | |
[Describe los sentimientos negativos] | |
- **Calidad del día:** | |
[Evalúa la calidad de tu día] | |
puntajeConcentracion:: | |
calidadEmocionesPositivas:: 🟥🟩🟨 | |
calidadEmocionesNegativas:: 🟥🟩🟨 | |
calidadSentimientosPositivos:: 🟥🟩🟨 | |
calidadSentimientosNegativos:: 🟥🟩🟨 | |
puntajeCalidadDia:: | |
--- | |
### **9:00 AM - 12:00 PM** | |
**Actividad:** | |
[Escribe aquí la actividad realizada] | |
**Cómo me sentí:** | |
calidadMañana:: 🟥🟩🟨 | |
**Descripción:** | |
[Describe cómo te sentiste y qué sucedió] | |
**Observaciones:** | |
[Escribe detalles adicionales] | |
--- | |
### **12:00 PM - 6:00 PM** | |
**Actividad:** | |
[Escribe aquí la actividad realizada] | |
**Cómo me sentí:**: | |
calidadTarde:: 🟥🟩🟨 | |
**Descripción:** | |
[Describe cómo te sentiste y qué sucedió] | |
**Observaciones:** | |
[Escribe detalles adicionales] | |
--- | |
### **Reflexión del día** | |
**¿Qué fue lo mejor de hoy?** | |
[Escribe lo que más te gustó] | |
calidadReflexionMejor:: 🟥🟩🟨 | |
**¿Qué fue lo más difícil?** | |
[Escribe lo que te costó más] | |
calidadReflexionDificil:: 🟥🟩🟨 | |
**¿Qué puedo mejorar para mañana?** | |
[Escribe algo que quieras mejorar] | |
calidadMejorar:: 🟥🟩🟨 | |
""" | |
create_note(week_path, f"{date_str}.md", daily_template) | |
# Avanzar al siguiente día | |
current_date += timedelta(days=1) | |
# Función para generar la nota mensual | |
def generate_monthly_note(year, month): | |
month_name = f"{year}-{month:02d} {datetime(year, month, 1).strftime('%B')}" | |
mes = month | |
monthly_template = f""" | |
# Mes: {month_name} | |
## Objetivos del Mes | |
- [ ] Objetivo 1 | |
- [ ] Objetivo 2 | |
## Tareas Importantes | |
## Eventos | |
- Evento 1 | |
- Evento 2 | |
## Hábitos a Seguir | |
```tracker | |
searchType: task.done, task.done, task.done, task.done | |
searchTarget: Minutos de Programación, Minutos de Lectura, Minutos de Ejercicio, Minutos de Meditacion | |
datasetName: Programacion, Leer, Ejercicio | |
folder: /01 Proyectos/Diario/{year}/{month_name} | |
fixedScale: 2 | |
month: | |
mode: annotation | |
startWeekOn: 'Mon' | |
color: orange | |
headerMonthColor: orange | |
dimNotInMonth: false | |
annotation: 💻, 📚, 🏋️, 🧘 | |
showAnnotationOfAllTargets: true | |
showTodayRing: true | |
circleColorByValue: true | |
initMonth: {year}-{month:02d} | |
``` | |
## Como me he sentido | |
```dataview | |
TABLE calidadEmociones as "Calidad de emociones", calidadIdeas as "Calidad de idea", calidadSentimientos as "Calidad de Sentimientos" | |
FROM "01 Proyectos/Diario/{year}/{month_name}" | |
SORT file.name ASC | |
``` | |
##### Puntaje diario | |
```dataview | |
TABLE puntajeConcentracion as "P. de concentrasion", calidadEmocionesPositivas as "Emociones positivas", calidadEmocionesNegativas as "Emociones negativas", calidadSentimientosPositivos as "Sentimientos negativas", | |
puntajeCalidadDia as "Puntaje Calidad de Dia" | |
FROM "01 Proyectos/Diario/{year}/{month_name}" | |
SORT file.name ASC | |
``` | |
## Notas | |
- Nota 1 | |
- Nota 2 | |
## Reflexión Mensual | |
- Logros del mes: | |
- Áreas de mejora: | |
""" | |
base_path = f"./{year}/{year}-{month:02d} {datetime(year, month, 1).strftime('%B')}" | |
monthly_note_content = monthly_template.replace("<% tp.date.now(\"YYYY-MM-DD\") %>", f"{year}-{month:02d}-01") | |
create_note(base_path, f"{month_name}.md", monthly_template) | |
# Función principal para generar todas las notas | |
def generate_bullet_journal(year, month): | |
# Generar notas | |
generate_monthly_note(year, month) | |
generate_daily_notes_in_weeks(year, month) | |
# Llamada al script | |
generate_bullet_journal(2024, 11) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment