Metadata-Version: 2.4
Name: SchemaLens-Exillar
Version: 0.1.0
Summary: CLI tool that reads a database schema and generates documentation using an LLM.
License-Expression: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: openai>=1.92.0
Requires-Dist: tiktoken>=0.7.0
Requires-Dist: networkx>=3.3
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pydantic>=2.7.0
Requires-Dist: mmdc==0.4.1
Requires-Dist: cairosvg>=2.9.0
Requires-Dist: pillow>=9.2.0
Requires-Dist: openpyxl>=3.1.5
Requires-Dist: python-docx>=1.1
Provides-Extra: postgres
Requires-Dist: psycopg2-binary>=2.9.9; extra == "postgres"
Provides-Extra: mysql
Requires-Dist: mysql-connector-python>=8.0; extra == "mysql"
Provides-Extra: sqlserver
Requires-Dist: pyodbc>=5.0; extra == "sqlserver"
Provides-Extra: snowflake
Requires-Dist: snowflake-connector-python>=3.0; extra == "snowflake"
Provides-Extra: databricks
Requires-Dist: databricks-sql-connector>=4.0; extra == "databricks"
Provides-Extra: databricks-oauth
Requires-Dist: databricks-sdk>=0.18.0; extra == "databricks-oauth"
Provides-Extra: mongodb
Requires-Dist: pymongo>=4.9; extra == "mongodb"
Provides-Extra: all
Requires-Dist: psycopg2-binary>=2.9.9; extra == "all"
Requires-Dist: mysql-connector-python>=8.0; extra == "all"
Requires-Dist: pyodbc>=5.0; extra == "all"
Requires-Dist: snowflake-connector-python>=3.0; extra == "all"
Requires-Dist: databricks-sql-connector>=4.0; extra == "all"
Requires-Dist: databricks-sdk>=0.18.0; extra == "all"
Requires-Dist: pymongo>=4.9; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=8.2.0; extra == "dev"
Requires-Dist: ruff>=0.4.0; extra == "dev"
Requires-Dist: mypy>=1.10.0; extra == "dev"
Dynamic: license-file

# SchemaLens-Exillar — Quick Start Guide

CLI tool that connects to a database (PostgreSQL, MySQL, SQL Server, Snowflake,
Databricks, or MongoDB), reads the schema, and uses an LLM to generate
documentation automatically. No frontend. No manual input beyond a one-time
setup wizard.

## Requirements

1. Python 3.11 or newer
2. Internet access — to install the package, connect to your database, and call OpenAI
3. Your database credentials (host, username, password, etc.)
4. An OpenAI API key ([platform.openai.com](https://platform.openai.com)) — you're billed by OpenAI directly for usage
5. **SQL Server only**: an ODBC Driver for SQL Server installed on your machine (not installed by pip — [download here](https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server))
6. **Linux only**, for diagram PNG export: `libcairo2` system package (`sudo apt install libcairo2`)

## Step-by-step

### 1. Create a virtual environment (recommended and required)

Don't install directly into your system Python — always use a virtual environment to avoid conflicts with other packages.

```bash
python -m venv venv
```

Activate it:
- Windows: `venv\Scripts\activate`
- Mac/Linux: `source venv/bin/activate`

### 2. Install (pick the extra matching your database)

```bash
pip install SchemaLens-Exillar[postgres]
```

Options: `[postgres]`, `[mysql]`, `[sqlserver]`, `[snowflake]`, `[databricks]`, `[mongodb]`, or `[all]` for every driver.

### 3. Run

```bash
SchemaLens-Exillar
```

### 4. Answer the wizard's questions

- Pick your database type (enter the number)
- Choose to paste a full connection string, or enter host/port/username/password one by one
- (Optional) Type specific schema names to limit scope, or press Enter to document everything
- Enter your OpenAI API key — never saved, asked fresh every run
- Choose where to save the output (press Enter for current folder)

### 5. Wait for it to finish

You'll see a simple progress line per batch of tables being processed.

### 6. Open your files

Three files are created in the folder you chose:

- `er_diagram_<yourdatabase>.html` — interactive diagram, open in any browser
- `schema_documentation_<yourdatabase>.xlsx` — Excel workbook with full column descriptions
- `Suggestion_Report_<yourdatabase>.docx` — suggested keys/relationships for review

Run it again anytime — older files are never overwritten, each run adds a number + timestamp.

Each new session, reactivate the venv first (`venv\Scripts\activate` / `source venv/bin/activate`) before running `SchemaLens-Exillar` again.

**Note:** nothing is ever saved to disk — no `.env` file, no saved password, no saved API key. You'll enter your credentials fresh every time you run it.

## License

MIT — see [LICENSE](LICENSE).
