Skip to main content

TDD engine for Analytics Engineering — generate unit test data for SQL queries

Project description

MockSQL — Backend

FastAPI + LangGraph + CLI

Ce dossier contient le cœur de MockSQL : l'API REST, le graph LangGraph de génération de données, le CLI, et le package mocksql-ui (serveur web + assets React).


Quickstart local

Prérequis : Python ≥ 3.11, Poetry ≥ 1.8, un projet Google Cloud avec la facturation activée.

1. Authentification Google Cloud

gcloud auth application-default login
gcloud config set project <PROJECT_ID>

2. Variables d'environnement

cp .env.example .env   # puis compléter les valeurs

Variables minimales requises :

PROJECT_ID=<votre-projet-gcp>
GOOGLE_CLOUD_PROJECT=<votre-projet-gcp>
BQ_SCHEMA_BILLING_PROJECT=<votre-projet-gcp>
DEFAULT_MODEL_NAME=gemini-2.0-flash-lite
DUCKDB_PATH=data/mocksql.duckdb
SECRET_KEY=<générer avec : python -c "import secrets; print(secrets.token_hex(32))">
API_SECRET_KEY=<idem>
FRONT_URL=http://127.0.0.1:3000

3. Installation & lancement

python -m venv .venv

# Linux / macOS
source .venv/bin/activate

# Windows
.\.venv\Scripts\activate

pip install poetry && poetry install

# Lancer le serveur
uvicorn server:app --port 8080 --reload

L'API est accessible sur http://localhost:8080, le frontend sur http://localhost:3000 (voir ../front/README.md).


Commandes de développement

make style    # ruff check + ruff format --check + vulture (code mort)
make format   # ruff format + ruff check --fix (auto-correction)
make test     # pytest
make check    # style + test

Type checking :

poetry run mypy build_query/ app/

Packaging

MockSQL produit deux wheels indépendants :

Wheel Contenu
mocksql-*.whl CLI + LangGraph core (sans UI)
mocksql_ui-*.whl Serveur web + assets React bundlés

Builder les wheels

# CLI uniquement
make build-cli

# CLI + UI (build React inclus — Node.js 18+ requis)
make build-ui

Les wheels sont générés dans dist/.

Lancer l'UI depuis les wheels

pip install dist/mocksql-*.whl dist/mocksql_ui-*.whl
mocksql ui              # http://localhost:8080/static/
mocksql ui --port 4000
mocksql ui --no-browser

Licence

Propriétaire — © 2025 Adel Skhiri. Contact : skhiriadel92@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mocksql-0.1.1.tar.gz (143.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mocksql-0.1.1-py3-none-any.whl (170.6 kB view details)

Uploaded Python 3

File details

Details for the file mocksql-0.1.1.tar.gz.

File metadata

  • Download URL: mocksql-0.1.1.tar.gz
  • Upload date:
  • Size: 143.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mocksql-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5f36a75cbc5bb25f5a40c33475058b6320f7785a1056871104113ce0e9bf1187
MD5 1e64a2dfcfdb26d53a00e1583f26e0bf
BLAKE2b-256 c4dad0fcb654dcdbb370d68ff20869a2df48ea625f52e43bd28a796f37a1f5df

See more details on using hashes here.

Provenance

The following attestation bundles were made for mocksql-0.1.1.tar.gz:

Publisher: release.yml on skadel/mocksql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mocksql-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mocksql-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 170.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mocksql-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2dfd227578d746a1daa7d738f6eaa2a2df84d6e94c1aaa2b39c90279edcc366d
MD5 087a4a34243b0c6e5af03420a853432f
BLAKE2b-256 b314d26f0de722b573e68685e3e767bd94db1a65097d012e2ad0c2e77502f1bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for mocksql-0.1.1-py3-none-any.whl:

Publisher: release.yml on skadel/mocksql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page