Metadata-Version: 2.1
Name: odbc2deltalake
Version: 0.2.2
Summary: 
License: MIT
Author: Adrian Ehrsam
Author-email: adrian.ehrsam@bmsuisse.ch
Requires-Python: >=3.10,<4.0
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
Requires-Dist: adlfs (>=2024.2.0,<2025.0.0)
Requires-Dist: arrow-odbc (>=4.1.0,<5.0.0)
Requires-Dist: azure-identity (>=1.15.0,<2.0.0)
Requires-Dist: azure-storage-file-datalake (>=12.14.0,<13.0.0)
Requires-Dist: deltalake (>=0.16.0)
Requires-Dist: deltalake2db (>=0.1.8)
Requires-Dist: duckdb (>=0.10.0)
Requires-Dist: pydantic (>=2.6.3,<3.0.0)
Requires-Dist: pyodbc (>=5.1.0,<6.0.0)
Description-Content-Type: text/markdown

# ODBC 2 Deltalake

This is a package that supports reading from ODBC and writing to a scd2 DeltaTable. The delta table will always have the following "system" cols:

- \_\_timestamp : The Date of the Load
- \_\_is_deleted : True for a deletion of a record
- \_\_is_full_load : True if it was a full load, meaning an implicit deletion of not delivered records

Currently, this package is focused very much on Microsoft SQL Server. But it should not be too hard to add support for other DB Systems.

This packages handles delta's based on MS-SQL's "timestamp"/"rowversion" DataType or based on Temporal Tables. Other methods will be added later on. It does detect updates to records
that happened differently, eg if a restore happened in the source.

## Usage

It's as simple as this:

```python
from odbc2deltalake import write_db_to_delta

await write_db_to_delta(
    your_onnection_string,
    (your_db_schema, your_table_name),
    Path("YOUR_TARGET_PATH")
)
```

