Skip to main content

D.ata C.ollection F.ramework - Define a data source, run dcf, query the data

Project description

dcf -- D.ata C.ollection F.ramework

PyPI Python License

uvx --from dcf-core dcf init

How it works

  1. Define a data collector in YAML for any http data source
  2. Run it with dcf run
  3. Query your new data

Quickstart

Get real data. From an API. Into your Lakehouse. Query it with SQL. In 5 lines.

mkdir dcf-demo && cd dcf-demo
uvx --from dcf-core dcf init
uv sync
uv run dcf run so_questions
uv run dcf query 'SELECT * FROM stackoverflow.so_questions'

dcf init creates pyproject.toml, profiles.yml, .gitignore, collectors/, and an example collector.


Example

dcf collector

name: so_questions
namespace: stackoverflow

source:
  type: http
  url: https://api.stackexchange.com/2.3/questions
  response:
    records_path: items
  params:
    - name: site
      type: string
      value: stackoverflow
    - name: tagged
      type: string
      value: "python;data-engineering"
  schema:
    columns:
      - name: question_id
        path: question_id
        type: integer
      - name: title
        path: title
        type: string
      - name: creation_date
        path: creation_date
        type: integer

cadence:
  strategy: incremental
  primary_key: question_id
  iterate:
    - type: date_range
      params: [fromdate, todate]
      format: "%s"
      start: "2025-01-01"
      end: today
      step: 30 days

dcf run

uv run dcf run so_questions

dcf query

uv run dcf query 'SELECT * FROM stackoverflow.so_questions LIMIT 5'

More features


Contributing

git clone https://github.com/zephschafer/dcf && cd dcf && uv sync

Point a local project at your checkout:

[tool.uv.sources]
dcf-core = { path = "../dcf", editable = true }

To verify changes:

uv run dcf run so_questions
uv run dcf query 'SELECT * FROM stackoverflow.so_questions'

Releasing: bump version in pyproject.toml and push to main — GitHub Actions publishes to PyPI automatically.


Package structure

dcf/
├── cli.py              Entry point (Typer)
├── config/
│   ├── models.py       Pydantic models for collector YAML
│   └── loader.py       YAML loading + env var resolution
├── engine/
│   ├── runner.py       Outer loop (iterate → fetch → project → write)
│   ├── fetcher.py      HTTP and Python source fetchers
│   ├── iterator.py     Date range and categorical iteration
│   ├── projector.py    Schema projection and path extraction
│   └── transforms.py   Column transforms
├── writer/
│   └── iceberg.py      Write strategies (incremental / append / full_refresh)
└── gcp/                GCP auth, provisioning, Terraform wrappers

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

dcf_core-1.1.8.tar.gz (60.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dcf_core-1.1.8-py3-none-any.whl (59.8 kB view details)

Uploaded Python 3

File details

Details for the file dcf_core-1.1.8.tar.gz.

File metadata

  • Download URL: dcf_core-1.1.8.tar.gz
  • Upload date:
  • Size: 60.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dcf_core-1.1.8.tar.gz
Algorithm Hash digest
SHA256 b6cab0d82ddeb6b81976fdd775e6ed48583dcc79a51f764afccfa01395903757
MD5 ea2c170b33b6dc8c3a7ab437cfaf3a7c
BLAKE2b-256 b7a95542fbd49302210cffd0352742646baf540d6ce87effef8751d812467acb

See more details on using hashes here.

File details

Details for the file dcf_core-1.1.8-py3-none-any.whl.

File metadata

  • Download URL: dcf_core-1.1.8-py3-none-any.whl
  • Upload date:
  • Size: 59.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dcf_core-1.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 4d32751f5f79fa259c9f2248e999b245c849c70e8eea22ec276224b0f61f4672
MD5 313e756f12d0fa1749b270865131ff8f
BLAKE2b-256 585a21744ca1d757e9c4fa28569f8a9b8c7820626ddb9b3925dafea8d1767e70

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page