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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mocksql-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 124f4a3012fc8fdd988b72ee419e3fad0c117e09b813dfb91318d9362546c177
MD5 84f35e714fe1d9a6dd10904bb803bf78
BLAKE2b-256 0f395de41424d5bbf5c9091ae9dbe977145d5fcceac7c871a6afbf53bbd16b5c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: mocksql-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6ba433387dafb041783b2edd7cc9e4b5dad2c8e162c4d7faf6d3866b1966edf8
MD5 37e16eb95b7dceb9bdeefe6315562aad
BLAKE2b-256 0aee240723f1ee4c7f7ce4638cf7114f028b67603ac19cd7d3643c089d4951ea

See more details on using hashes here.

Provenance

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