Metadata-Version: 2.4
Name: sqlalchemy-excel
Version: 0.1.1
Summary: SQLAlchemy dialect for Excel files — use Excel as a database
Project-URL: Homepage, https://github.com/yeongseon/sqlalchemy-excel
Project-URL: Repository, https://github.com/yeongseon/sqlalchemy-excel
Project-URL: Issues, https://github.com/yeongseon/sqlalchemy-excel/issues
Author: Yeongseon Choe
License: MIT
License-File: LICENSE
Keywords: database,dialect,excel,openpyxl,sqlalchemy
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
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 :: Office/Business :: Financial :: Spreadsheet
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: excel-dbapi>=0.1.1
Requires-Dist: sqlalchemy>=2.0
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# sqlalchemy-excel

SQLAlchemy dialect for Excel files — use Excel as a database.

```python
from sqlalchemy import create_engine, Column, Integer, String
from sqlalchemy.orm import DeclarativeBase, Session, Mapped, mapped_column

engine = create_engine("excel:///data.xlsx")

class Base(DeclarativeBase):
    pass

class User(Base):
    __tablename__ = "Sheet1"
    id: Mapped[int] = mapped_column(primary_key=True)
    name: Mapped[str] = mapped_column()

Base.metadata.create_all(engine)

with Session(engine) as session:
    session.add(User(id=1, name="Alice"))
    session.commit()

with Session(engine) as session:
    users = session.query(User).all()
```

## Installation

```bash
pip install sqlalchemy-excel
```

## URL Format

```python
# Relative path
engine = create_engine("excel:///data.xlsx")

# Absolute path (note four slashes)
engine = create_engine("excel:////home/user/data.xlsx")
```

## Features

- Full SQLAlchemy 2.0 dialect
- PEP 249 DB-API 2.0 compliant driver ([excel-dbapi](https://github.com/yeongseon/excel-dbapi))
- SELECT with WHERE, ORDER BY, LIMIT
- INSERT, UPDATE, DELETE
- CREATE TABLE / DROP TABLE
- ORM support with `DeclarativeBase`
- Type mapping: String, Integer, Float, Boolean, Date, DateTime

## Limitations

- No JOIN, GROUP BY, HAVING, DISTINCT, OFFSET
- No subqueries, CTEs, or aggregate functions
- No ALTER TABLE, foreign keys, or indexes
- Single-table operations only

## License

MIT
