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.2.tar.gz (2.4 MB 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.2-py3-none-any.whl (2.4 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mocksql-0.1.2.tar.gz
Algorithm Hash digest
SHA256 91d3e6a391fc1b31ea01b2d7f5ce56cf9fd0b905fc0942f5804e26929b01a80a
MD5 f60209d4b57b33e7f26013f53266f6f6
BLAKE2b-256 585c3827111d418e2bbf11f83d437cad7ea2dcab3543317d2b0550ffc5999457

See more details on using hashes here.

Provenance

The following attestation bundles were made for mocksql-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: mocksql-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 2.4 MB
  • 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 04cf122b7c0ae9a87a1b65ed5561888008d7ccdd34ef13c750231c30176a9966
MD5 088679b8d09a0eb24572f56c2916e14e
BLAKE2b-256 dec1a2e060ff4959b76eacc85663d7b9eb6a91e739e60990cfed03250a050bcc

See more details on using hashes here.

Provenance

The following attestation bundles were made for mocksql-0.1.2-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