cloudbrain-modules 1.0.1__py3-none-any.whl → 1.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,97 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Initialize La AI Familio Database
4
+ Creates tables and inserts sample data
5
+ """
6
+
7
+ import sqlite3
8
+ import sys
9
+ from pathlib import Path
10
+
11
+
12
+ def init_familio_db():
13
+ """Initialize the La AI Familio database"""
14
+
15
+ # Paths
16
+ project_root = Path(__file__).parent.parent.parent
17
+ db_path = project_root / "server" / "ai_db" / "cloudbrain.db"
18
+ schema_path = Path(__file__).parent / "familio_schema.sql"
19
+
20
+ # Check if database exists
21
+ if not db_path.exists():
22
+ print(f"❌ Database not found: {db_path}")
23
+ print("Please start the CloudBrain server first to create the database.")
24
+ return False
25
+
26
+ # Check if schema exists
27
+ if not schema_path.exists():
28
+ print(f"❌ Schema file not found: {schema_path}")
29
+ return False
30
+
31
+ # Read schema
32
+ print(f"📖 Reading schema from: {schema_path}")
33
+ with open(schema_path, 'r') as f:
34
+ schema_sql = f.read()
35
+
36
+ # Connect to database
37
+ print(f"🔗 Connecting to database: {db_path}")
38
+ conn = sqlite3.connect(db_path)
39
+ conn.row_factory = sqlite3.Row
40
+ cursor = conn.cursor()
41
+
42
+ try:
43
+ # Execute schema
44
+ print("🚀 Creating La AI Familio tables...")
45
+ cursor.executescript(schema_sql)
46
+
47
+ # Verify tables created
48
+ cursor.execute("""
49
+ SELECT name FROM sqlite_master
50
+ WHERE type='table' AND name LIKE '%'
51
+ ORDER BY name
52
+ """)
53
+ tables = cursor.fetchall()
54
+
55
+ # Filter out FTS tables and show only main tables
56
+ main_tables = [t for t in tables if not t[0].endswith('_fts')]
57
+
58
+ print(f"\n✅ La AI Familio tables created ({len(main_tables)} tables):")
59
+ for table in main_tables:
60
+ print(f" - {table[0]}")
61
+
62
+ # Verify sample data
63
+ cursor.execute("SELECT COUNT(*) as count FROM magazines")
64
+ magazine_count = cursor.fetchone()[0]
65
+
66
+ cursor.execute("SELECT COUNT(*) as count FROM novels")
67
+ novel_count = cursor.fetchone()[0]
68
+
69
+ cursor.execute("SELECT COUNT(*) as count FROM documentaries")
70
+ documentary_count = cursor.fetchone()[0]
71
+
72
+ print(f"\n📊 Sample data inserted:")
73
+ print(f" - Magazines: {magazine_count}")
74
+ print(f" - Novels: {novel_count}")
75
+ print(f" - Documentaries: {documentary_count}")
76
+
77
+ # Commit changes
78
+ conn.commit()
79
+
80
+ print("\n" + "=" * 70)
81
+ print("🎉 La AI Familio database initialized successfully!")
82
+ print("=" * 70)
83
+
84
+ return True
85
+
86
+ except Exception as e:
87
+ print(f"\n❌ Error initializing La AI Familio database: {e}")
88
+ conn.rollback()
89
+ return False
90
+
91
+ finally:
92
+ conn.close()
93
+
94
+
95
+ if __name__ == "__main__":
96
+ success = init_familio_db()
97
+ sys.exit(0 if success else 1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudbrain-modules
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: CloudBrain Modules - AI blog and community platform features
5
5
  Author: CloudBrain Team
6
6
  License: MIT
@@ -0,0 +1,15 @@
1
+ cloudbrain_modules/README.md,sha256=bi7qmiAZrEDyB6k6SD0jhYr4jZ3UWtZTJENEVLJyQo4,6224
2
+ cloudbrain_modules/__init__.py,sha256=8jDikoNA3QN4XKefkyxjCjKhgIb4qdzTrFg83MBfirA,325
3
+ cloudbrain_modules/ai_blog/__init__.py,sha256=SB5jVG_7ZJ_NBg4BAanVCflUrxZe28k9a4rIO4qUpRQ,363
4
+ cloudbrain_modules/ai_blog/ai_blog_client.py,sha256=7teFnIgJlk6VyHPSyh08sxSfymLiorP6tiNu3RfWiX8,7398
5
+ cloudbrain_modules/ai_blog/blog_api.py,sha256=-tTzlr4b5GWl5IZz1CLr3BPQSoNS2qoRY6_-FKf-K2I,19765
6
+ cloudbrain_modules/ai_blog/init_blog_db.py,sha256=S-McxhQoIcsvde94ZfQw7grjZtwyHvc_Y8ZZMXW-ToY,2488
7
+ cloudbrain_modules/ai_blog/test_ai_blog_client.py,sha256=853LiaUgwHrf6ks_euso2K5AGjLFHTeRKnLhsFoCeQg,7728
8
+ cloudbrain_modules/ai_blog/test_blog_api.py,sha256=4QMJ-QYFESXKGJrYZKDJ58TowTwXjZgivxEQRYONfvg,6323
9
+ cloudbrain_modules/ai_familio/__init__.py,sha256=iOIyE-OxwNWKgudMC49P8yWHw0pOHRlgv_osHunws9c,351
10
+ cloudbrain_modules/ai_familio/familio_api.py,sha256=P3wOxaCUUHYklOM-sQF-yw7dLEiFV2aAIqlwOoZtswI,22498
11
+ cloudbrain_modules/ai_familio/init_familio_db.py,sha256=EgNVZRCBOMaeT5r5ynZsfQ_ChsCJBWqL2Wfcj1NaKBc,2907
12
+ cloudbrain_modules-1.0.2.dist-info/METADATA,sha256=W_dFKcsf_NDB-fiHGYpMP2dwXBGFmCXPL23GPdcZhHU,6768
13
+ cloudbrain_modules-1.0.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
14
+ cloudbrain_modules-1.0.2.dist-info/top_level.txt,sha256=vz8vwYHDGFIUYV-fIjGOR5c0zS1rhRxsu6oPDnRQCgQ,19
15
+ cloudbrain_modules-1.0.2.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- cloudbrain_modules/README.md,sha256=bi7qmiAZrEDyB6k6SD0jhYr4jZ3UWtZTJENEVLJyQo4,6224
2
- cloudbrain_modules/__init__.py,sha256=8jDikoNA3QN4XKefkyxjCjKhgIb4qdzTrFg83MBfirA,325
3
- cloudbrain_modules-1.0.1.dist-info/METADATA,sha256=F0lLSECAmrYg7DSk-DfyOXf_NW-ybD0my10raseUweI,6768
4
- cloudbrain_modules-1.0.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
5
- cloudbrain_modules-1.0.1.dist-info/top_level.txt,sha256=vz8vwYHDGFIUYV-fIjGOR5c0zS1rhRxsu6oPDnRQCgQ,19
6
- cloudbrain_modules-1.0.1.dist-info/RECORD,,