Skip to main content

A rapid prototyping tool for generating containerized backend + frontend CRUD stacks from CSV/SQLite files.

Project description

Sirius-CLI

A rapid prototyping CLI tool designed to take multiple CSV files, Excel spreadsheets, a SQLite database, or a JSON configuration file as inputs, automatically infer their structural schemas and relationships, and generate:

  • A production-grade, container-ready FastAPI backend (with SQLAlchemy models, Pydantic v2 validation schemas, and automated Alembic migrations).
  • A modular, responsive, multi-page React 18 (TypeScript, Vite, Tailwind CSS) CRUD frontend with dynamic relational selectors and a beautiful Dashboard.

Key Capabilities

  • Automatic Relationship Mapping: Automatically extracts foreign keys from databases and resolves CSV/Excel associations using naming heuristics (linking [table]_id fields), navigating irregular English plurals effortlessly.
  • Auto-Seeding: Automatically seeds the generated database with the entries inside the source CSV/Excel files during migration (if using SQLite).
  • Relational Integrity: Generates dropdowns in the UI for foreign keys and displays badges that navigate to parent entities.
  • Enterprise Data Grid: The generated tables feature server-side searching (?search=), server-side column sorting (?order_by=), and dual data export buttons (CSV and Excel .xlsx).
  • Dashboard Analytics: A built-in Recharts dashboard showing live dataset distribution and entity insights.
  • Multiple Database Engines: Target SQLite for rapid local prototyping, or generate PostgreSQL and MySQL ready projects out of the box using --pg and --mysql.
  • Iterative Updates: Use sirius-update to safely inject new tables or columns into an existing scaffolded project.

Installation

Install the package directly from PyPI:

pip install sirius-cli

(For local development: clone the repository and run pip install -e .)


Usage: Creating a New Project (sirius-init)

1. Generating from CSVs or Excel

# From CSVs
sirius-init init store_system --csv examples/users.csv --csv examples/orders.csv --theme violet

# From Excel
sirius-init init store_system --excel examples/products.xlsx --theme amber

2. Target Production Databases

By default, the stack uses an embedded SQLite file (app.db). You can target Postgres or MySQL instead:

sirius-init init billing_system --config schema.json --pg

(The generated docker-compose.yml and database.py will expect a DATABASE_URL environment variable).

3. Generating from JSON Configuration

Specify database schemas, relationships, and colors in a JSON file:

{
  "project_name": "billing_system",
  "theme": "emerald",
  "entities": {
    "customers": {
      "columns": [
        { "name": "id",        "type": "Integer", "is_pk": true },
        { "name": "name",      "type": "String" },
        { "name": "email",     "type": "String" },
        { "name": "is_active", "type": "Boolean" }
      ]
    },
    "invoices": {
      "columns": [
        { "name": "id",          "type": "Integer", "is_pk": true },
        { "name": "ref_no",      "type": "String" },
        { "name": "amount",      "type": "Float" },
        { "name": "customer_id", "type": "Integer", "foreign_key": "customers.id" },
        { "name": "created_at", "type": "DateTime" }
      ]
    }
  }
}

Then run:

sirius-init init billing_system --config examples/billing-config.json

4. Generating with JWT Authentication

Pass the --auth flag to scaffold a secure project. This generates an app_users table, a beautiful Login screen, and protects all FastAPI routes with JWT Bearer tokens automatically.

sirius-init init secure_system --csv examples/users.csv --auth --admin-user "superadmin" --admin-pass "securepass123"

Usage: Updating an Existing Project (update)

If your data requirements change (e.g., adding a reviews table to your store), you don't need to start from scratch. Use the update command to merge new schemas into an existing project.

sirius-init update ./store_system --csv examples/new_reviews.csv

Sirius-CLI will:

  1. Regenerate your SQLAlchemy models and Pydantic schemas.
  2. Regenerate your frontend routing and CRUD views.
  3. Automatically run alembic revision --autogenerate and alembic upgrade head to apply the database migrations seamlessly.

All CLI Flags

sirius-init / sirius-update

Flag Short Default Description
--csv Path to a CSV file (repeatable)
--excel Path to an Excel .xlsx/.xls file (repeatable)
--db Path to a SQLite .db file
--config -c Path to a JSON config file
--theme -t blue Frontend color theme (blue, indigo, emerald, amber, rose, sky, violet)
--out -o . Output directory (only for init)
--port -p 8000 Backend port (used in Dockerfile, docker-compose, .env)
--api-url http://localhost:<port> Override the frontend VITE_API_URL
--no-seed false Skip seeding the DB from source CSV/Excel files
--auth false Generate JWT authentication logic and a React Login screen
--admin-user admin The default admin username to seed if --auth is enabled
--admin-pass admin The default admin password to seed if --auth is enabled
--pg false Generate Postgres connection pool and drivers
--mysql false Generate MySQL connection pool and drivers

Running the Scaffolded Stack

Using Docker Compose

cd <project_name>
docker compose up --build

Running Locally

  1. Start Backend:
    cd <project_name>/backend
    pip install -r requirements.txt
    uvicorn backend.main:app --reload --port 8000
    
  2. Start Frontend:
    cd <project_name>/frontend
    npm install
    npm run dev
    
    Open http://localhost:5173/ in your browser.

License & Commercial Use

Sirius-CLI is open-source and released under the GNU AGPLv3 License.

This is a strong copyleft license that ensures the project remains free and open. By using this software, you agree that any modifications or larger works incorporating this tool that are distributed or provided as a network service (SaaS) must also be open-sourced under the same AGPLv3 license.

Dual Licensing for Enterprise If your organization wishes to use Sirius-CLI in proprietary, closed-source software without being subject to the open-source requirements of the AGPLv3, a Commercial License is available for purchase. Please contact the maintainer for more details on enterprise licensing.

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

sirius_cli-0.2.2.tar.gz (43.4 kB view details)

Uploaded Source

Built Distribution

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

sirius_cli-0.2.2-py3-none-any.whl (49.8 kB view details)

Uploaded Python 3

File details

Details for the file sirius_cli-0.2.2.tar.gz.

File metadata

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

File hashes

Hashes for sirius_cli-0.2.2.tar.gz
Algorithm Hash digest
SHA256 0ccab6ced5de8362e3689a19801c77e2f00ab0ffd540a303c3bff156254f8c56
MD5 b2391e49c50585876dc9dad5d36f4217
BLAKE2b-256 dd5ceb5df323075db2bea0e19136921f0352d9c62c7dc893b75bee6af25cfd25

See more details on using hashes here.

Provenance

The following attestation bundles were made for sirius_cli-0.2.2.tar.gz:

Publisher: publish.yml on amineaith3/sirius-cli

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

File details

Details for the file sirius_cli-0.2.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for sirius_cli-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8ffc94ff22a6db1e267bb1c0cc688fbca0fc10b40946a48c622ec9a0f30f6c48
MD5 100686f4d062e1241cc4cc0682b2673f
BLAKE2b-256 63f3c47180890cda4a2d58bf199396ef78f9492661e53fb95820caa550ce60b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for sirius_cli-0.2.2-py3-none-any.whl:

Publisher: publish.yml on amineaith3/sirius-cli

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