dbt-core-interface


Namedbt-core-interface JSON
Version 0.2.4 PyPI version JSON
download
home_pagehttps://github.com/z3z1ma/dbt-core-interface
SummaryDbt Core Interface
upload_time2023-06-05 06:48:59
maintainer
docs_urlNone
authorAlex Butler
requires_python>=3.8,<3.11
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Dbt Core Interface

[![PyPI](https://img.shields.io/pypi/v/dbt-core-interface.svg)][pypi_]
[![Status](https://img.shields.io/pypi/status/dbt-core-interface.svg)][status]
[![Python Version](https://img.shields.io/pypi/pyversions/dbt-core-interface)][python version]
[![License](https://img.shields.io/pypi/l/dbt-core-interface)][license]

[![Read the documentation at https://dbt-core-interface.readthedocs.io/](https://img.shields.io/readthedocs/dbt-core-interface/latest.svg?label=Read%20the%20Docs)][read the docs]
[![Tests](https://github.com/z3z1ma/dbt-core-interface/workflows/Tests/badge.svg)][tests]

[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)][pre-commit]
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black]

[pypi_]: https://pypi.org/project/dbt-core-interface/
[status]: https://pypi.org/project/dbt-core-interface/
[python version]: https://pypi.org/project/dbt-core-interface
[read the docs]: https://dbt-core-interface.readthedocs.io/
[tests]: https://github.com/z3z1ma/dbt-core-interface/actions?workflow=Tests
[codecov]: https://app.codecov.io/gh/z3z1ma/dbt-core-interface
[pre-commit]: https://github.com/pre-commit/pre-commit
[black]: https://github.com/psf/black

## Features

An extremely simplified interface is provided to accomplish all of the following with no dependencies outside dbt-core:

- Parse dbt project on disk loading dbt core classes into memory from a single class/interface

- Automatic management of the adapter and thread-safe efficient connection pool reuse

- Run SQL and get results in python fully independent of the dbt adapter which automatically enables support for many databases

- Run SQL with dbt SQL from a single method call

- Load macros at runtime enabling custom functionality in third party extensions without requiring the dbt packaging system to be managed in userland

- Compile dbt jinja extremely fast and efficiently, thread-safe and stress tested at load via a Bottle server which live compiles SQL

- Manage multiple dbt projects in a single process using the DbtProjectContainer class

`dbt-core-interface` is a wrapper that allows developers to rapidly develop features and integrations for dbt. This project aims to serve as a place for the community to aggregate the best ways to interface with dbt. It is afforded a much faster iteration cycle and much more freedom due to it's independence from the dbt codebase. It is intended to act as an common library to dbt's existing APIs for developers. Implementations can land here and prove themselves out before landing in the dbt-core codebase and benefit all developers involved. Sqlfluff dbt templater, dbt-osmosis, dbt-fastapi which I am ripping out of dbt-osmosis, an impending metadata manager, a testing framework will all leverage this library. As dbt core evolves and stabilizes its python API, this project will evolve with it. This may manifest in simplification of certain methods but our goal is to maintain the API and focus on driving efficient, innovative/creative, and agile community driven integration patterns.

## Requirements

- The **only** requirement is dbt-core, tested with versions `1.0.*`, `1.1.*`, `1.2.*`, `1.3.*`

## Installation

You can install _Dbt Core Interface_ via [pip] from [PyPI]:

```console
$ pip install dbt-core-interface
```

## Usage

Please see the [Api Reference] for details.

To launch the Bottle server for live compiling dbt jinja:

    python -m dbt_core_interface.project

This will launch the server on port 8581. You can then make requests to the server, e.g.:

    curl -X POST -H "Content-Type: application/json" -H "X-dbt-Project: dbt_project" -d '{"project_dir":"/app/tests/sqlfluff_templater/fixtures/dbt/dbt_project/","profiles_dir":"/app/tests/sqlfluff_templater/fixtures/dbt/profiles_yml/","target":"dev"}' http://localhost:8581/register

You can change the server hostname and port using the `--host` and `--port` arguments.

## Contributing

Contributions are very welcome.
To learn more, see the [Contributor Guide].

## License

Distributed under the terms of the [MIT license][license],
_Dbt Core Interface_ is free and open source software.

## Issues

If you encounter any problems,
please [file an issue] along with a detailed description.

## Credits

This project was generated from [@cjolowicz]'s [Hypermodern Python Cookiecutter] template.

[@cjolowicz]: https://github.com/cjolowicz
[pypi]: https://pypi.org/
[hypermodern python cookiecutter]: https://github.com/cjolowicz/cookiecutter-hypermodern-python
[file an issue]: https://github.com/z3z1ma/dbt-core-interface/issues
[pip]: https://pip.pypa.io/

<!-- github-only -->

[license]: https://github.com/z3z1ma/dbt-core-interface/blob/main/LICENSE
[contributor guide]: https://github.com/z3z1ma/dbt-core-interface/blob/main/CONTRIBUTING.md
[api reference]: https://dbt-core-interface.readthedocs.io/en/latest/reference.html


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/z3z1ma/dbt-core-interface",
    "name": "dbt-core-interface",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<3.11",
    "maintainer_email": "",
    "keywords": "",
    "author": "Alex Butler",
    "author_email": "butler.alex2010@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b8/c9/a35e5c64106c2ccd554653e69240a1f0cc93c8ec95796397f03718c25a8e/dbt_core_interface-0.2.4.tar.gz",
    "platform": null,
    "description": "# Dbt Core Interface\n\n[![PyPI](https://img.shields.io/pypi/v/dbt-core-interface.svg)][pypi_]\n[![Status](https://img.shields.io/pypi/status/dbt-core-interface.svg)][status]\n[![Python Version](https://img.shields.io/pypi/pyversions/dbt-core-interface)][python version]\n[![License](https://img.shields.io/pypi/l/dbt-core-interface)][license]\n\n[![Read the documentation at https://dbt-core-interface.readthedocs.io/](https://img.shields.io/readthedocs/dbt-core-interface/latest.svg?label=Read%20the%20Docs)][read the docs]\n[![Tests](https://github.com/z3z1ma/dbt-core-interface/workflows/Tests/badge.svg)][tests]\n\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)][pre-commit]\n[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black]\n\n[pypi_]: https://pypi.org/project/dbt-core-interface/\n[status]: https://pypi.org/project/dbt-core-interface/\n[python version]: https://pypi.org/project/dbt-core-interface\n[read the docs]: https://dbt-core-interface.readthedocs.io/\n[tests]: https://github.com/z3z1ma/dbt-core-interface/actions?workflow=Tests\n[codecov]: https://app.codecov.io/gh/z3z1ma/dbt-core-interface\n[pre-commit]: https://github.com/pre-commit/pre-commit\n[black]: https://github.com/psf/black\n\n## Features\n\nAn extremely simplified interface is provided to accomplish all of the following with no dependencies outside dbt-core:\n\n- Parse dbt project on disk loading dbt core classes into memory from a single class/interface\n\n- Automatic management of the adapter and thread-safe efficient connection pool reuse\n\n- Run SQL and get results in python fully independent of the dbt adapter which automatically enables support for many databases\n\n- Run SQL with dbt SQL from a single method call\n\n- Load macros at runtime enabling custom functionality in third party extensions without requiring the dbt packaging system to be managed in userland\n\n- Compile dbt jinja extremely fast and efficiently, thread-safe and stress tested at load via a Bottle server which live compiles SQL\n\n- Manage multiple dbt projects in a single process using the DbtProjectContainer class\n\n`dbt-core-interface` is a wrapper that allows developers to rapidly develop features and integrations for dbt. This project aims to serve as a place for the community to aggregate the best ways to interface with dbt. It is afforded a much faster iteration cycle and much more freedom due to it's independence from the dbt codebase. It is intended to act as an common library to dbt's existing APIs for developers. Implementations can land here and prove themselves out before landing in the dbt-core codebase and benefit all developers involved. Sqlfluff dbt templater, dbt-osmosis, dbt-fastapi which I am ripping out of dbt-osmosis, an impending metadata manager, a testing framework will all leverage this library. As dbt core evolves and stabilizes its python API, this project will evolve with it. This may manifest in simplification of certain methods but our goal is to maintain the API and focus on driving efficient, innovative/creative, and agile community driven integration patterns.\n\n## Requirements\n\n- The **only** requirement is dbt-core, tested with versions `1.0.*`, `1.1.*`, `1.2.*`, `1.3.*`\n\n## Installation\n\nYou can install _Dbt Core Interface_ via [pip] from [PyPI]:\n\n```console\n$ pip install dbt-core-interface\n```\n\n## Usage\n\nPlease see the [Api Reference] for details.\n\nTo launch the Bottle server for live compiling dbt jinja:\n\n    python -m dbt_core_interface.project\n\nThis will launch the server on port 8581. You can then make requests to the server, e.g.:\n\n    curl -X POST -H \"Content-Type: application/json\" -H \"X-dbt-Project: dbt_project\" -d '{\"project_dir\":\"/app/tests/sqlfluff_templater/fixtures/dbt/dbt_project/\",\"profiles_dir\":\"/app/tests/sqlfluff_templater/fixtures/dbt/profiles_yml/\",\"target\":\"dev\"}' http://localhost:8581/register\n\nYou can change the server hostname and port using the `--host` and `--port` arguments.\n\n## Contributing\n\nContributions are very welcome.\nTo learn more, see the [Contributor Guide].\n\n## License\n\nDistributed under the terms of the [MIT license][license],\n_Dbt Core Interface_ is free and open source software.\n\n## Issues\n\nIf you encounter any problems,\nplease [file an issue] along with a detailed description.\n\n## Credits\n\nThis project was generated from [@cjolowicz]'s [Hypermodern Python Cookiecutter] template.\n\n[@cjolowicz]: https://github.com/cjolowicz\n[pypi]: https://pypi.org/\n[hypermodern python cookiecutter]: https://github.com/cjolowicz/cookiecutter-hypermodern-python\n[file an issue]: https://github.com/z3z1ma/dbt-core-interface/issues\n[pip]: https://pip.pypa.io/\n\n<!-- github-only -->\n\n[license]: https://github.com/z3z1ma/dbt-core-interface/blob/main/LICENSE\n[contributor guide]: https://github.com/z3z1ma/dbt-core-interface/blob/main/CONTRIBUTING.md\n[api reference]: https://dbt-core-interface.readthedocs.io/en/latest/reference.html\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Dbt Core Interface",
    "version": "0.2.4",
    "project_urls": {
        "Changelog": "https://github.com/z3z1ma/dbt-core-interface/releases",
        "Documentation": "https://dbt-core-interface.readthedocs.io",
        "Homepage": "https://github.com/z3z1ma/dbt-core-interface",
        "Repository": "https://github.com/z3z1ma/dbt-core-interface"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "856366828b2df7a7c33f3a073980e43ab6104bcd2a64c2ff6dd88f1e4761d33b",
                "md5": "e3c2ad0d2e348eb3b87ce7b634b6c6c4",
                "sha256": "c035dcf1b74356e9033e111760330477047095ef368fc728b5425f015cd1b3e5"
            },
            "downloads": -1,
            "filename": "dbt_core_interface-0.2.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e3c2ad0d2e348eb3b87ce7b634b6c6c4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<3.11",
            "size": 73422,
            "upload_time": "2023-06-05T06:48:57",
            "upload_time_iso_8601": "2023-06-05T06:48:57.351897Z",
            "url": "https://files.pythonhosted.org/packages/85/63/66828b2df7a7c33f3a073980e43ab6104bcd2a64c2ff6dd88f1e4761d33b/dbt_core_interface-0.2.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b8c9a35e5c64106c2ccd554653e69240a1f0cc93c8ec95796397f03718c25a8e",
                "md5": "c2c97344b88ee026193e8d069c9a1eab",
                "sha256": "631e10595f152c98bcf9635bff806c7576170f9487d1e83dc40513d1b11242fa"
            },
            "downloads": -1,
            "filename": "dbt_core_interface-0.2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "c2c97344b88ee026193e8d069c9a1eab",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<3.11",
            "size": 72580,
            "upload_time": "2023-06-05T06:48:59",
            "upload_time_iso_8601": "2023-06-05T06:48:59.075193Z",
            "url": "https://files.pythonhosted.org/packages/b8/c9/a35e5c64106c2ccd554653e69240a1f0cc93c8ec95796397f03718c25a8e/dbt_core_interface-0.2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-05 06:48:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "z3z1ma",
    "github_project": "dbt-core-interface",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dbt-core-interface"
}
        
Elapsed time: 0.07514s