import json
import os
from datetime import date, datetime
import matplotlib.pyplot as plt
from collections import defaultdict
DATA_FILE = "u_infinitely_logs.json"
def load_logs():
if os.path.exists(DATA_FILE):
try:
with open(DATA_FILE, "r") as f:
return json.load(f)
except:
return []
return []
def save_logs(logs):
with open(DATA_FILE, "w") as f:
json.dump(logs, f, indent=2)
def log_entry():
today = str(
date.today())
print("\n=== U-Infinitely Daily Biome Report ===")
print("Date:", today)
visual = input("\nVisual (Bristol type e.g. 3-4, color, notes): ").strip()
smell = input("Smell (mild / strong / foul / other): ").strip()
feel = input("Feel / Energy / Mood after (good / crash / bloated / focused / etc.): ").strip()
inputs = input("\nKey Inputs today (food, hydration, exercise, stress, thoughts/meditation): ").strip()
work_mindset = input("Work behavior note (e.g. hell yeah empire mode / had to grind): ").strip()
performance = input("Overall performance (calls, focus, family, energy): ").strip()
score = input("\nOverall daily report score (1-10): ").strip()
try:
score = int(score)
except:
score = 5 # default neutral
entry = {
"date": today,
"timestamp":
datetime.now().isoformat(),
"visual": visual,
"smell": smell,
"feel": feel,
"inputs": inputs,
"work_mindset": work_mindset,
"performance": performance,
"overall_score": score
}
logs = load_logs()
logs.append(entry)
save_logs(logs)
print(f"\n✅ Logged to U-Infinitely. Score: {score}/10")
print("Keep iterating. Check your shit → Adjust → Repeat.")
def view_logs(limit=10):
logs = load_logs()
if not logs:
print("No logs yet. Run log_entry() first.")
return
print(f"\n=== Last {limit} U-Infinitely Entries ===")
for entry in sorted(logs, key=lambda x: x["date"], reverse=True)[:limit]:
print(f"\n{entry['date']} | Score: {entry.get('overall_score', 'N/A')}/10")
print(f" Visual: {entry.get('visual', '')}")
print(f" Smell: {entry.get('smell', '')}")
print(f" Feel: {entry.get('feel', '')}")
if entry.get('work_mindset'):
print(f" Work Mindset: {entry['work_mindset']}")
def plot_trends():
logs = load_logs()
if len(logs) < 2:
print("Need at least 2 entries for trends.")
return
logs = sorted(logs, key=lambda x: x["date"])
dates = [entry["date"] for entry in logs]
scores = [entry.get("overall_score", 5) for entry in logs]
plt.figure(figsize=(10, 6))
plt.plot(dates, scores, marker='o', linestyle='-', color='blue', label='Daily Score')
plt.title('U-Infinitely - Regeneration & Alignment Trend')
plt.xlabel('Date')
plt.ylabel('Overall Report Score (1-10)')
plt.xticks(rotation=45)
plt.grid(True)
plt.legend()
plt.tight_layout()
plt.show()
# Simple average
avg = sum(scores) / len(scores)
print(f"\nAverage score over {len(scores)} days: {avg:.1f}/10")
def main():
print("U-Infinitely - Biome & Life Alignment Tracker")
print("Immortality through persistent recurrence\n")
while True:
print("\nOptions:")
print("1. Log today's report")
print("2. View recent logs")
print("3. Show trend plot")
print("4. Exit")
choice = input("\nChoose (1-4): ").strip()
if choice == "1":
log_entry()
elif choice == "2":
view_logs()
elif choice == "3":
plot_trends()
elif choice == "4":
print("Keep coding better results. Stay infinite.")
break
else:
print("Invalid choice.")
if __name__ == "__main__":
main()