due-extractor 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- due_extractor-0.3.1/.github/workflows/ci.yml +45 -0
- due_extractor-0.3.1/.github/workflows/live.yml +24 -0
- due_extractor-0.3.1/.github/workflows/release.yml +73 -0
- due_extractor-0.3.1/.gitignore +32 -0
- due_extractor-0.3.1/LICENSE +191 -0
- due_extractor-0.3.1/PKG-INFO +180 -0
- due_extractor-0.3.1/README.md +91 -0
- due_extractor-0.3.1/connectors/due_project.yaml +70 -0
- due_extractor-0.3.1/connectors/sources/countries.yaml +22 -0
- due_extractor-0.3.1/connectors/sources/dneonline.yaml +22 -0
- due_extractor-0.3.1/connectors/sources/dummyjson.yaml +12 -0
- due_extractor-0.3.1/connectors/sources/ecb.yaml +22 -0
- due_extractor-0.3.1/connectors/sources/github.yaml +31 -0
- due_extractor-0.3.1/connectors/sources/hackernews.yaml +27 -0
- due_extractor-0.3.1/connectors/sources/jsonplaceholder.yaml +12 -0
- due_extractor-0.3.1/connectors/sources/nasa_apod.yaml +15 -0
- due_extractor-0.3.1/connectors/sources/nyc311.yaml +17 -0
- due_extractor-0.3.1/connectors/sources/openmeteo.yaml +17 -0
- due_extractor-0.3.1/connectors/sources/pokeapi.yaml +13 -0
- due_extractor-0.3.1/connectors/sources/restcountries.yaml +16 -0
- due_extractor-0.3.1/connectors/sources/rickandmorty.yaml +12 -0
- due_extractor-0.3.1/connectors/sources/stackexchange.yaml +14 -0
- due_extractor-0.3.1/connectors/sources/usgs.yaml +28 -0
- due_extractor-0.3.1/connectors/sources/wikipedia.yaml +25 -0
- due_extractor-0.3.1/docs/DUE_PLAN.md +467 -0
- due_extractor-0.3.1/docs/adr/ADR-001-declarative-spec.md +24 -0
- due_extractor-0.3.1/docs/adr/ADR-002-commit-protocol.md +26 -0
- due_extractor-0.3.1/docs/adr/ADR-003-streaming.md +19 -0
- due_extractor-0.3.1/docs/adr/ADR-004-async-io.md +20 -0
- due_extractor-0.3.1/docs/adr/ADR-005-fsspec-storage.md +31 -0
- due_extractor-0.3.1/docs/adr/ADR-006-state-in-lake.md +27 -0
- due_extractor-0.3.1/docs/adr/ADR-007-immutable-raw-zone.md +22 -0
- due_extractor-0.3.1/docs/adr/ADR-008-ui-thin-editor.md +22 -0
- due_extractor-0.3.1/docs/adr/ADR-009-small-core-extras.md +41 -0
- due_extractor-0.3.1/docs/adr/ADR-010-delegated-scheduling.md +19 -0
- due_extractor-0.3.1/docs/adr/ADR-011-no-hardcoding.md +21 -0
- due_extractor-0.3.1/docs/adr/README.md +17 -0
- due_extractor-0.3.1/docs/design/HLD.md +374 -0
- due_extractor-0.3.1/docs/design/LLD.md +442 -0
- due_extractor-0.3.1/docs/design/REVIEW_LOG.md +71 -0
- due_extractor-0.3.1/docs/design/SPEC_V1.md +407 -0
- due_extractor-0.3.1/docs/design/SPEC_V1_FIELDS.md +364 -0
- due_extractor-0.3.1/docs/design/UI_WIREFRAMES.md +153 -0
- due_extractor-0.3.1/pyproject.toml +118 -0
- due_extractor-0.3.1/src/due/__init__.py +16 -0
- due_extractor-0.3.1/src/due/_brand.py +14 -0
- due_extractor-0.3.1/src/due/cli/__init__.py +1 -0
- due_extractor-0.3.1/src/due/cli/main.py +610 -0
- due_extractor-0.3.1/src/due/decode/__init__.py +169 -0
- due_extractor-0.3.1/src/due/decode/formats.py +152 -0
- due_extractor-0.3.1/src/due/decode/select.py +63 -0
- due_extractor-0.3.1/src/due/decode/xmlsel.py +133 -0
- due_extractor-0.3.1/src/due/defaults.yaml +185 -0
- due_extractor-0.3.1/src/due/errors.py +169 -0
- due_extractor-0.3.1/src/due/hooks.py +66 -0
- due_extractor-0.3.1/src/due/http/__init__.py +7 -0
- due_extractor-0.3.1/src/due/http/auth.py +252 -0
- due_extractor-0.3.1/src/due/http/circuit.py +61 -0
- due_extractor-0.3.1/src/due/http/client.py +313 -0
- due_extractor-0.3.1/src/due/http/clock.py +39 -0
- due_extractor-0.3.1/src/due/http/limits.py +55 -0
- due_extractor-0.3.1/src/due/http/ratelimit.py +128 -0
- due_extractor-0.3.1/src/due/http/request.py +71 -0
- due_extractor-0.3.1/src/due/http/retry.py +49 -0
- due_extractor-0.3.1/src/due/lake/__init__.py +1 -0
- due_extractor-0.3.1/src/due/lake/keyindex.py +83 -0
- due_extractor-0.3.1/src/due/lake/layout.py +75 -0
- due_extractor-0.3.1/src/due/lake/lock.py +83 -0
- due_extractor-0.3.1/src/due/lake/store.py +286 -0
- due_extractor-0.3.1/src/due/lake/ulid.py +25 -0
- due_extractor-0.3.1/src/due/lake/writer.py +302 -0
- due_extractor-0.3.1/src/due/paginate/__init__.py +248 -0
- due_extractor-0.3.1/src/due/preview.py +128 -0
- due_extractor-0.3.1/src/due/run/__init__.py +1 -0
- due_extractor-0.3.1/src/due/run/planner.py +194 -0
- due_extractor-0.3.1/src/due/run/prune.py +82 -0
- due_extractor-0.3.1/src/due/run/records.py +144 -0
- due_extractor-0.3.1/src/due/run/runner.py +1055 -0
- due_extractor-0.3.1/src/due/secrets/__init__.py +6 -0
- due_extractor-0.3.1/src/due/secrets/dotenv.py +38 -0
- due_extractor-0.3.1/src/due/secrets/refs.py +58 -0
- due_extractor-0.3.1/src/due/secrets/resolver.py +149 -0
- due_extractor-0.3.1/src/due/sources/__init__.py +275 -0
- due_extractor-0.3.1/src/due/sources/window.py +132 -0
- due_extractor-0.3.1/src/due/spec/catalog.py +502 -0
- due_extractor-0.3.1/src/due/spec/loader.py +589 -0
- due_extractor-0.3.1/src/due/spec/merge.py +68 -0
- due_extractor-0.3.1/src/due/spec/models.py +1022 -0
- due_extractor-0.3.1/src/due/spec/params.py +102 -0
- due_extractor-0.3.1/src/due/spec/templating.py +126 -0
- due_extractor-0.3.1/src/due/spec/validate.py +167 -0
- due_extractor-0.3.1/src/due/spec/yamlio.py +117 -0
- due_extractor-0.3.1/src/due/units.py +92 -0
- due_extractor-0.3.1/tests/__init__.py +0 -0
- due_extractor-0.3.1/tests/conftest.py +52 -0
- due_extractor-0.3.1/tests/live/__init__.py +0 -0
- due_extractor-0.3.1/tests/live/test_connectors_live.py +47 -0
- due_extractor-0.3.1/tests/live/test_httpbin_chaos.py +106 -0
- due_extractor-0.3.1/tests/live/test_run_live.py +43 -0
- due_extractor-0.3.1/tests/unit/__init__.py +0 -0
- due_extractor-0.3.1/tests/unit/test_catalog_params.py +289 -0
- due_extractor-0.3.1/tests/unit/test_cli.py +156 -0
- due_extractor-0.3.1/tests/unit/test_extract.py +641 -0
- due_extractor-0.3.1/tests/unit/test_hardcoding_lint.py +36 -0
- due_extractor-0.3.1/tests/unit/test_http.py +668 -0
- due_extractor-0.3.1/tests/unit/test_loader.py +344 -0
- due_extractor-0.3.1/tests/unit/test_m4.py +454 -0
- due_extractor-0.3.1/tests/unit/test_run.py +435 -0
- due_extractor-0.3.1/tests/unit/test_secrets_templating.py +147 -0
- due_extractor-0.3.1/tests/unit/test_units_merge_yaml.py +115 -0
- due_extractor-0.3.1/tools/check_hardcoding.py +66 -0
- due_extractor-0.3.1/tools/gen_field_reference.py +16 -0
- due_extractor-0.3.1/uv.lock +3390 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# DUE CI · by Abhishek Manjunatha
|
|
2
|
+
# Quality gates (NFR7, NFR9): format, lint, strict types, no hard-coding, tests + coverage, sample specs valid.
|
|
3
|
+
name: CI
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
branches: [main]
|
|
8
|
+
pull_request:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: ci-${{ github.ref }}
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
checks:
|
|
19
|
+
name: ${{ matrix.os }} · py${{ matrix.python }}
|
|
20
|
+
runs-on: ${{ matrix.os }}
|
|
21
|
+
strategy:
|
|
22
|
+
fail-fast: false
|
|
23
|
+
matrix:
|
|
24
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
25
|
+
python: ["3.12", "3.14"]
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v7
|
|
28
|
+
- uses: astral-sh/setup-uv@v10.4.0
|
|
29
|
+
with:
|
|
30
|
+
python-version: ${{ matrix.python }}
|
|
31
|
+
enable-cache: true
|
|
32
|
+
- name: Install (core + dev tools, locked)
|
|
33
|
+
run: uv sync --locked --group dev
|
|
34
|
+
- name: Format
|
|
35
|
+
run: uv run ruff format --check src tests tools
|
|
36
|
+
- name: Lint
|
|
37
|
+
run: uv run ruff check src tests tools
|
|
38
|
+
- name: Types (mypy strict)
|
|
39
|
+
run: uv run mypy src tools
|
|
40
|
+
- name: No hard-coding (ADR-011)
|
|
41
|
+
run: uv run python tools/check_hardcoding.py
|
|
42
|
+
- name: Tests + coverage (>= 85%)
|
|
43
|
+
run: uv run pytest --cov
|
|
44
|
+
- name: Sample specs are valid
|
|
45
|
+
run: uv run due validate connectors
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# DUE live tests · by Abhishek Manjunatha
|
|
2
|
+
# Real public APIs (plan §7). Nightly and on demand; never blocks pull requests.
|
|
3
|
+
name: Live
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
schedule:
|
|
7
|
+
- cron: "17 3 * * *"
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
live:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v7
|
|
18
|
+
- uses: astral-sh/setup-uv@v10.4.0
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.12"
|
|
21
|
+
enable-cache: true
|
|
22
|
+
- run: uv sync --locked --group dev
|
|
23
|
+
- name: Live chaos tests (httpbin)
|
|
24
|
+
run: uv run pytest -m live -v
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# DUE release · by Abhishek Manjunatha
|
|
2
|
+
# Publishes to PyPI with trusted publishing (OIDC): GitHub proves the workflow's identity to PyPI,
|
|
3
|
+
# so no API token is stored anywhere. PyPI side: a (pending) publisher for project `due-extractor`,
|
|
4
|
+
# repository abhishekmanjunatha/due, workflow `release.yml`, environment `pypi`.
|
|
5
|
+
name: Release
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
tags: ["v*"]
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
inputs:
|
|
12
|
+
tag:
|
|
13
|
+
description: "Existing tag to publish, e.g. v0.3.0"
|
|
14
|
+
required: true
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
build:
|
|
21
|
+
name: Build and check
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v7
|
|
25
|
+
with:
|
|
26
|
+
ref: ${{ inputs.tag || github.ref }}
|
|
27
|
+
- uses: astral-sh/setup-uv@v10.4.0
|
|
28
|
+
with:
|
|
29
|
+
python-version: "3.12"
|
|
30
|
+
- name: Tag matches the package version
|
|
31
|
+
env:
|
|
32
|
+
TAG: ${{ inputs.tag || github.ref_name }}
|
|
33
|
+
run: |
|
|
34
|
+
version=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
|
|
35
|
+
if [ "v$version" != "$TAG" ]; then
|
|
36
|
+
echo "tag $TAG does not match pyproject version $version"; exit 1
|
|
37
|
+
fi
|
|
38
|
+
- name: Gates (locked)
|
|
39
|
+
run: |
|
|
40
|
+
uv sync --locked --group dev
|
|
41
|
+
uv run ruff check src tests tools
|
|
42
|
+
uv run mypy src tools
|
|
43
|
+
uv run python tools/check_hardcoding.py
|
|
44
|
+
uv run pytest --cov
|
|
45
|
+
- name: Build sdist and wheel
|
|
46
|
+
run: uv build
|
|
47
|
+
- name: Smoke-test the wheel in a clean environment
|
|
48
|
+
run: |
|
|
49
|
+
uv venv /tmp/smoke
|
|
50
|
+
uv pip install --python /tmp/smoke/bin/python dist/*.whl
|
|
51
|
+
/tmp/smoke/bin/due --version
|
|
52
|
+
/tmp/smoke/bin/due validate connectors
|
|
53
|
+
- uses: actions/upload-artifact@v7.0.2
|
|
54
|
+
with:
|
|
55
|
+
name: dist
|
|
56
|
+
path: dist/
|
|
57
|
+
if-no-files-found: error
|
|
58
|
+
|
|
59
|
+
publish:
|
|
60
|
+
name: Publish to PyPI
|
|
61
|
+
needs: build
|
|
62
|
+
runs-on: ubuntu-latest
|
|
63
|
+
environment:
|
|
64
|
+
name: pypi
|
|
65
|
+
url: https://pypi.org/project/due-extractor/
|
|
66
|
+
permissions:
|
|
67
|
+
id-token: write # trusted publishing only; nothing else
|
|
68
|
+
steps:
|
|
69
|
+
- uses: actions/download-artifact@v8.0.2
|
|
70
|
+
with:
|
|
71
|
+
name: dist
|
|
72
|
+
path: dist/
|
|
73
|
+
- uses: pypa/gh-action-pypi-publish@v1.14.3
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
.venv/
|
|
5
|
+
.pytest_cache/
|
|
6
|
+
.mypy_cache/
|
|
7
|
+
.ruff_cache/
|
|
8
|
+
.coverage
|
|
9
|
+
coverage.xml
|
|
10
|
+
htmlcov/
|
|
11
|
+
dist/
|
|
12
|
+
build/
|
|
13
|
+
*.egg-info/
|
|
14
|
+
|
|
15
|
+
# Secrets: never commit
|
|
16
|
+
.env
|
|
17
|
+
.env.*
|
|
18
|
+
!.env.example
|
|
19
|
+
|
|
20
|
+
# DUE runtime output from local runs
|
|
21
|
+
/lake/
|
|
22
|
+
connectors/lake/
|
|
23
|
+
|
|
24
|
+
# Legacy bk-pipeline code + its old git history (contains a leaked webhook). Local reference only.
|
|
25
|
+
legacy/
|
|
26
|
+
|
|
27
|
+
# Private keys and credentials: never commit
|
|
28
|
+
*.ppk
|
|
29
|
+
*.pem
|
|
30
|
+
*.key
|
|
31
|
+
id_rsa*
|
|
32
|
+
id_ed25519*
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
Copyright 2026 Abhishek Manjunatha
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
+
See the License for the specific language governing permissions and
|
|
191
|
+
limitations under the License.
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: due-extractor
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: DUE: Declarative Universal Extractor. Extract from any API into your data lake with no custom scripts.
|
|
5
|
+
Project-URL: Homepage, https://github.com/abhishekmanjunatha/due
|
|
6
|
+
Project-URL: Repository, https://github.com/abhishekmanjunatha/due
|
|
7
|
+
Project-URL: Changelog, https://github.com/abhishekmanjunatha/due/blob/main/docs/DUE_PLAN.md
|
|
8
|
+
Author: Abhishek Manjunatha
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: api,cdc,data-engineering,data-lake,elt,extraction
|
|
12
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Topic :: Database
|
|
19
|
+
Requires-Python: >=3.12
|
|
20
|
+
Requires-Dist: defusedxml>=0.7
|
|
21
|
+
Requires-Dist: fsspec>=2024.6
|
|
22
|
+
Requires-Dist: httpx>=0.27
|
|
23
|
+
Requires-Dist: jinja2>=3.1
|
|
24
|
+
Requires-Dist: jmespath>=1.0
|
|
25
|
+
Requires-Dist: pydantic>=2.8
|
|
26
|
+
Requires-Dist: pyyaml>=6.0
|
|
27
|
+
Requires-Dist: typer>=0.12
|
|
28
|
+
Provides-Extra: all
|
|
29
|
+
Requires-Dist: adlfs>=2024.4; extra == 'all'
|
|
30
|
+
Requires-Dist: azure-identity>=1.17; extra == 'all'
|
|
31
|
+
Requires-Dist: azure-keyvault-secrets>=4.8; extra == 'all'
|
|
32
|
+
Requires-Dist: backports-zstd>=1.0; (python_version < '3.14') and extra == 'all'
|
|
33
|
+
Requires-Dist: boto3>=1.34; extra == 'all'
|
|
34
|
+
Requires-Dist: duckdb>=1.0; extra == 'all'
|
|
35
|
+
Requires-Dist: fastavro>=1.9; extra == 'all'
|
|
36
|
+
Requires-Dist: gcsfs>=2024.6; extra == 'all'
|
|
37
|
+
Requires-Dist: google-cloud-secret-manager>=2.20; extra == 'all'
|
|
38
|
+
Requires-Dist: httpx[http2]>=0.27; extra == 'all'
|
|
39
|
+
Requires-Dist: keyring>=25; extra == 'all'
|
|
40
|
+
Requires-Dist: lxml>=5.2; extra == 'all'
|
|
41
|
+
Requires-Dist: openpyxl>=3.1; extra == 'all'
|
|
42
|
+
Requires-Dist: opentelemetry-exporter-otlp>=1.25; extra == 'all'
|
|
43
|
+
Requires-Dist: opentelemetry-sdk>=1.25; extra == 'all'
|
|
44
|
+
Requires-Dist: pyarrow>=16; extra == 'all'
|
|
45
|
+
Requires-Dist: ruamel-yaml>=0.18; extra == 'all'
|
|
46
|
+
Requires-Dist: s3fs>=2024.6; extra == 'all'
|
|
47
|
+
Requires-Dist: starlette>=0.38; extra == 'all'
|
|
48
|
+
Requires-Dist: uvicorn>=0.30; extra == 'all'
|
|
49
|
+
Requires-Dist: zstandard>=0.22; extra == 'all'
|
|
50
|
+
Provides-Extra: avro
|
|
51
|
+
Requires-Dist: fastavro>=1.9; extra == 'avro'
|
|
52
|
+
Provides-Extra: azure
|
|
53
|
+
Requires-Dist: adlfs>=2024.4; extra == 'azure'
|
|
54
|
+
Requires-Dist: azure-identity>=1.17; extra == 'azure'
|
|
55
|
+
Provides-Extra: excel
|
|
56
|
+
Requires-Dist: openpyxl>=3.1; extra == 'excel'
|
|
57
|
+
Provides-Extra: gcs
|
|
58
|
+
Requires-Dist: gcsfs>=2024.6; extra == 'gcs'
|
|
59
|
+
Provides-Extra: http2
|
|
60
|
+
Requires-Dist: httpx[http2]>=0.27; extra == 'http2'
|
|
61
|
+
Provides-Extra: keyring
|
|
62
|
+
Requires-Dist: keyring>=25; extra == 'keyring'
|
|
63
|
+
Provides-Extra: otel
|
|
64
|
+
Requires-Dist: opentelemetry-exporter-otlp>=1.25; extra == 'otel'
|
|
65
|
+
Requires-Dist: opentelemetry-sdk>=1.25; extra == 'otel'
|
|
66
|
+
Provides-Extra: parquet
|
|
67
|
+
Requires-Dist: pyarrow>=16; extra == 'parquet'
|
|
68
|
+
Provides-Extra: query
|
|
69
|
+
Requires-Dist: duckdb>=1.0; extra == 'query'
|
|
70
|
+
Provides-Extra: s3
|
|
71
|
+
Requires-Dist: s3fs>=2024.6; extra == 's3'
|
|
72
|
+
Provides-Extra: secrets-aws
|
|
73
|
+
Requires-Dist: boto3>=1.34; extra == 'secrets-aws'
|
|
74
|
+
Provides-Extra: secrets-azure
|
|
75
|
+
Requires-Dist: azure-identity>=1.17; extra == 'secrets-azure'
|
|
76
|
+
Requires-Dist: azure-keyvault-secrets>=4.8; extra == 'secrets-azure'
|
|
77
|
+
Provides-Extra: secrets-gcp
|
|
78
|
+
Requires-Dist: google-cloud-secret-manager>=2.20; extra == 'secrets-gcp'
|
|
79
|
+
Provides-Extra: ui
|
|
80
|
+
Requires-Dist: ruamel-yaml>=0.18; extra == 'ui'
|
|
81
|
+
Requires-Dist: starlette>=0.38; extra == 'ui'
|
|
82
|
+
Requires-Dist: uvicorn>=0.30; extra == 'ui'
|
|
83
|
+
Provides-Extra: xml
|
|
84
|
+
Requires-Dist: lxml>=5.2; extra == 'xml'
|
|
85
|
+
Provides-Extra: zstd
|
|
86
|
+
Requires-Dist: backports-zstd>=1.0; (python_version < '3.14') and extra == 'zstd'
|
|
87
|
+
Requires-Dist: zstandard>=0.22; extra == 'zstd'
|
|
88
|
+
Description-Content-Type: text/markdown
|
|
89
|
+
|
|
90
|
+
# DUE
|
|
91
|
+
<sub>by Abhishek Manjunatha</sub>
|
|
92
|
+
|
|
93
|
+
**Declarative Universal Extractor.** Extract from any API and land it in your data lake, with no custom scripts. DUE handles REST, GraphQL, XML/SOAP, files and report APIs, plus auth, pagination, rate limits, retries, safe incremental loads and deduplication. Records land unchanged in local storage, S3, GCS or ADLS. It is EL only: transformation belongs downstream.
|
|
94
|
+
|
|
95
|
+
> **Status: Phase 3 in progress. M1–M4 are done (release 0.3 is feature-complete); M5 (integrity and PII) is next.** Design approved, spec v1 frozen (2026-11-27). The plan and SDLC roadmap are in [docs/DUE_PLAN.md](docs/DUE_PLAN.md).
|
|
96
|
+
|
|
97
|
+
## Design (Phase 2 approved · spec v1 frozen)
|
|
98
|
+
- [High-level design](docs/design/HLD.md) · [Low-level design](docs/design/LLD.md) · [Spec v1 reference](docs/design/SPEC_V1.md)
|
|
99
|
+
- [UI wireframes](docs/design/UI_WIREFRAMES.md) · [Architecture decisions](docs/adr/README.md)
|
|
100
|
+
- [Sample connectors on real public APIs](connectors/)
|
|
101
|
+
- [Design review log and reviewer checklist](docs/design/REVIEW_LOG.md)
|
|
102
|
+
|
|
103
|
+
## What works today (M1–M4, release 0.3)
|
|
104
|
+
- `due validate`: checks a project (every profile) or a single source file against spec v1: unknown keys with "did you mean", file and line, secrets syntax, templates, hooks, and stream references.
|
|
105
|
+
- `due config show [source[.stream]]`: every effective setting and the layer it came from (defaults, project, profile, source, stream, env).
|
|
106
|
+
- `due spec fields [path] [-m]`: every spec field tagged `*` mandatory, `* when …` conditional, or optional (with its default), plus type, rules and description. The same catalog generates the [field reference](docs/design/SPEC_V1_FIELDS.md) and `due spec schema` (JSON Schema for editor autocomplete).
|
|
107
|
+
- `params:`: declare each `${NAME}` placeholder (required/optional, type, pattern, allowed values, min/max, secret). `due validate --check-secrets` checks the real values without printing secrets.
|
|
108
|
+
- `due --version`
|
|
109
|
+
- All defaults live in [`src/due/defaults.yaml`](src/due/defaults.yaml) (ADR-011). Override project settings with `DUE__SECTION__KEY=value`.
|
|
110
|
+
|
|
111
|
+
**M2 (HTTP core) is built.** It's a resilient async client: every auth type (API key, bearer, basic, OAuth2 client credentials, login chains, Python hooks), token-bucket and adaptive rate limiting (Retry-After, X-RateLimit-*, body backoff), retries with jittered backoff, a circuit breaker, safety limits, ETag/Last-Modified requests, corporate CA bundles, mTLS, proxies and optional HTTP/2. Secrets are redacted from every error.
|
|
112
|
+
|
|
113
|
+
**M3 (sources, pagination and decoders) is built.**
|
|
114
|
+
- **Stream types:** REST, GraphQL, SOAP, file downloads (streamed to disk), request → poll → download reports, and child streams.
|
|
115
|
+
- **Pagination:** all 7 styles, each guarded against loops.
|
|
116
|
+
- **Decoders:** JSON, NDJSON, CSV/TSV, XML (XPath, entity-attack protection), Excel, Parquet, text and zip/gzip archives.
|
|
117
|
+
- **Also:** matrix partitions and incremental windows.
|
|
118
|
+
- **`due preview source.stream`** fetches real records without writing anything.
|
|
119
|
+
|
|
120
|
+
17 example connectors on real public APIs are in [connectors/](connectors/).
|
|
121
|
+
|
|
122
|
+
**Release 0.1 is feature-complete:** `due run` extracts streams into a local lake (`file://`, NDJSON, gzip).
|
|
123
|
+
- **Commit protocol:** a failed run leaves nothing readable, a rerun replaces its window, and state never runs ahead of the data.
|
|
124
|
+
- **Duplicate check across overlapping windows.**
|
|
125
|
+
- **Lease locks,** plus `due unlock` for crashed runs.
|
|
126
|
+
- **`_rejected/`** for records without a key or cursor.
|
|
127
|
+
- **Explicit PII field actions** (hash, mask, drop).
|
|
128
|
+
- **A `_due_*` metadata column on every record.**
|
|
129
|
+
|
|
130
|
+
**Release 0.3 (M4) is feature-complete.**
|
|
131
|
+
- **Cloud lakes:** `s3://`, `gs://` and `abfs://` through fsspec (install `due-extractor[s3]`, `due-extractor[gcs]` or `due-extractor[azure]`).
|
|
132
|
+
- **Output formats:** NDJSON, CSV, Parquet and Avro, compressed with gzip, zstd or snappy.
|
|
133
|
+
- **Delete detection:** `deletes: { mode: snapshot_diff, every: 7d }` lands tombstones (`_due_op: delete`) for keys that disappeared.
|
|
134
|
+
- **Resume (G6):** a long extraction that dies continues from its last page checkpoint.
|
|
135
|
+
- **`matrix_from`:** partitions fed from another stream's records.
|
|
136
|
+
- **`due backfill src.stream --from … --to …`:** replaces those windows and never moves the watermark back.
|
|
137
|
+
- **Housekeeping:** `due retry RUN_ID` re-runs only failed units with their original windows; `due state show|reset`; `due prune` applies `retention`.
|
|
138
|
+
- **Crash suite:** tests kill a run at every commit step and check that no data is lost or duplicated and state never runs ahead (G1–G7).
|
|
139
|
+
|
|
140
|
+
Not yet: PII auto-detection, integrity checks, alerts (0.5).
|
|
141
|
+
|
|
142
|
+
## Install
|
|
143
|
+
```powershell
|
|
144
|
+
pipx install "due-extractor[parquet]" # or: uv tool install due-extractor
|
|
145
|
+
due --version
|
|
146
|
+
```
|
|
147
|
+
The PyPI package is `due-extractor`; the command and the Python import are both `due`.
|
|
148
|
+
|
|
149
|
+
## Try it
|
|
150
|
+
```powershell
|
|
151
|
+
uv sync --group dev
|
|
152
|
+
uv run due validate connectors
|
|
153
|
+
uv run due config show usgs.earthquakes -C connectors -p cloud
|
|
154
|
+
uv run due spec fields source.auth --mandatory
|
|
155
|
+
uv run due preview wikipedia.recent_changes -C connectors -n 10
|
|
156
|
+
uv run due preview github.issues -C connectors --partition repo=pandas-dev/pandas
|
|
157
|
+
uv run due run ecb usgs -C connectors # lands in connectors/lake/ (git-ignored)
|
|
158
|
+
uv run due run usgs -C connectors # re-run: only the lookback overlap, unchanged records skipped
|
|
159
|
+
uv run due backfill github.issues --from 2026-11-01 --to 2026-11-08 -C connectors
|
|
160
|
+
uv run due state show usgs.earthquakes -C connectors
|
|
161
|
+
uv run due prune --dry-run -C connectors
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Develop
|
|
165
|
+
```powershell
|
|
166
|
+
uv run ruff format src tests tools; uv run ruff check src tests tools
|
|
167
|
+
uv run mypy src tools
|
|
168
|
+
uv run python tools/check_hardcoding.py
|
|
169
|
+
uv run pytest --cov
|
|
170
|
+
uv run pytest -m live # real public APIs (httpbin chaos tests); nightly in CI
|
|
171
|
+
```
|
|
172
|
+
CI runs the same gates on Windows, macOS and Linux with Python 3.12 and 3.14 ([ci.yml](.github/workflows/ci.yml)).
|
|
173
|
+
|
|
174
|
+
## Layout
|
|
175
|
+
- `src/due/`: the package (`spec/`, `secrets/`, `http/`, `paginate/`, `sources/`, `decode/`, `lake/` storage and writers, `run/` planner, runner and prune, `cli/`)
|
|
176
|
+
- `connectors/`: example project on real public APIs (also the validation fixture)
|
|
177
|
+
- `tests/`: unit tests
|
|
178
|
+
- `tools/`: repo tooling (the hard-coding lint)
|
|
179
|
+
- `docs/`: plan, design and ADRs
|
|
180
|
+
- `legacy/`: the old bk-pipeline code and its history, kept locally for reference only and **git-ignored**
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# DUE
|
|
2
|
+
<sub>by Abhishek Manjunatha</sub>
|
|
3
|
+
|
|
4
|
+
**Declarative Universal Extractor.** Extract from any API and land it in your data lake, with no custom scripts. DUE handles REST, GraphQL, XML/SOAP, files and report APIs, plus auth, pagination, rate limits, retries, safe incremental loads and deduplication. Records land unchanged in local storage, S3, GCS or ADLS. It is EL only: transformation belongs downstream.
|
|
5
|
+
|
|
6
|
+
> **Status: Phase 3 in progress. M1–M4 are done (release 0.3 is feature-complete); M5 (integrity and PII) is next.** Design approved, spec v1 frozen (2026-11-27). The plan and SDLC roadmap are in [docs/DUE_PLAN.md](docs/DUE_PLAN.md).
|
|
7
|
+
|
|
8
|
+
## Design (Phase 2 approved · spec v1 frozen)
|
|
9
|
+
- [High-level design](docs/design/HLD.md) · [Low-level design](docs/design/LLD.md) · [Spec v1 reference](docs/design/SPEC_V1.md)
|
|
10
|
+
- [UI wireframes](docs/design/UI_WIREFRAMES.md) · [Architecture decisions](docs/adr/README.md)
|
|
11
|
+
- [Sample connectors on real public APIs](connectors/)
|
|
12
|
+
- [Design review log and reviewer checklist](docs/design/REVIEW_LOG.md)
|
|
13
|
+
|
|
14
|
+
## What works today (M1–M4, release 0.3)
|
|
15
|
+
- `due validate`: checks a project (every profile) or a single source file against spec v1: unknown keys with "did you mean", file and line, secrets syntax, templates, hooks, and stream references.
|
|
16
|
+
- `due config show [source[.stream]]`: every effective setting and the layer it came from (defaults, project, profile, source, stream, env).
|
|
17
|
+
- `due spec fields [path] [-m]`: every spec field tagged `*` mandatory, `* when …` conditional, or optional (with its default), plus type, rules and description. The same catalog generates the [field reference](docs/design/SPEC_V1_FIELDS.md) and `due spec schema` (JSON Schema for editor autocomplete).
|
|
18
|
+
- `params:`: declare each `${NAME}` placeholder (required/optional, type, pattern, allowed values, min/max, secret). `due validate --check-secrets` checks the real values without printing secrets.
|
|
19
|
+
- `due --version`
|
|
20
|
+
- All defaults live in [`src/due/defaults.yaml`](src/due/defaults.yaml) (ADR-011). Override project settings with `DUE__SECTION__KEY=value`.
|
|
21
|
+
|
|
22
|
+
**M2 (HTTP core) is built.** It's a resilient async client: every auth type (API key, bearer, basic, OAuth2 client credentials, login chains, Python hooks), token-bucket and adaptive rate limiting (Retry-After, X-RateLimit-*, body backoff), retries with jittered backoff, a circuit breaker, safety limits, ETag/Last-Modified requests, corporate CA bundles, mTLS, proxies and optional HTTP/2. Secrets are redacted from every error.
|
|
23
|
+
|
|
24
|
+
**M3 (sources, pagination and decoders) is built.**
|
|
25
|
+
- **Stream types:** REST, GraphQL, SOAP, file downloads (streamed to disk), request → poll → download reports, and child streams.
|
|
26
|
+
- **Pagination:** all 7 styles, each guarded against loops.
|
|
27
|
+
- **Decoders:** JSON, NDJSON, CSV/TSV, XML (XPath, entity-attack protection), Excel, Parquet, text and zip/gzip archives.
|
|
28
|
+
- **Also:** matrix partitions and incremental windows.
|
|
29
|
+
- **`due preview source.stream`** fetches real records without writing anything.
|
|
30
|
+
|
|
31
|
+
17 example connectors on real public APIs are in [connectors/](connectors/).
|
|
32
|
+
|
|
33
|
+
**Release 0.1 is feature-complete:** `due run` extracts streams into a local lake (`file://`, NDJSON, gzip).
|
|
34
|
+
- **Commit protocol:** a failed run leaves nothing readable, a rerun replaces its window, and state never runs ahead of the data.
|
|
35
|
+
- **Duplicate check across overlapping windows.**
|
|
36
|
+
- **Lease locks,** plus `due unlock` for crashed runs.
|
|
37
|
+
- **`_rejected/`** for records without a key or cursor.
|
|
38
|
+
- **Explicit PII field actions** (hash, mask, drop).
|
|
39
|
+
- **A `_due_*` metadata column on every record.**
|
|
40
|
+
|
|
41
|
+
**Release 0.3 (M4) is feature-complete.**
|
|
42
|
+
- **Cloud lakes:** `s3://`, `gs://` and `abfs://` through fsspec (install `due-extractor[s3]`, `due-extractor[gcs]` or `due-extractor[azure]`).
|
|
43
|
+
- **Output formats:** NDJSON, CSV, Parquet and Avro, compressed with gzip, zstd or snappy.
|
|
44
|
+
- **Delete detection:** `deletes: { mode: snapshot_diff, every: 7d }` lands tombstones (`_due_op: delete`) for keys that disappeared.
|
|
45
|
+
- **Resume (G6):** a long extraction that dies continues from its last page checkpoint.
|
|
46
|
+
- **`matrix_from`:** partitions fed from another stream's records.
|
|
47
|
+
- **`due backfill src.stream --from … --to …`:** replaces those windows and never moves the watermark back.
|
|
48
|
+
- **Housekeeping:** `due retry RUN_ID` re-runs only failed units with their original windows; `due state show|reset`; `due prune` applies `retention`.
|
|
49
|
+
- **Crash suite:** tests kill a run at every commit step and check that no data is lost or duplicated and state never runs ahead (G1–G7).
|
|
50
|
+
|
|
51
|
+
Not yet: PII auto-detection, integrity checks, alerts (0.5).
|
|
52
|
+
|
|
53
|
+
## Install
|
|
54
|
+
```powershell
|
|
55
|
+
pipx install "due-extractor[parquet]" # or: uv tool install due-extractor
|
|
56
|
+
due --version
|
|
57
|
+
```
|
|
58
|
+
The PyPI package is `due-extractor`; the command and the Python import are both `due`.
|
|
59
|
+
|
|
60
|
+
## Try it
|
|
61
|
+
```powershell
|
|
62
|
+
uv sync --group dev
|
|
63
|
+
uv run due validate connectors
|
|
64
|
+
uv run due config show usgs.earthquakes -C connectors -p cloud
|
|
65
|
+
uv run due spec fields source.auth --mandatory
|
|
66
|
+
uv run due preview wikipedia.recent_changes -C connectors -n 10
|
|
67
|
+
uv run due preview github.issues -C connectors --partition repo=pandas-dev/pandas
|
|
68
|
+
uv run due run ecb usgs -C connectors # lands in connectors/lake/ (git-ignored)
|
|
69
|
+
uv run due run usgs -C connectors # re-run: only the lookback overlap, unchanged records skipped
|
|
70
|
+
uv run due backfill github.issues --from 2026-11-01 --to 2026-11-08 -C connectors
|
|
71
|
+
uv run due state show usgs.earthquakes -C connectors
|
|
72
|
+
uv run due prune --dry-run -C connectors
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Develop
|
|
76
|
+
```powershell
|
|
77
|
+
uv run ruff format src tests tools; uv run ruff check src tests tools
|
|
78
|
+
uv run mypy src tools
|
|
79
|
+
uv run python tools/check_hardcoding.py
|
|
80
|
+
uv run pytest --cov
|
|
81
|
+
uv run pytest -m live # real public APIs (httpbin chaos tests); nightly in CI
|
|
82
|
+
```
|
|
83
|
+
CI runs the same gates on Windows, macOS and Linux with Python 3.12 and 3.14 ([ci.yml](.github/workflows/ci.yml)).
|
|
84
|
+
|
|
85
|
+
## Layout
|
|
86
|
+
- `src/due/`: the package (`spec/`, `secrets/`, `http/`, `paginate/`, `sources/`, `decode/`, `lake/` storage and writers, `run/` planner, runner and prune, `cli/`)
|
|
87
|
+
- `connectors/`: example project on real public APIs (also the validation fixture)
|
|
88
|
+
- `tests/`: unit tests
|
|
89
|
+
- `tools/`: repo tooling (the hard-coding lint)
|
|
90
|
+
- `docs/`: plan, design and ADRs
|
|
91
|
+
- `legacy/`: the old bk-pipeline code and its history, kept locally for reference only and **git-ignored**
|