agnes-the-ai-analyst/scripts
ZdenekSrotyr b502bd8bdd refactor: delete old sync pipeline — 9,500 lines removed
Phase 5 cleanup: remove all code replaced by extract.duckdb architecture.

Deleted modules:
- src/config.py (653) — replaced by DuckDB table_registry
- src/parquet_manager.py (755) — replaced by DuckDB COPY TO
- src/data_sync.py (734) — replaced by SyncOrchestrator
- src/remote_query.py (636) — replaced by DuckDB BigQuery ATTACH
- src/table_registry.py (464) — replaced by DuckDB repository
- connectors/keboola/adapter.py (820) — replaced by extractor.py
- connectors/bigquery/adapter.py (665) — replaced by extractor.py
- connectors/bigquery/client.py (644) — replaced by DuckDB BQ extension

Updated all imports in webapp, catalog_export, enricher, router,
sync_settings_service, generate_sample_data. Kept keboola/client.py
as fallback (removed src.config dependency).

704 tests passing.
2026-03-31 07:50:37 +02:00
..
activate_venv.sh Initial commit: OSS data distribution platform 2026-03-08 23:31:28 +01:00
backfill_gap.sh Extract Jira into connectors/jira module 2026-03-09 11:17:50 +01:00
collect_session.py Initial commit: OSS data distribution platform 2026-03-08 23:31:28 +01:00
dev_run.py Merge dev_scripts/ into scripts/ 2026-03-09 13:11:36 +01:00
duckdb_manager.py Fix: duckdb_manager CONFIG_DIR support for server deployment 2026-03-21 11:40:55 +01:00
generate_sample_data.py refactor: delete old sync pipeline — 9,500 lines removed 2026-03-31 07:50:37 +02:00
generate_user_sync_configs.py Initial commit: OSS data distribution platform 2026-03-08 23:31:28 +01:00
init.sh Initial commit: OSS data distribution platform 2026-03-08 23:31:28 +01:00
migrate_json_to_duckdb.py feat: add JSON to DuckDB migration script with tests 2026-03-27 15:09:06 +01:00
migrate_parquets_to_extracts.py feat: add migration scripts for extract.duckdb transition 2026-03-30 20:21:12 +02:00
migrate_registry_to_duckdb.py feat: add migration scripts for extract.duckdb transition 2026-03-30 20:21:12 +02:00
README.md Merge dev_scripts/ into scripts/ 2026-03-09 13:11:36 +01:00
remote_query.sh Fix remote_query.sh: use analyst-readable env file 2026-03-21 11:59:57 +01:00
setup_views.sh Initial commit: OSS data distribution platform 2026-03-08 23:31:28 +01:00
standalone_profiler.py Add standalone DuckDB-based data profiler script 2026-03-11 15:12:04 +01:00
sync_config_template.yaml Initial commit: OSS data distribution platform 2026-03-08 23:31:28 +01:00
sync_data.sh Remove hardcoded Jira/Keboola references from sync_data.sh 2026-03-15 01:02:37 +01:00
test_sync.sh Merge dev_scripts/ into scripts/ 2026-03-09 13:11:36 +01:00
update.sh Initial commit: OSS data distribution platform 2026-03-08 23:31:28 +01:00

Scripts

Helper scripts for working with AI Data Analyst project.

These scripts are synced from the server into server/scripts/ on the analyst's machine.

Available Scripts

setup_views.sh

Initialize or refresh DuckDB views on Parquet files.

bash server/scripts/setup_views.sh

sync_data.sh

Synchronize data from server, upload user files, and refresh DuckDB.

# Recommended: update scripts first, then sync
rsync -avz data-analyst:server/scripts/ ./server/scripts/   # Linux/macOS
scp -r data-analyst:server/scripts/* ./server/scripts/      # Windows fallback
bash server/scripts/sync_data.sh

# Other options:
bash server/scripts/sync_data.sh --dry-run  # Preview what would be synced (no changes)
bash server/scripts/sync_data.sh --push     # Only upload user/ to server

What sync does:

  1. Self-update check - detects if sync_data.sh changed, asks to re-run if so
  2. Downloads server/docs/, server/scripts/, server/metadata/ from server
  3. Updates CLAUDE.md from latest template
  4. Downloads server/parquet/ data files (with --delete to remove old files)
  5. Uploads user/ directory to server (backup, no --delete)
  6. Syncs Python environment to server
  7. Validates DuckDB - if corrupted, deletes and recreates from parquets
  8. Reinitializes DuckDB views (CREATE OR REPLACE VIEW for all tables)

Self-update mechanism: The script checks its own checksum before and after syncing scripts. If it detects it was updated, it exits with a message asking you to run sync again. This ensures you always run the latest sync logic.

DuckDB corruption recovery: If DuckDB file is corrupted (e.g., interrupted sync), it's automatically detected and recreated. All data is safe in parquet files - DuckDB only contains VIEW definitions.

Development Scripts

dev_run.py

Flask development server with authentication bypass for local testing.

python3 scripts/dev_run.py

Starts a local Flask server at http://127.0.0.1:5000 with:

  • Auth bypass routes (/dev-login, /dev-catalog) - no OAuth required
  • Debug mode with hot reload

test_sync.sh

Test rsync reliability with the data server.

bash scripts/test_sync.sh           # Full test sync
bash scripts/test_sync.sh --dry-run # Preview only

Typical Workflow

  1. First time setup: Follow bootstrap.yaml instructions
  2. Before analysis: Sync latest data
    bash server/scripts/sync_data.sh
    
  3. Analyze: Use DuckDB database at user/duckdb/analytics.duckdb