add conscience to weekly note
This commit is contained in:
parent
3ea550ce8a
commit
0ace572c6a
3 changed files with 37 additions and 10 deletions
26
weekly-review/scripts/last_weeks_conscience
Executable file
26
weekly-review/scripts/last_weeks_conscience
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env -S uv run --script
|
||||
# /// script
|
||||
# requires-python = ">=3.12"
|
||||
# dependencies = ["pymongo"]
|
||||
# ///
|
||||
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from pymongo import MongoClient
|
||||
|
||||
client = MongoClient(
|
||||
"mongodb://root:3wwfoUjyk2E2zWELXFlLuHqfw1ALlOp4pb2H5Vq3TImbMIHL2h1u8Jej2mjzCPl@docdb.connorrhodes.com:35563"
|
||||
)
|
||||
|
||||
seven_days_ago = datetime.now(timezone.utc) - timedelta(days=7)
|
||||
|
||||
results = client.notes.journal.find(
|
||||
{
|
||||
"tags": "examination_of_conscience",
|
||||
"created_at": {"$gte": seven_days_ago},
|
||||
}
|
||||
)
|
||||
|
||||
for doc in results:
|
||||
print(f"[{doc['created_at'].strftime('%Y-%m-%d %H:%M')}] {doc['note']}")
|
||||
|
||||
client.close()
|
||||
Loading…
Add table
Add a link
Reference in a new issue