dlt-altertable
Load data into Altertable with dlt.
Install and configure
Requires Python 3.12+ and dlt >= 1.30, < 2.
uv add dlt-altertable
Set .dlt/secrets.toml:
[destination.altertable]
host = "api.altertable.ai"
catalog = "lakehouse"
dataset_name = "crm"
username = "..."
password = "..."
Use the HTTP API host. Defaults: HTTPS, port 443, compute size XS.
Set dataset_name on the destination; dlt's pipeline setting is ignored.
The catalog must exist; schemas are created automatically.
Settings also accept dlt environment variables (DESTINATION__ALTERTABLE__HOST, etc.),
existing ALTERTABLE_* credentials, or arguments to altertable(...).
Use
import dlt
from dlt_altertable import altertable
@dlt.resource(
name="contacts",
write_disposition="merge",
primary_key="id",
columns={"lastmodifieddate": {"dedup_sort": "desc"}},
)
def contacts():
yield [
{"id": 1, "email": "ada@example.com", "lastmodifieddate": 100},
{"id": 2, "email": "grace@example.com", "lastmodifieddate": 100},
]
pipeline = dlt.pipeline(pipeline_name="crm", destination=altertable)
pipeline.run(contacts())
Loading
| Disposition | Behavior |
|---|---|
append |
Adds rows. |
replace |
Recreates the table, then appends subsequent files. |
merge |
Upserts by primary_key; omitted columns keep their values. |
Merge requires a non-nullable primary key. In the example, dedup_sort keeps the highest
lastmodifieddate per id, comparing incoming and stored rows. delete-insert, insert-only, scd2,
merge_key, hard_delete, and ascending dedup_sort are unsupported.
New columns are added automatically. Nested objects and lists are stored as JSON strings.
Each file is atomic; a whole load is not. Replacement recreates the table on its first file, then
appends the rest. Retried appends can duplicate rows. Do not set
LOAD__PARALLELISM_STRATEGY=parallel: replacement requires sequential files per table.
Configure file rotation with dlt's
DATA_WRITER__FILE_MAX_ITEMS,
which sets a row-count threshold. Arrow batches can exceed it, so it is not a hard upload limit.
Read and verify
from dlt_altertable import verify_catalog, verify_load
rows = pipeline.dataset().contacts.limit(10).fetchall()
print(verify_catalog())
print(verify_load(pipeline))
Verification helpers return a list of problems; [] means none found.
For Arrow inputs with append or merge, set
NORMALIZE__PARQUET_NORMALIZER__ADD_DLT_LOAD_ID=true before loading to use verify_load.
Reads buffer results in memory. Use .arrow() for Arrow or .df() for pandas.
Operational notes
- Fresh runners restore incremental state with the same pipeline name, catalog, and schema.
Persist
pipelines_dirto resume unfinished loads. - Keep the one-hour upload timeout: a timed-out request can still complete on the server.
Develop
uv run --locked pytest
uv run --locked ruff check .
uv run --locked ruff format --check .
uvx ty check src
Run HTTP integration tests against altertable-mock:
docker run --rm -d --name dlt-altertable-mock -p 127.0.0.1:15100:15000 \
-e ALTERTABLE_MOCK_USERS=integration:integration \
ghcr.io/altertable-ai/altertable-mock:latest
DLT_ALTERTABLE_INTEGRATION=1 uv run --locked pytest tests/integration
docker stop dlt-altertable-mock
Metadata
Release files for dlt-altertable 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dlt_altertable-0.1.5.tar.gz | 18.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dlt_altertable-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.3 kB
Release files / dlt_altertable-0.1.5.tar.gz
| Download URL | dlt_altertable-0.1.5.tar.gz |
|---|---|
| Size | 18.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49efb856ad7f864000b755544bd5c70356abffd2c84133bfda244d751d9e58cf
|
|
BLAKE2b-256 checksum How to use checksums |
db02b9c4f420262c71f2818dc13bc88ba0c273f8a1a3a4732a75b9178a9d993c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / dlt_altertable-0.1.5-py3-none-any.whl
| Download URL | dlt_altertable-0.1.5-py3-none-any.whl |
|---|---|
| Size | 22.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c2afef97d48a8fa5311ffff5c78ec884c113900de3dccd2b041d8382f653bd64
|
|
BLAKE2b-256 checksum How to use checksums |
ccb2ef64bc9fe65ce5de9c94520fee2ffa9e68c3763682ecf812511464112fd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency log