SQLAlchemy dialect for Excel files — use Excel as a database
Project description
sqlalchemy-excel
SQLAlchemy dialect for Excel files — use Excel as a database.
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
pip install sqlalchemy-excel
URL Format
# 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)
- 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sqlalchemy_excel-0.1.1.tar.gz.
File metadata
- Download URL: sqlalchemy_excel-0.1.1.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81de0a5073527d41cc363959d906f05ed13bb5d7e5d54390e324e73a1679722a
|
|
| MD5 |
d373cf1c8f56fdea500ed6a0cfc3d01b
|
|
| BLAKE2b-256 |
d1b58550b7bea8605e116162d1b3987406855453059324cabc7bf849a361094f
|
Provenance
The following attestation bundles were made for sqlalchemy_excel-0.1.1.tar.gz:
Publisher:
publish-pypi.yml on yeongseon/sqlalchemy-excel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sqlalchemy_excel-0.1.1.tar.gz -
Subject digest:
81de0a5073527d41cc363959d906f05ed13bb5d7e5d54390e324e73a1679722a - Sigstore transparency entry: 1280494332
- Sigstore integration time:
-
Permalink:
yeongseon/sqlalchemy-excel@e91ba9926f9bb5d2be79e34fe72e504960f29908 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/yeongseon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e91ba9926f9bb5d2be79e34fe72e504960f29908 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sqlalchemy_excel-0.1.1-py3-none-any.whl.
File metadata
- Download URL: sqlalchemy_excel-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa80ccb3426fb7c69f8076850f95b0cfdb593dd71ba94bb82c216af64064a4ff
|
|
| MD5 |
d00363cce3528db56f25f37befb3c7fc
|
|
| BLAKE2b-256 |
3e5a690fd7956c46c3db53f7a73bf8c0eecc4d1aff04c1051c4f6d5b4f340b8a
|
Provenance
The following attestation bundles were made for sqlalchemy_excel-0.1.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on yeongseon/sqlalchemy-excel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sqlalchemy_excel-0.1.1-py3-none-any.whl -
Subject digest:
aa80ccb3426fb7c69f8076850f95b0cfdb593dd71ba94bb82c216af64064a4ff - Sigstore transparency entry: 1280494336
- Sigstore integration time:
-
Permalink:
yeongseon/sqlalchemy-excel@e91ba9926f9bb5d2be79e34fe72e504960f29908 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/yeongseon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e91ba9926f9bb5d2be79e34fe72e504960f29908 -
Trigger Event:
release
-
Statement type: