Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation to get started #25

Merged
merged 7 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Getting started
matthieucan marked this conversation as resolved.
Show resolved Hide resolved

`dbt-score` is a Python library that is easy to install and use. The minimum
required version of Python is `3.11`.

There are two dependencies:

- `dbt-core`: To parse a dbt project.
- `click`: To run the CLI.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be in the docs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we mention here a general tool purpose? Or will we introduce a separate page for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the general tool purpose is clear from this page


## Installation

The easiest way to install `dbt-score` is with `pip`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there other ways? :p

Copy link
Contributor

@druzhinin-kirill druzhinin-kirill May 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT of pipx? Or do we intend it to be a dev dependency (so pdm/poetry example)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could work for some people, especially if they use dbt without a virtual environment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which brings another point of discussion: dbt-score will pull a version of dbt, as it depends on it. Perhaps we should remove that dependency, and fail the option --run-dbt-parse if no version of dbt can be found in the user environment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the multiple examples, I think it's implied that installing with poetry or pipenv or whatever else will work as well? Feels a little bit redundant IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dbt-score will pull a version of dbt, as it depends on it. Perhaps we should remove that dependency, and fail the option --run-dbt-parse if no version of dbt can be found in the user environment

This is a good point, but we have to think about dbt-core version dependencies. Not sure if every version will work, because the manifest might have changed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed! We can check the version at run time though, if we ditch the dependency

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed the wording a little bit, I think we can keep it simple.


```shell
pip install dbt-score
```

## Usage

`dbt-score` uses the output of `dbt parse` (`manifest.json`) as input.
Therefore, it is recommended to run `dbt-score` from the root of your dbt
project. By default, it will look for `manifest.json` in the `target` directory.
jochemvandooren marked this conversation as resolved.
Show resolved Hide resolved

`dbt-score` can be executed from the command line:

```shell
dbt-score lint
```

To use a different manifest file, use the `--manifest` option:

```shell
dbt-score lint --manifest path/to/manifest.json
```

It's also possible to automatically run `dbt parse`, to generate the
`manifest.json` file:

```shell
dbt-score --run-dbt-parse
jochemvandooren marked this conversation as resolved.
Show resolved Hide resolved
```
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins:
- mkdocstrings
nav:
- Home: index.md
- Getting Started: getting_started.md
- Reference:
- reference/cli.md
- reference/config.md
Expand Down