{"id":34048335,"url":"https://github.com/kokorin/dbt-pumpkin","last_synced_at":"2026-04-08T12:02:15.111Z","repository":{"id":245008941,"uuid":"816573536","full_name":"kokorin/dbt-pumpkin","owner":"kokorin","description":"A command-line tool which helps to manage DBT projects.","archived":false,"fork":false,"pushed_at":"2025-12-28T13:00:01.000Z","size":216,"stargazers_count":9,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-08T17:34:30.885Z","etag":null,"topics":["dbt","dbt-core","yaml"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kokorin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-18T02:41:15.000Z","updated_at":"2025-12-28T12:19:49.000Z","dependencies_parsed_at":"2025-12-28T15:02:49.575Z","dependency_job_id":null,"html_url":"https://github.com/kokorin/dbt-pumpkin","commit_stats":null,"previous_names":["kokorin/dbt-pumpkin"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/kokorin/dbt-pumpkin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokorin%2Fdbt-pumpkin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokorin%2Fdbt-pumpkin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokorin%2Fdbt-pumpkin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokorin%2Fdbt-pumpkin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kokorin","download_url":"https://codeload.github.com/kokorin/dbt-pumpkin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokorin%2Fdbt-pumpkin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31554110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T10:21:54.569Z","status":"ssl_error","status_checked_at":"2026-04-08T10:21:38.171Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dbt","dbt-core","yaml"],"created_at":"2025-12-14T00:04:05.047Z","updated_at":"2026-04-08T12:02:15.010Z","avatar_url":"https://github.com/kokorin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DBT-PUMPKIN\n\n[![codecov](https://codecov.io/github/kokorin/dbt-pumpkin/graph/badge.svg?token=EKGRIWEIMZ)](https://codecov.io/github/kokorin/dbt-pumpkin)\n\n`dbt-pumpkin` is a command-line tool which helps to manage [DBT](https://docs.getdbt.com/docs/introduction) projects.\n\nInspired by [dbt-osmosis](https://z3z1ma.github.io/dbt-osmosis/)\n\n## Usage\n\n### Botstrap DBT Resources\n\n`dbt-pumpkin` allows to create DBT YAML schema files for Seeds, Models and Snapshots. For that one has to add\n[dbt-pumpking-path](#dbt-pumpkin-path) configuration property for a Resource. Then `dbt-pumpkin` will be able to\nunderstand where YAML files should be located.\n\nBy default `dbt-pumpkin` will analyze all project's resources and create **absent** YAML schema definition files. You\ncan use `--select` and `--exclude` options to select/exclude a subset of resources. These arguments work exactly the\nsame way as they do with `dbt` command (`dbt list` is used under the hood).\n\n*Note*: YAML files created by this command will be almost empty. Another command should be used to add\ncolumns: [synchronize](#synchronize-dbt-resources)\n\n```sh\ndbt-pumpkin bootstrap --help\nUsage: dbt-pumpkin bootstrap [OPTIONS]\n\n  Bootstraps project by adding missing YAML definitions\n\nOptions:\n  --project-dir TEXT\n  --profiles-dir TEXT\n  -t, --target TEXT\n  --profile TEXT\n  -s, --select TEXT\n  --exclude TEXT\n  --dry-run\n  --debug\n  --help               Show this message and exit.\n```\n\n### Relocate DBT Resources\n\n`dbt-pumpkin` also allows to move DBT YAML schema files for Sources, Seeds, Models and Snapshots. As\nwith [bootstrap](#botstrap-dbt-resources) command [dbt-pumpking-path](#dbt-pumpkin-path) configuration property is\nrequired for a Resource. Then `dbt-pumpkin` will be able to understand where YAML files should be located.\n\n*Note*: `dbt-pumking` can split YAML schema file (if it contains several Resources) into separate YAML file, or,\nalternatively, it can merge several YAML files into one. This is all configured by `dbt-pumpking-path`.\n\n```sh\ndbt-pumpkin relocate --help\nUsage: dbt-pumpkin relocate [OPTIONS]\n\n  Relocates YAML definitions according to dbt-pumpkin-path configuration\n\nOptions:\n  --project-dir TEXT\n  --profiles-dir TEXT\n  -t, --target TEXT\n  --profile TEXT\n  -s, --select TEXT\n  --exclude TEXT\n  --dry-run\n  --debug\n  --help               Show this message and exit.\n```\n\n### Synchronize DBT Resources\n\nLast, but not least, feature is `synchronize`. It analyzes schema of actual tables and views in your database and\nupdates YAML schema files to have the same columns (and column types) in the same order as they are in a table/view\ncorresponding to a Resource.\n\nPay attention, that columns declared in YAML but absent in the database will be deleted. But you are using version\ncontrol system (and most probably it's git), right? So you can always revert changes done by `dbt-pumpkin` if, for\nexample, you forgot to run/build a Resource and its table/view is outdated.\n\n*Note* `dbt-pumpkin` leaves intact any descriptions, tests and any other properties set in YAML file.\n\n```sh\ndbt-pumpkin synchronize --help\nUsage: dbt-pumpkin synchronize [OPTIONS]\n\n  Synchronizes YAML definitions with actual tables in DB\n\nOptions:\n  --project-dir TEXT\n  --profiles-dir TEXT\n  -t, --target TEXT\n  --profile TEXT\n  -s, --select TEXT\n  --exclude TEXT\n  --dry-run\n  --debug\n  --help               Show this message and exit.\n```\n\n## Configuration\n\n### `dbt-pumpkin-path`\n\n`dbt-pumpkin-path` sets a path to YAML schema file of a resource. The path can relative to resource (SQL, CSV or PY) or\nroot-relative.\nRoot-relative paths set path relative to DBT project root directory and start with `/` symbol.\n\n#### Examples\n\nConfigure `dbt-pumpkin` to bootstrap resources at (or relocate resources to) `_schema.yml` file located **next to**\nSQL, CSV or PY file.\n\n```yaml\nmodels:\n  \"\u003cYOUR_PROJECT_NAME\u003e\":\n    +dbt-pumpkin-path: _schema.yml\nseeds:\n  \"\u003cYOUR_PROJECT_NAME\u003e\":\n    +dbt-pumpkin-path: _schema.yml\nsnapshots:\n  \"\u003cYOUR_PROJECT_NAME\u003e\":\n    +dbt-pumpkin-path: _schema.yml\n```\n\nYou your Model is called `my_model` and is defined at `models/path/to/my_model.sql`, then `dbt-pumpkin` will consider\n`models/path/to/_schema.yml` as the path were the model should be bootstrapped at or relocated to.\n\nOf course, as with any other DBT configuration property, you can re-define `dbt-pumpkin-path` on resources you want:\n\n```yaml\nmodels:\n  \"\u003cYOUR_PROJECT_NAME\u003e\":\n    +dbt-pumpkin-path: _schema.yml\n    intermediate:\n      int_my_model:\n        +dbt-pumpkin-path: int_my_model.yml\n```\n\n`dbt-pumpkin-path` actually defines **template** path and supports `{name}` and `{parent}` values. `{name}` gets\nreplaced with Resource's name and `{parent}` - with folder's name where resource SQL, CSV or PY file is located.\n\n```yaml\nmodels:\n  \"\u003cYOUR_PROJECT_NAME\u003e\":\n    +dbt-pumpkin-path: _{name}.yml\n```\n\nWith the above configuration, every resource will be relocated to (bootstrapped at) separate YAML file, so `my_model`\nwill be defined at `_my_model.yml`.\n\nIn case you have too many resourced defined in a directory, you may specify subdirectory to hold YAML files:\n\n```yaml\nmodels:\n  \"\u003cYOUR_PROJECT_NAME\u003e\":\n    +dbt-pumpkin-path: _schema/{name}.yml\n```\n\nSource in DBT have no other files except YAML. It means that it's not possible to use relative path\nin `dbt-pumpkin-path` to configure source YAML file location. The only option is to use root-relative paths:\n\n```yaml\nsources:\n  \"\u003cYOUR_PROJECT_NAME\u003e\":\n    # root-relative path must start with /\n    +dbt-pumpkin-path: /models/staging/_source_{name}.yml\n```\n\n### `dbt-pumpkin-types`\n\n`dbt-pumpkin-types` controls if precision and scale are added to numeric types and if length is added to string types.\n\n#### Examples\n\nYou can specify `dbt-pumpkin-types` for Sources, Seeds, Models and Snapshots.\n\n```yaml\nmodels:\n  \"\u003cYOUR_PROJECT_NAME\u003e\":\n    +dbt-pumpkin-types:\n      numeric-precision-and-scale: true\n      string-length: true\nsources:\n  \"\u003cYOUR_PROJECT_NAME\u003e\":\n    +dbt-pumpkin-types:\n      numeric-precision-and-scale: true\n      string-length: true\nseeds:\n  \"\u003cYOUR_PROJECT_NAME\u003e\":\n    +dbt-pumpkin-types:\n      numeric-precision-and-scale: true\n      string-length: true\nsnapshots:\n  \"\u003cYOUR_PROJECT_NAME\u003e\":\n    +dbt-pumpkin-types:\n      numeric-precision-and-scale: true\n      string-length: true\n```\n\nOr, if you need, you can specify `dbt-pumpkin-types` for specific Resources:\n\n```yaml\nmodels:\n  \"\u003cYOUR_PROJECT_NAME\u003e\":\n    my_models:\n      +dbt-pumpkin-types:\n        numeric-precision-and-scale: true\n        string-length: true\nsources:\n  \"\u003cYOUR_PROJECT_NAME\u003e\":\n    my_source:\n      +dbt-pumpkin-types:\n        numeric-precision-and-scale: true\n        string-length: true\nseeds:\n  \"\u003cYOUR_PROJECT_NAME\u003e\":\n    my_seed:\n      +dbt-pumpkin-types:\n        numeric-precision-and-scale: true\n        string-length: true\nsnapshots:\n  \"\u003cYOUR_PROJECT_NAME\u003e\":\n    my_snapshot:\n      +dbt-pumpkin-types:\n        numeric-precision-and-scale: true\n        string-length: true\n```\n\n### YAML Format\n\nYou can configure how `dbt-pumpkin` formats YAML files. For that it's required to add specific DBT variable to your\nproject:\n\n```yaml\nvars:\n  dbt-pumpkin:\n    yaml_format:\n      # indent of properties in a map, default 2\n      indent: 2\n      # offset of items in a list, default 0\n      offset: 2\n      # whether to preserve original quotes, default false\n      preserve_quotes: true\n      # maximum line width, default 80\n      max_width: 120\n```\n\n## Development\n\n```sh\n# First install Hatch globally\npip install hatch\n\n# Configure Hatch to create venvs in project\nhatch config set dirs.env.virtual .hatch\n\n# test in one venv\nhatch test\n# test across different python \u0026 dbt versions\nhatch test --all\n\n# sometimes working DBT project is required to verify user experience\nhatch run scripts/generate.py --help\n# to generate DBT project with 100 models\nhatch run scripts/generate.py 100\nhatch run dbt build\n\n# to validate dbt-pumpkin output visually (on test project generated above)\nhatch run +dbt=1.8 test:dbt-pumpkin synchronize\nhatch run +dbt=1.9 test:dbt-pumpkin synchronize\nhatch run test:dbt-pumpkin bootstrap --dry-run\n```\n\n## Troubleshooting\n\nClean envs and caches:\n\n```sh\nhatch env prune\npip cache purge\n# UV is used by default for hatch-test environments\nuv cache clean\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkokorin%2Fdbt-pumpkin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkokorin%2Fdbt-pumpkin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkokorin%2Fdbt-pumpkin/lists"}