Metadata-Version: 2.4
Name: azure77
Version: 0.1.0
Summary: Upload, query and manage data on Azure SQL Server from Python
Author: 77 Indicadores
License-Expression: MIT
Keywords: azure,sql,database,upload,data
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyodbc>=4.0.30
Requires-Dist: python-dotenv>=0.19
Requires-Dist: unidecode>=1.3
Requires-Dist: chardet>=5.0
Requires-Dist: openpyxl>=3.1
Requires-Dist: xlrd>=2.0
Requires-Dist: click>=8.0
Requires-Dist: rich>=12.0
Dynamic: license-file

# azure77

Upload, query and manage data on Azure SQL Server from Python.

## Installation

```bash
pip install azure77
```

## Quick Start

```python
from azure77 import ConnectionManager

# Connect to Azure SQL
cm = ConnectionManager(
    server="your-server.database.windows.net",
    database="your-db",
    user="your-user",
    password="your-pass",
)

# Test connection
result = cm.test_connection()
print(result.success, result.message)
```

## Features

- **Connection management** — Azure SQL via pyodbc or pymssql
- **Client/schema organization** — each client maps to a SQL schema
- **File upload** — CSV, XLSX, XLS with auto encoding/detection
- **Column normalization** — lowercase, accent-free, SQL-safe names
- **Type inference** — automatic INTEGER, DECIMAL, DATE, NVARCHAR
- **SQL query execution** — with safety validation (blocks DROP, DELETE, etc.)
- **Query history** — stored in local SQLite
- **Dataset browsing** — metadata, import logs, schema diff
- **Benchmark** — measure upload performance across strategies

## CLI

```bash
azure77 connection test          # Test Azure SQL connection
azure77 connection status        # Show config status
azure77 client list              # List clients
azure77 client create "Nome"     # Create client
azure77 upload preview file.csv  # Preview file
azure77 upload import file.csv --client adl --table vendas
azure77 datasets list adl        # List datasets
azure77 benchmark run file.csv   # Run benchmark
```

## Configuration

Create a `.env` file:

```
AZURE77_SERVER=server.database.windows.net
AZURE77_DATABASE=dbname
AZURE77_USER=username
AZURE77_PASSWORD=password
```

Or pass directly:

```python
cm = ConnectionManager(
    server="...",
    database="...",
    user="...",
    password="...",
    driver="pymssql",  # or "pyodbc"
)
```

## License

MIT
