Astro-Yogi-Baba-24

Diamond Research Phase 2-3 (Import + API)

This folder contains:

Prerequisites

Setup

  1. Create and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activate
  1. Install dependencies
pip install -r requirements.txt
  1. Create a local .env
cp .env.example .env

Edit .env and set DATABASE_URL.

Phase 2: Import (data-only)

By default the importer is data-only. Do not pass --include-non-data.

Recommended first run (applies schema + clears existing sheet_records + imports + verifies):

python3 diamond_research_phase2_import.py --apply-schema --replace --with-row-meta --smoke-check

Phase 3: API Server

Start the FastAPI server:

.venv/bin/uvicorn api_main:app --host 127.0.0.1 --port 8000 --reload

Or simply:

.venv/bin/python api_main.py

API Endpoints

Interactive Docs

Open http://127.0.0.1:8000/docs for Swagger UI.

Useful Import Options

python3 diamond_research_phase2_import.py --apply-schema --replace --with-row-meta --smoke-check --sheets "Sheet1,Sheet2"

Expected Files

The importer defaults to these files in the same folder: