update shutdown skill for examination of conscience
This commit is contained in:
parent
6d41e0596d
commit
3ea550ce8a
2 changed files with 45 additions and 7 deletions
30
shutdown-routine/scripts/add_improvement_journal_entry
Executable file
30
shutdown-routine/scripts/add_improvement_journal_entry
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env -S uv run --script
|
||||
|
||||
# /// script
|
||||
# requires-python = ">=3.12"
|
||||
# dependencies = ["pymongo"]
|
||||
# ///
|
||||
|
||||
import sys
|
||||
from datetime import datetime, timezone
|
||||
from pymongo import MongoClient
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print("usage: ./add_note.py <note text>")
|
||||
sys.exit(1)
|
||||
|
||||
client = MongoClient(
|
||||
"mongodb://root:3wwfoUjyk2E2zWELXFlLuHqfw1ALlOp4pb2H5Vq3TImbMIHL2h1u8Jej2mjzCPl@docdb.connorrhodes.com:35563"
|
||||
)
|
||||
db = client["notes"]
|
||||
col = db["journal"]
|
||||
|
||||
doc = {
|
||||
"note": sys.argv[1],
|
||||
"tags": ["examination-of-conscience"],
|
||||
"created_at": datetime.now(timezone.utc),
|
||||
}
|
||||
|
||||
result = col.insert_one(doc)
|
||||
print(f"inserted {result.inserted_id}")
|
||||
client.close()
|
||||
Loading…
Add table
Add a link
Reference in a new issue