Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /ViperJuice_Code-Index-MCP /scripts /find_populated_indexes.py
| #!/usr/bin/env python3 | |
| """Find populated indexes.""" | |
| import sqlite3 | |
| from pathlib import Path | |
| indexes_path = Path(".indexes") | |
| populated = [] | |
| for repo_dir in indexes_path.iterdir(): | |
| if repo_dir.is_dir(): | |
| db_path = repo_dir / "current.db" | |
| if db_path.exists(): | |
| try: | |
| conn = sqlite3.connect(str(db_path)) | |
| cursor = conn.cursor() | |
| # Check file count | |
| cursor.execute("SELECT COUNT(*) FROM files WHERE language IS NOT NULL") | |
| count = cursor.fetchone()[0] | |
| if count > 0: | |
| # Get language stats | |
| cursor.execute(""" | |
| SELECT language, COUNT(*) as cnt | |
| FROM files | |
| WHERE language IS NOT NULL | |
| GROUP BY language | |
| ORDER BY cnt DESC | |
| LIMIT 5 | |
| """) | |
| languages = cursor.fetchall() | |
| populated.append({ | |
| "repo_id": repo_dir.name, | |
| "file_count": count, | |
| "top_languages": languages | |
| }) | |
| conn.close() | |
| except Exception as e: | |
| pass | |
| # Sort by file count | |
| populated.sort(key=lambda x: x["file_count"], reverse=True) | |
| print("\nPopulated indexes found:") | |
| print("="*80) | |
| for idx in populated[:10]: # Show top 10 | |
| print(f"\nRepo ID: {idx['repo_id']}") | |
| print(f"Files: {idx['file_count']}") | |
| print("Top languages:") | |
| for lang, count in idx['top_languages']: | |
| print(f" - {lang}: {count} files") | |
| print(f"\nTotal populated indexes: {len(populated)}") |
Xet Storage Details
- Size:
- 1.81 kB
- Xet hash:
- 7ce0456d871af3bc955606c6e462fc5340bb1eeefec64ba041e300a9ac8ab5eb
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.