%global _empty_manifest_terminate_build 0
Name:		python-dbt2looker
Version:	0.11.0
Release:	1
Summary:	Generate lookml view files from dbt models
License:	MIT
URL:		https://github.com/hubble-data/dbt2looker
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/9e/e9/30e36510fc149b5b92d44809e80f33fbdfebe2742ecd1b3ad839c4f7b48d/dbt2looker-0.11.0.tar.gz
BuildArch:	noarch

Requires:	python3-lkml
Requires:	python3-pydantic
Requires:	python3-PyYAML
Requires:	python3-typing-extensions
Requires:	python3-importlib-metadata

%description
# dbt2looker

Use `dbt2looker` to generate Looker view files automatically from dbt models.

Want a deeper integration between dbt and your BI tool? You should also checkout [Lightdash - the open source alternative to Looker](https://github.com/lightdash/lightdash)

**Features**

* **Column descriptions** synced to looker
* **Dimension** for each column in dbt model
* **Dimension groups** for datetime/timestamp/date columns
* **Measures** defined through dbt column `metadata` [see below](#defining-measures)
* Looker types
* Warehouses: BigQuery, Snowflake, Redshift (postgres to come)

[![demo](https://raw.githubusercontent.com/hubble-data/dbt2looker/main/docs/demo.gif)](https://asciinema.org/a/407407)

## Quickstart

Run `dbt2looker` in the root of your dbt project *after compiling looker docs*.

**Generate Looker view files for all models:**
```shell
dbt docs generate
dbt2looker
```

**Generate Looker view files for all models tagged `prod`**
```shell
dbt2looker --tag prod
```

## Install

**Install from PyPi repository**

Install from pypi into a fresh virtual environment.

```
# Create virtual env
python3.7 -m venv dbt2looker-venv
source dbt2looker-venv/bin/activate

# Install
pip install dbt2looker

# Run
dbt2looker
```

**Build from source**

Requires [poetry](https://python-poetry.org/docs/) and python >=3.7

For development, it is recommended to use python 3.7:

```
# Ensure you're using 3.7
poetry env use 3.7  
# alternative: poetry env use /usr/local/opt/python@3.7/bin/python3

# Install dependencies and main package
poetry install

# Run dbtlooker in poetry environment
poetry run dbt2looker
```

## Defining measures

You can define looker measures in your dbt `schema.yml` files. For example:

```yaml
models:
  - name: pages
    columns:
      - name: url
        description: "Page url"
      - name: event_id
        description: unique event id for page view
        meta:
           measures:
             page_views:
               type: count
```


%package -n python3-dbt2looker
Summary:	Generate lookml view files from dbt models
Provides:	python-dbt2looker
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-dbt2looker
# dbt2looker

Use `dbt2looker` to generate Looker view files automatically from dbt models.

Want a deeper integration between dbt and your BI tool? You should also checkout [Lightdash - the open source alternative to Looker](https://github.com/lightdash/lightdash)

**Features**

* **Column descriptions** synced to looker
* **Dimension** for each column in dbt model
* **Dimension groups** for datetime/timestamp/date columns
* **Measures** defined through dbt column `metadata` [see below](#defining-measures)
* Looker types
* Warehouses: BigQuery, Snowflake, Redshift (postgres to come)

[![demo](https://raw.githubusercontent.com/hubble-data/dbt2looker/main/docs/demo.gif)](https://asciinema.org/a/407407)

## Quickstart

Run `dbt2looker` in the root of your dbt project *after compiling looker docs*.

**Generate Looker view files for all models:**
```shell
dbt docs generate
dbt2looker
```

**Generate Looker view files for all models tagged `prod`**
```shell
dbt2looker --tag prod
```

## Install

**Install from PyPi repository**

Install from pypi into a fresh virtual environment.

```
# Create virtual env
python3.7 -m venv dbt2looker-venv
source dbt2looker-venv/bin/activate

# Install
pip install dbt2looker

# Run
dbt2looker
```

**Build from source**

Requires [poetry](https://python-poetry.org/docs/) and python >=3.7

For development, it is recommended to use python 3.7:

```
# Ensure you're using 3.7
poetry env use 3.7  
# alternative: poetry env use /usr/local/opt/python@3.7/bin/python3

# Install dependencies and main package
poetry install

# Run dbtlooker in poetry environment
poetry run dbt2looker
```

## Defining measures

You can define looker measures in your dbt `schema.yml` files. For example:

```yaml
models:
  - name: pages
    columns:
      - name: url
        description: "Page url"
      - name: event_id
        description: unique event id for page view
        meta:
           measures:
             page_views:
               type: count
```


%package help
Summary:	Development documents and examples for dbt2looker
Provides:	python3-dbt2looker-doc
%description help
# dbt2looker

Use `dbt2looker` to generate Looker view files automatically from dbt models.

Want a deeper integration between dbt and your BI tool? You should also checkout [Lightdash - the open source alternative to Looker](https://github.com/lightdash/lightdash)

**Features**

* **Column descriptions** synced to looker
* **Dimension** for each column in dbt model
* **Dimension groups** for datetime/timestamp/date columns
* **Measures** defined through dbt column `metadata` [see below](#defining-measures)
* Looker types
* Warehouses: BigQuery, Snowflake, Redshift (postgres to come)

[![demo](https://raw.githubusercontent.com/hubble-data/dbt2looker/main/docs/demo.gif)](https://asciinema.org/a/407407)

## Quickstart

Run `dbt2looker` in the root of your dbt project *after compiling looker docs*.

**Generate Looker view files for all models:**
```shell
dbt docs generate
dbt2looker
```

**Generate Looker view files for all models tagged `prod`**
```shell
dbt2looker --tag prod
```

## Install

**Install from PyPi repository**

Install from pypi into a fresh virtual environment.

```
# Create virtual env
python3.7 -m venv dbt2looker-venv
source dbt2looker-venv/bin/activate

# Install
pip install dbt2looker

# Run
dbt2looker
```

**Build from source**

Requires [poetry](https://python-poetry.org/docs/) and python >=3.7

For development, it is recommended to use python 3.7:

```
# Ensure you're using 3.7
poetry env use 3.7  
# alternative: poetry env use /usr/local/opt/python@3.7/bin/python3

# Install dependencies and main package
poetry install

# Run dbtlooker in poetry environment
poetry run dbt2looker
```

## Defining measures

You can define looker measures in your dbt `schema.yml` files. For example:

```yaml
models:
  - name: pages
    columns:
      - name: url
        description: "Page url"
      - name: event_id
        description: unique event id for page view
        meta:
           measures:
             page_views:
               type: count
```


%prep
%autosetup -n dbt2looker-0.11.0

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-dbt2looker -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Tue May 30 2023 Python_Bot <Python_Bot@openeuler.org> - 0.11.0-1
- Package Spec generated