marthouse 0.1.0__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- marthouse-0.2.0/PKG-INFO +278 -0
- marthouse-0.2.0/README.md +231 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/__init__.py +1 -1
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/api/dbt.py +2 -1
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/api/pipelines_api.py +2 -2
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/api/projects_api.py +2 -1
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/api/system.py +11 -2
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/api/work_api.py +6 -5
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/cli.py +3 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/dbt/artifacts.py +20 -4
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/dbt/detect.py +35 -17
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/dbt/install.py +3 -2
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/dlt/destinations.py +1 -1
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/dlt/service.py +12 -12
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/dlt/tool.py +15 -11
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/jobs.py +7 -4
- marthouse-0.2.0/marthouse/oscompat.py +51 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/profiles.py +5 -5
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/projects.py +29 -23
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/schema_yml.py +3 -3
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/secrets_store.py +1 -1
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/staging.py +1 -1
- marthouse-0.1.0/marthouse/static/assets/index-D_M_Ym86.js → marthouse-0.2.0/marthouse/static/assets/index-BCgECSjc.js +2 -2
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/static/index.html +1 -1
- marthouse-0.2.0/pyproject.toml +65 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/tests/test_detect.py +23 -0
- marthouse-0.1.0/PKG-INFO +0 -26
- marthouse-0.1.0/pyproject.toml +0 -41
- {marthouse-0.1.0 → marthouse-0.2.0}/.gitignore +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/api/__init__.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/api/account.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/api/common.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/api/jobs_api.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/api/schedules_api.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/api/tools_api.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/appsettings.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/config.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/db.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/dbt/__init__.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/dlt/__init__.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/dlt/codegen.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/dlt/inspector.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/events.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/main.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/models.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/scheduler.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/security.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/static/assets/index-CLdMRE6z.css +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/static/icon.svg +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/visual.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/workers/__init__.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/marthouse/workers/worker.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/tests/conftest.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/tests/test_artifacts.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/tests/test_e2e_dbt.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/tests/test_e2e_dlt.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/tests/test_profiles.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/tests/test_security.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/tests/test_visual.py +0 -0
- {marthouse-0.1.0 → marthouse-0.2.0}/tests/test_workbench.py +0 -0
marthouse-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: marthouse
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: The open-source app for dbt Core and dlt: load, transform and explore your data without living in a terminal.
|
|
5
|
+
Project-URL: Homepage, https://github.com/godalida/marthouse
|
|
6
|
+
Project-URL: Source, https://github.com/godalida/marthouse
|
|
7
|
+
Project-URL: Issues, https://github.com/godalida/marthouse/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/godalida/marthouse/blob/main/CHANGELOG.md
|
|
9
|
+
Author: Glenn Dalida
|
|
10
|
+
License: Apache-2.0
|
|
11
|
+
Keywords: analytics-engineering,data,dbt,dbt-core,dlt,elt,gui,lineage,sql
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Web Environment
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Operating System :: MacOS
|
|
18
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Database
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
25
|
+
Requires-Python: >=3.11
|
|
26
|
+
Requires-Dist: argon2-cffi>=23
|
|
27
|
+
Requires-Dist: cryptography>=43
|
|
28
|
+
Requires-Dist: fastapi>=0.115
|
|
29
|
+
Requires-Dist: httpx>=0.27
|
|
30
|
+
Requires-Dist: keyring>=25
|
|
31
|
+
Requires-Dist: packaging>=24
|
|
32
|
+
Requires-Dist: platformdirs>=4
|
|
33
|
+
Requires-Dist: pydantic-settings>=2.4
|
|
34
|
+
Requires-Dist: python-multipart>=0.0.9
|
|
35
|
+
Requires-Dist: ruamel-yaml>=0.18
|
|
36
|
+
Requires-Dist: sqlalchemy>=2.0
|
|
37
|
+
Requires-Dist: uv>=0.4
|
|
38
|
+
Requires-Dist: uvicorn[standard]>=0.30
|
|
39
|
+
Provides-Extra: dev
|
|
40
|
+
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
|
|
41
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
42
|
+
Provides-Extra: hosted
|
|
43
|
+
Requires-Dist: arq>=0.26; extra == 'hosted'
|
|
44
|
+
Requires-Dist: psycopg[binary]>=3.2; extra == 'hosted'
|
|
45
|
+
Requires-Dist: redis>=5; extra == 'hosted'
|
|
46
|
+
Description-Content-Type: text/markdown
|
|
47
|
+
|
|
48
|
+
<p align="center">
|
|
49
|
+
<img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/assets/banner.svg" alt="Marthouse: load, transform and explore your data in one app" width="100%">
|
|
50
|
+
</p>
|
|
51
|
+
|
|
52
|
+
<p align="center">
|
|
53
|
+
<a href="https://github.com/godalida/marthouse/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/godalida/marthouse/actions/workflows/ci.yml/badge.svg?branch=main"></a>
|
|
54
|
+
<a href="https://github.com/godalida/marthouse/blob/main/LICENSE"><img alt="License: Apache 2.0" src="https://img.shields.io/badge/license-Apache%202.0-5B5BD6?style=flat-square"></a>
|
|
55
|
+
<img alt="Python 3.11+" src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white">
|
|
56
|
+
<a href="https://pypi.org/project/marthouse/"><img alt="PyPI" src="https://img.shields.io/pypi/v/marthouse?style=flat-square&color=5B5BD6"></a>
|
|
57
|
+
<img alt="dbt Core 1.8+" src="https://img.shields.io/badge/dbt%20Core-1.8%2B-5B5BD6?style=flat-square">
|
|
58
|
+
<img alt="dlt 1.x" src="https://img.shields.io/badge/dlt-1.x-5B5BD6?style=flat-square">
|
|
59
|
+
<a href="https://github.com/godalida/marthouse/blob/main/CONTRIBUTING.md"><img alt="PRs welcome" src="https://img.shields.io/badge/PRs-welcome-2EA44F?style=flat-square"></a>
|
|
60
|
+
</p>
|
|
61
|
+
|
|
62
|
+
<h3 align="center">The open-source app for dbt Core and dlt.</h3>
|
|
63
|
+
|
|
64
|
+
<p align="center">
|
|
65
|
+
Load data from APIs, databases and files. Transform it with tested models. Explore the results.<br>
|
|
66
|
+
All in one app, without living in a terminal, and without giving up the plain files your team reviews in Git.
|
|
67
|
+
</p>
|
|
68
|
+
|
|
69
|
+
<p align="center">
|
|
70
|
+
<a href="#install"><b>Install</b></a> ·
|
|
71
|
+
<a href="#features"><b>Features</b></a> ·
|
|
72
|
+
<a href="#how-it-works"><b>How it works</b></a> ·
|
|
73
|
+
<a href="#run-it-for-a-team"><b>Run it for a team</b></a> ·
|
|
74
|
+
<a href="#faq"><b>FAQ</b></a> ·
|
|
75
|
+
<a href="https://github.com/godalida/marthouse/blob/main/CONTRIBUTING.md"><b>Contribute</b></a>
|
|
76
|
+
</p>
|
|
77
|
+
|
|
78
|
+
<p align="center">
|
|
79
|
+
<img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/assets/demo.gif" alt="A 40-second tour: a dlt pipeline's tables, the lineage graph with a model's impact, the model builder previewing rows after each step, a SQL query with ref(), and the docs catalog" width="100%">
|
|
80
|
+
</p>
|
|
81
|
+
|
|
82
|
+
## Why Marthouse?
|
|
83
|
+
|
|
84
|
+
dbt and dlt are excellent tools that only speak command line. That's fine for engineers and a wall for everyone else on a data team. Marthouse puts a real interface on them without hiding what they do.
|
|
85
|
+
|
|
86
|
+
- **Learn the tool by using it.** Every run shows the exact `dbt` or `dlt` command it ran. Every visual step opens as the SQL it writes.
|
|
87
|
+
- **No lock-in.** Your project stays a normal dbt project and normal dlt scripts. Close Marthouse and everything still runs from the terminal or CI.
|
|
88
|
+
- **Zero setup.** Marthouse finds dbt on your machine (project `.venv`, PATH, pipx, uv, Homebrew, conda) or installs a private copy with [uv](https://docs.astral.sh/uv/).
|
|
89
|
+
- **Your data stays put.** Locally, the app only listens on `127.0.0.1` and keeps passwords in your OS keychain, never in files.
|
|
90
|
+
|
|
91
|
+
### Who it's for
|
|
92
|
+
|
|
93
|
+
| If you are… | Marthouse gives you… |
|
|
94
|
+
|---|---|
|
|
95
|
+
| **A data analyst** who knows SQL but not the dbt CLI | A model builder that writes the SQL for you, a scratchpad with `ref()`, and docs you edit like a form |
|
|
96
|
+
| **An analytics engineer** | Lineage and impact before you change a model, fast previews, runs you can read, tests at a glance |
|
|
97
|
+
| **A BI developer** | One place to see where every dashboard number comes from, back to the API it was loaded from |
|
|
98
|
+
| **A small data team** | Loading, transforming and scheduling in one tool, self-hosted, on files you already keep in Git |
|
|
99
|
+
|
|
100
|
+
## Install
|
|
101
|
+
|
|
102
|
+
**Requirements:** macOS, Windows or Linux, and [uv](https://docs.astral.sh/uv/getting-started/installation/), which fetches Python 3.11+ if you don't have it. You don't need dbt or dlt; Marthouse installs them if they're missing.
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
uvx marthouse # run it once, without installing
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Or install the `marthouse` command with `uv tool install marthouse`, `pipx install marthouse` or `pip install marthouse`. To run it from source, see [CONTRIBUTING.md](https://github.com/godalida/marthouse/blob/main/CONTRIBUTING.md).
|
|
109
|
+
|
|
110
|
+
Your browser opens Marthouse, and the first run walks you through it:
|
|
111
|
+
|
|
112
|
+
1. **Find dbt.** Marthouse looks on your machine, or installs a private copy with the adapters you pick.
|
|
113
|
+
2. **Open a project.** Use your own, or try [`examples/jaffle_shop_duckdb`](https://github.com/godalida/marthouse/blob/main/examples/jaffle_shop_duckdb), which needs no warehouse.
|
|
114
|
+
3. **Check the connection.** Marthouse runs `dbt debug` and shows each check.
|
|
115
|
+
4. **Build.**
|
|
116
|
+
|
|
117
|
+
> [!TIP]
|
|
118
|
+
> The example project includes a dlt pipeline, `shop_files`, that loads its CSV files into the same DuckDB database dbt uses. Load → Transform → Explore end to end takes a couple of minutes.
|
|
119
|
+
|
|
120
|
+
## Features
|
|
121
|
+
|
|
122
|
+
### Load: pipelines with dlt
|
|
123
|
+
|
|
124
|
+
<img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/screenshots/pipelines.png" alt="A dlt pipeline: last load, rows per table, and a button to create dbt sources" width="100%">
|
|
125
|
+
|
|
126
|
+
- Build loaders for **REST APIs, SQL databases, files and buckets**, or any of dltHub's **verified sources**, with forms instead of code.
|
|
127
|
+
- **Try request** shows the API's JSON so you can point at the rows you want.
|
|
128
|
+
- Loads only what's new, keeps the schema up to date, and shows rows per table, load history and incremental state.
|
|
129
|
+
- **Create dbt sources** from a pipeline in one click, and load straight into your dbt connection so one set of credentials serves both tools.
|
|
130
|
+
- Every pipeline is a readable Python file in `pipelines/` that runs without Marthouse.
|
|
131
|
+
|
|
132
|
+
### Transform: models, builder and lineage
|
|
133
|
+
|
|
134
|
+
<table>
|
|
135
|
+
<tr>
|
|
136
|
+
<td width="50%"><img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/screenshots/builder.png" alt="The model builder: four steps with the resulting rows"></td>
|
|
137
|
+
<td width="50%"><img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/screenshots/lineage.png" alt="Lineage graph from pipeline to exposure"></td>
|
|
138
|
+
</tr>
|
|
139
|
+
<tr>
|
|
140
|
+
<td valign="top"><b>Model builder.</b> Start from a model or source, then filter, join, calculate, group and sort. See the rows after every step. It saves a normal dbt model you can open as SQL at any time.</td>
|
|
141
|
+
<td valign="top"><b>Lineage.</b> One graph from pipeline to dashboard. Select a node to see what a change would affect, then build it and everything downstream. Selectors like <code>+orders</code> and <code>tag:finance</code> work in search.</td>
|
|
142
|
+
</tr>
|
|
143
|
+
<tr>
|
|
144
|
+
<td width="50%"><img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/screenshots/models.png" alt="The models editor with compiled SQL and inspector"></td>
|
|
145
|
+
<td width="50%"><img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/screenshots/tests.png" alt="Tests with coverage and failing rows"></td>
|
|
146
|
+
</tr>
|
|
147
|
+
<tr>
|
|
148
|
+
<td valign="top"><b>Models.</b> A SQL editor with Jinja highlighting, the compiled SQL, row previews with <code>dbt show</code>, and an inspector with refs, tests and the last run.</td>
|
|
149
|
+
<td valign="top"><b>Runs and tests.</b> A live node timeline, logs, and errors explained in plain words. Test coverage at a glance, the failing rows, and one-click re-runs.</td>
|
|
150
|
+
</tr>
|
|
151
|
+
</table>
|
|
152
|
+
|
|
153
|
+
### Explore: SQL, docs and freshness
|
|
154
|
+
|
|
155
|
+
<img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/screenshots/catalog.png" alt="Docs and catalog: columns, descriptions and tests for a model" width="100%">
|
|
156
|
+
|
|
157
|
+
- **Docs and tests without YAML.** Edit descriptions and tick tests (unique, not null, accepted values, relationships). Marthouse writes the YAML and keeps your comments.
|
|
158
|
+
- **SQL scratchpad** with `ref()` and `source()`, query history, CSV download and **Save as model**.
|
|
159
|
+
- **Source freshness** against your thresholds, and a **staging-model generator** for any source table.
|
|
160
|
+
|
|
161
|
+
### And the rest of the job
|
|
162
|
+
|
|
163
|
+
- **Schedules:** "load, then build, every weekday at 6:00", with a webhook alert when it fails.
|
|
164
|
+
- **Connections:** forms that write `profiles.yml`, with secrets in the keychain.
|
|
165
|
+
- **⌘K command palette** for every model, screen and command.
|
|
166
|
+
- **Light and dark** themes, in a native macOS-style interface.
|
|
167
|
+
|
|
168
|
+
## How it works
|
|
169
|
+
|
|
170
|
+
<p align="center">
|
|
171
|
+
<img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/assets/how-it-works.svg" alt="Sources are loaded by dlt pipelines into your warehouse, dbt models transform them, and you explore the results; schedules run it all" width="100%">
|
|
172
|
+
</p>
|
|
173
|
+
|
|
174
|
+
Marthouse is a FastAPI server and a React app. It runs the real tools as separate processes and reads the files they write: dbt's `manifest.json`, `run_results.json` and `catalog.json`, and dlt's pipeline state. It never reimplements them.
|
|
175
|
+
|
|
176
|
+
| Works with | Support |
|
|
177
|
+
|---|---|
|
|
178
|
+
| **dbt Core** | 1.8 and newer, any adapter: DuckDB, Postgres, Snowflake, BigQuery, Redshift, Databricks, SQL Server, Trino |
|
|
179
|
+
| **dlt** | 1.x: REST API, SQL database and filesystem sources, plus dltHub verified sources |
|
|
180
|
+
| **Destinations** | Anything both tools support. A pipeline can load straight into your dbt connection, so one set of credentials serves both. |
|
|
181
|
+
| **dbt Fusion** | Detected and reported. Marthouse works with dbt Core. |
|
|
182
|
+
|
|
183
|
+
## Run it for a team
|
|
184
|
+
|
|
185
|
+
Marthouse also runs as a shared web app with accounts, workspaces and roles (viewer, member, admin, owner). Projects are cloned from Git, and dbt and dlt run in a separate worker.
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
cp docker/.env.example docker/.env # set POSTGRES_PASSWORD and MARTHOUSE_SECRET_KEY
|
|
189
|
+
docker compose -f docker/docker-compose.yml --env-file docker/.env up --build
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
That starts the web app, a job worker, Postgres and Redis. Put TLS in front and set `MARTHOUSE_COOKIE_SECURE=true`. See [`docker/.env.example`](https://github.com/godalida/marthouse/blob/main/docker/.env.example) for every setting.
|
|
193
|
+
|
|
194
|
+
<details>
|
|
195
|
+
<summary><b>Configuration reference</b></summary>
|
|
196
|
+
|
|
197
|
+
| Variable | Default | Purpose |
|
|
198
|
+
|---|---|---|
|
|
199
|
+
| `MARTHOUSE_MODE` | `local` | `local` (one person, 127.0.0.1 only) or `hosted` (accounts and workspaces) |
|
|
200
|
+
| `MARTHOUSE_DATA_DIR` | OS app-data folder | Database, private tool installs, hosted checkouts |
|
|
201
|
+
| `MARTHOUSE_DATABASE_URL` | SQLite in the data dir | e.g. `postgresql+psycopg://…` |
|
|
202
|
+
| `MARTHOUSE_SECRET_KEY` | generated | Fernet key that encrypts stored secrets (hosted) |
|
|
203
|
+
| `MARTHOUSE_USE_QUEUE` | `false` | Hosted: run jobs in the worker through Redis |
|
|
204
|
+
| `MARTHOUSE_JOB_TIMEOUT_S` | `3600` | Longest a single job may run. Memory is limited by the worker container (see `docker-compose.yml`). |
|
|
205
|
+
|
|
206
|
+
</details>
|
|
207
|
+
|
|
208
|
+
## FAQ
|
|
209
|
+
|
|
210
|
+
<details>
|
|
211
|
+
<summary><b>Is this a replacement for dbt Cloud?</b></summary>
|
|
212
|
+
|
|
213
|
+
No. It's a free, open-source app for **dbt Core**, the open-source engine. It covers the everyday work (editing, running, testing, lineage, docs, scheduling) and adds loading with dlt. It doesn't include dbt Cloud features like the semantic layer service or dbt Fusion; if Marthouse finds Fusion it says so and keeps using Core.
|
|
214
|
+
</details>
|
|
215
|
+
|
|
216
|
+
<details>
|
|
217
|
+
<summary><b>Will it change my project?</b></summary>
|
|
218
|
+
|
|
219
|
+
Only when you ask it to: saving a model, editing docs or tests, or creating a pipeline writes ordinary files, the same ones you'd write by hand. Everything stays a normal dbt project and normal dlt scripts, ready for code review and CI.
|
|
220
|
+
</details>
|
|
221
|
+
|
|
222
|
+
<details>
|
|
223
|
+
<summary><b>Which warehouses does it work with?</b></summary>
|
|
224
|
+
|
|
225
|
+
Any adapter dbt Core supports: DuckDB, Postgres, Snowflake, BigQuery, Redshift, Databricks, SQL Server, Trino and more. dlt can load into any destination it supports; when a pipeline loads into your dbt connection, Marthouse reuses those credentials.
|
|
226
|
+
</details>
|
|
227
|
+
|
|
228
|
+
<details>
|
|
229
|
+
<summary><b>Does my data leave my machine?</b></summary>
|
|
230
|
+
|
|
231
|
+
Not in local mode. Marthouse runs dbt and dlt on your computer, listens on `127.0.0.1` only, and keeps passwords in the OS keychain. It sends no telemetry of its own, and turns off dbt's and dlt's anonymous usage stats for the jobs it runs.
|
|
232
|
+
</details>
|
|
233
|
+
|
|
234
|
+
<details>
|
|
235
|
+
<summary><b>Does it work on Windows?</b></summary>
|
|
236
|
+
|
|
237
|
+
Yes. Marthouse runs natively on Windows, macOS and Linux, and every change is tested on all three, including real dbt and dlt runs on Windows and Linux. It finds dbt in project `.venv` folders, on your PATH, and in pipx, uv and conda environments, and the Windows folder picker and "open in terminal" work too. Team mode's Docker setup runs on Linux servers.
|
|
238
|
+
</details>
|
|
239
|
+
|
|
240
|
+
## Roadmap
|
|
241
|
+
|
|
242
|
+
- [x] dbt: find or install, models, lineage, runs, tests, docs, freshness, connections
|
|
243
|
+
- [x] dlt: REST API, SQL, files and verified sources; schema, loads and state; dbt source generation
|
|
244
|
+
- [x] Visual model builder with live previews
|
|
245
|
+
- [x] Schedules with failure alerts
|
|
246
|
+
- [x] Self-hosted team mode with workspaces and roles
|
|
247
|
+
- [x] One-line install from PyPI (`uvx marthouse`)
|
|
248
|
+
- [ ] Turn hand-written SQL into builder steps
|
|
249
|
+
- [ ] dbt projects inside a subfolder of the repository
|
|
250
|
+
- [ ] Database migrations for upgrades (Alembic)
|
|
251
|
+
- [x] Windows, macOS and Linux
|
|
252
|
+
- [ ] Desktop builds
|
|
253
|
+
- [ ] More tools: SQLFluff, a dbt packages browser
|
|
254
|
+
|
|
255
|
+
Have an idea? [Open a feature request](https://github.com/godalida/marthouse/issues/new?template=feature_request.yml).
|
|
256
|
+
|
|
257
|
+
## Contributing
|
|
258
|
+
|
|
259
|
+
Contributions are welcome, from typo fixes to whole new tools. Start with [CONTRIBUTING.md](https://github.com/godalida/marthouse/blob/main/CONTRIBUTING.md). The end-to-end tests use a local DuckDB file, so you don't need a warehouse to work on Marthouse.
|
|
260
|
+
|
|
261
|
+
- [Report a bug](https://github.com/godalida/marthouse/issues/new?template=bug_report.yml)
|
|
262
|
+
- [Suggest a feature](https://github.com/godalida/marthouse/issues/new?template=feature_request.yml)
|
|
263
|
+
- [Report a security problem](https://github.com/godalida/marthouse/blob/main/SECURITY.md) privately
|
|
264
|
+
- [Code of conduct](https://github.com/godalida/marthouse/blob/main/CODE_OF_CONDUCT.md) · [Changelog](https://github.com/godalida/marthouse/blob/main/CHANGELOG.md)
|
|
265
|
+
|
|
266
|
+
## Acknowledgements
|
|
267
|
+
|
|
268
|
+
Marthouse stands on two excellent open-source projects:
|
|
269
|
+
- [dbt Core](https://github.com/dbt-labs/dbt-core) by dbt Labs;
|
|
270
|
+
- [dlt](https://github.com/dlt-hub/dlt) by dltHub.
|
|
271
|
+
|
|
272
|
+
It installs them with [uv](https://github.com/astral-sh/uv) from Astral.
|
|
273
|
+
|
|
274
|
+
"dbt" is a trademark of dbt Labs, Inc. "dlt" and "dltHub" are trademarks of their owner. Marthouse isn't affiliated with or endorsed by either company.
|
|
275
|
+
|
|
276
|
+
## License
|
|
277
|
+
|
|
278
|
+
[Apache 2.0](https://github.com/godalida/marthouse/blob/main/LICENSE). Use it, change it, ship it.
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/assets/banner.svg" alt="Marthouse: load, transform and explore your data in one app" width="100%">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://github.com/godalida/marthouse/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/godalida/marthouse/actions/workflows/ci.yml/badge.svg?branch=main"></a>
|
|
7
|
+
<a href="https://github.com/godalida/marthouse/blob/main/LICENSE"><img alt="License: Apache 2.0" src="https://img.shields.io/badge/license-Apache%202.0-5B5BD6?style=flat-square"></a>
|
|
8
|
+
<img alt="Python 3.11+" src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white">
|
|
9
|
+
<a href="https://pypi.org/project/marthouse/"><img alt="PyPI" src="https://img.shields.io/pypi/v/marthouse?style=flat-square&color=5B5BD6"></a>
|
|
10
|
+
<img alt="dbt Core 1.8+" src="https://img.shields.io/badge/dbt%20Core-1.8%2B-5B5BD6?style=flat-square">
|
|
11
|
+
<img alt="dlt 1.x" src="https://img.shields.io/badge/dlt-1.x-5B5BD6?style=flat-square">
|
|
12
|
+
<a href="https://github.com/godalida/marthouse/blob/main/CONTRIBUTING.md"><img alt="PRs welcome" src="https://img.shields.io/badge/PRs-welcome-2EA44F?style=flat-square"></a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<h3 align="center">The open-source app for dbt Core and dlt.</h3>
|
|
16
|
+
|
|
17
|
+
<p align="center">
|
|
18
|
+
Load data from APIs, databases and files. Transform it with tested models. Explore the results.<br>
|
|
19
|
+
All in one app, without living in a terminal, and without giving up the plain files your team reviews in Git.
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
<p align="center">
|
|
23
|
+
<a href="#install"><b>Install</b></a> ·
|
|
24
|
+
<a href="#features"><b>Features</b></a> ·
|
|
25
|
+
<a href="#how-it-works"><b>How it works</b></a> ·
|
|
26
|
+
<a href="#run-it-for-a-team"><b>Run it for a team</b></a> ·
|
|
27
|
+
<a href="#faq"><b>FAQ</b></a> ·
|
|
28
|
+
<a href="https://github.com/godalida/marthouse/blob/main/CONTRIBUTING.md"><b>Contribute</b></a>
|
|
29
|
+
</p>
|
|
30
|
+
|
|
31
|
+
<p align="center">
|
|
32
|
+
<img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/assets/demo.gif" alt="A 40-second tour: a dlt pipeline's tables, the lineage graph with a model's impact, the model builder previewing rows after each step, a SQL query with ref(), and the docs catalog" width="100%">
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
## Why Marthouse?
|
|
36
|
+
|
|
37
|
+
dbt and dlt are excellent tools that only speak command line. That's fine for engineers and a wall for everyone else on a data team. Marthouse puts a real interface on them without hiding what they do.
|
|
38
|
+
|
|
39
|
+
- **Learn the tool by using it.** Every run shows the exact `dbt` or `dlt` command it ran. Every visual step opens as the SQL it writes.
|
|
40
|
+
- **No lock-in.** Your project stays a normal dbt project and normal dlt scripts. Close Marthouse and everything still runs from the terminal or CI.
|
|
41
|
+
- **Zero setup.** Marthouse finds dbt on your machine (project `.venv`, PATH, pipx, uv, Homebrew, conda) or installs a private copy with [uv](https://docs.astral.sh/uv/).
|
|
42
|
+
- **Your data stays put.** Locally, the app only listens on `127.0.0.1` and keeps passwords in your OS keychain, never in files.
|
|
43
|
+
|
|
44
|
+
### Who it's for
|
|
45
|
+
|
|
46
|
+
| If you are… | Marthouse gives you… |
|
|
47
|
+
|---|---|
|
|
48
|
+
| **A data analyst** who knows SQL but not the dbt CLI | A model builder that writes the SQL for you, a scratchpad with `ref()`, and docs you edit like a form |
|
|
49
|
+
| **An analytics engineer** | Lineage and impact before you change a model, fast previews, runs you can read, tests at a glance |
|
|
50
|
+
| **A BI developer** | One place to see where every dashboard number comes from, back to the API it was loaded from |
|
|
51
|
+
| **A small data team** | Loading, transforming and scheduling in one tool, self-hosted, on files you already keep in Git |
|
|
52
|
+
|
|
53
|
+
## Install
|
|
54
|
+
|
|
55
|
+
**Requirements:** macOS, Windows or Linux, and [uv](https://docs.astral.sh/uv/getting-started/installation/), which fetches Python 3.11+ if you don't have it. You don't need dbt or dlt; Marthouse installs them if they're missing.
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
uvx marthouse # run it once, without installing
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Or install the `marthouse` command with `uv tool install marthouse`, `pipx install marthouse` or `pip install marthouse`. To run it from source, see [CONTRIBUTING.md](https://github.com/godalida/marthouse/blob/main/CONTRIBUTING.md).
|
|
62
|
+
|
|
63
|
+
Your browser opens Marthouse, and the first run walks you through it:
|
|
64
|
+
|
|
65
|
+
1. **Find dbt.** Marthouse looks on your machine, or installs a private copy with the adapters you pick.
|
|
66
|
+
2. **Open a project.** Use your own, or try [`examples/jaffle_shop_duckdb`](https://github.com/godalida/marthouse/blob/main/examples/jaffle_shop_duckdb), which needs no warehouse.
|
|
67
|
+
3. **Check the connection.** Marthouse runs `dbt debug` and shows each check.
|
|
68
|
+
4. **Build.**
|
|
69
|
+
|
|
70
|
+
> [!TIP]
|
|
71
|
+
> The example project includes a dlt pipeline, `shop_files`, that loads its CSV files into the same DuckDB database dbt uses. Load → Transform → Explore end to end takes a couple of minutes.
|
|
72
|
+
|
|
73
|
+
## Features
|
|
74
|
+
|
|
75
|
+
### Load: pipelines with dlt
|
|
76
|
+
|
|
77
|
+
<img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/screenshots/pipelines.png" alt="A dlt pipeline: last load, rows per table, and a button to create dbt sources" width="100%">
|
|
78
|
+
|
|
79
|
+
- Build loaders for **REST APIs, SQL databases, files and buckets**, or any of dltHub's **verified sources**, with forms instead of code.
|
|
80
|
+
- **Try request** shows the API's JSON so you can point at the rows you want.
|
|
81
|
+
- Loads only what's new, keeps the schema up to date, and shows rows per table, load history and incremental state.
|
|
82
|
+
- **Create dbt sources** from a pipeline in one click, and load straight into your dbt connection so one set of credentials serves both tools.
|
|
83
|
+
- Every pipeline is a readable Python file in `pipelines/` that runs without Marthouse.
|
|
84
|
+
|
|
85
|
+
### Transform: models, builder and lineage
|
|
86
|
+
|
|
87
|
+
<table>
|
|
88
|
+
<tr>
|
|
89
|
+
<td width="50%"><img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/screenshots/builder.png" alt="The model builder: four steps with the resulting rows"></td>
|
|
90
|
+
<td width="50%"><img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/screenshots/lineage.png" alt="Lineage graph from pipeline to exposure"></td>
|
|
91
|
+
</tr>
|
|
92
|
+
<tr>
|
|
93
|
+
<td valign="top"><b>Model builder.</b> Start from a model or source, then filter, join, calculate, group and sort. See the rows after every step. It saves a normal dbt model you can open as SQL at any time.</td>
|
|
94
|
+
<td valign="top"><b>Lineage.</b> One graph from pipeline to dashboard. Select a node to see what a change would affect, then build it and everything downstream. Selectors like <code>+orders</code> and <code>tag:finance</code> work in search.</td>
|
|
95
|
+
</tr>
|
|
96
|
+
<tr>
|
|
97
|
+
<td width="50%"><img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/screenshots/models.png" alt="The models editor with compiled SQL and inspector"></td>
|
|
98
|
+
<td width="50%"><img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/screenshots/tests.png" alt="Tests with coverage and failing rows"></td>
|
|
99
|
+
</tr>
|
|
100
|
+
<tr>
|
|
101
|
+
<td valign="top"><b>Models.</b> A SQL editor with Jinja highlighting, the compiled SQL, row previews with <code>dbt show</code>, and an inspector with refs, tests and the last run.</td>
|
|
102
|
+
<td valign="top"><b>Runs and tests.</b> A live node timeline, logs, and errors explained in plain words. Test coverage at a glance, the failing rows, and one-click re-runs.</td>
|
|
103
|
+
</tr>
|
|
104
|
+
</table>
|
|
105
|
+
|
|
106
|
+
### Explore: SQL, docs and freshness
|
|
107
|
+
|
|
108
|
+
<img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/screenshots/catalog.png" alt="Docs and catalog: columns, descriptions and tests for a model" width="100%">
|
|
109
|
+
|
|
110
|
+
- **Docs and tests without YAML.** Edit descriptions and tick tests (unique, not null, accepted values, relationships). Marthouse writes the YAML and keeps your comments.
|
|
111
|
+
- **SQL scratchpad** with `ref()` and `source()`, query history, CSV download and **Save as model**.
|
|
112
|
+
- **Source freshness** against your thresholds, and a **staging-model generator** for any source table.
|
|
113
|
+
|
|
114
|
+
### And the rest of the job
|
|
115
|
+
|
|
116
|
+
- **Schedules:** "load, then build, every weekday at 6:00", with a webhook alert when it fails.
|
|
117
|
+
- **Connections:** forms that write `profiles.yml`, with secrets in the keychain.
|
|
118
|
+
- **⌘K command palette** for every model, screen and command.
|
|
119
|
+
- **Light and dark** themes, in a native macOS-style interface.
|
|
120
|
+
|
|
121
|
+
## How it works
|
|
122
|
+
|
|
123
|
+
<p align="center">
|
|
124
|
+
<img src="https://raw.githubusercontent.com/godalida/marthouse/main/docs/assets/how-it-works.svg" alt="Sources are loaded by dlt pipelines into your warehouse, dbt models transform them, and you explore the results; schedules run it all" width="100%">
|
|
125
|
+
</p>
|
|
126
|
+
|
|
127
|
+
Marthouse is a FastAPI server and a React app. It runs the real tools as separate processes and reads the files they write: dbt's `manifest.json`, `run_results.json` and `catalog.json`, and dlt's pipeline state. It never reimplements them.
|
|
128
|
+
|
|
129
|
+
| Works with | Support |
|
|
130
|
+
|---|---|
|
|
131
|
+
| **dbt Core** | 1.8 and newer, any adapter: DuckDB, Postgres, Snowflake, BigQuery, Redshift, Databricks, SQL Server, Trino |
|
|
132
|
+
| **dlt** | 1.x: REST API, SQL database and filesystem sources, plus dltHub verified sources |
|
|
133
|
+
| **Destinations** | Anything both tools support. A pipeline can load straight into your dbt connection, so one set of credentials serves both. |
|
|
134
|
+
| **dbt Fusion** | Detected and reported. Marthouse works with dbt Core. |
|
|
135
|
+
|
|
136
|
+
## Run it for a team
|
|
137
|
+
|
|
138
|
+
Marthouse also runs as a shared web app with accounts, workspaces and roles (viewer, member, admin, owner). Projects are cloned from Git, and dbt and dlt run in a separate worker.
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
cp docker/.env.example docker/.env # set POSTGRES_PASSWORD and MARTHOUSE_SECRET_KEY
|
|
142
|
+
docker compose -f docker/docker-compose.yml --env-file docker/.env up --build
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
That starts the web app, a job worker, Postgres and Redis. Put TLS in front and set `MARTHOUSE_COOKIE_SECURE=true`. See [`docker/.env.example`](https://github.com/godalida/marthouse/blob/main/docker/.env.example) for every setting.
|
|
146
|
+
|
|
147
|
+
<details>
|
|
148
|
+
<summary><b>Configuration reference</b></summary>
|
|
149
|
+
|
|
150
|
+
| Variable | Default | Purpose |
|
|
151
|
+
|---|---|---|
|
|
152
|
+
| `MARTHOUSE_MODE` | `local` | `local` (one person, 127.0.0.1 only) or `hosted` (accounts and workspaces) |
|
|
153
|
+
| `MARTHOUSE_DATA_DIR` | OS app-data folder | Database, private tool installs, hosted checkouts |
|
|
154
|
+
| `MARTHOUSE_DATABASE_URL` | SQLite in the data dir | e.g. `postgresql+psycopg://…` |
|
|
155
|
+
| `MARTHOUSE_SECRET_KEY` | generated | Fernet key that encrypts stored secrets (hosted) |
|
|
156
|
+
| `MARTHOUSE_USE_QUEUE` | `false` | Hosted: run jobs in the worker through Redis |
|
|
157
|
+
| `MARTHOUSE_JOB_TIMEOUT_S` | `3600` | Longest a single job may run. Memory is limited by the worker container (see `docker-compose.yml`). |
|
|
158
|
+
|
|
159
|
+
</details>
|
|
160
|
+
|
|
161
|
+
## FAQ
|
|
162
|
+
|
|
163
|
+
<details>
|
|
164
|
+
<summary><b>Is this a replacement for dbt Cloud?</b></summary>
|
|
165
|
+
|
|
166
|
+
No. It's a free, open-source app for **dbt Core**, the open-source engine. It covers the everyday work (editing, running, testing, lineage, docs, scheduling) and adds loading with dlt. It doesn't include dbt Cloud features like the semantic layer service or dbt Fusion; if Marthouse finds Fusion it says so and keeps using Core.
|
|
167
|
+
</details>
|
|
168
|
+
|
|
169
|
+
<details>
|
|
170
|
+
<summary><b>Will it change my project?</b></summary>
|
|
171
|
+
|
|
172
|
+
Only when you ask it to: saving a model, editing docs or tests, or creating a pipeline writes ordinary files, the same ones you'd write by hand. Everything stays a normal dbt project and normal dlt scripts, ready for code review and CI.
|
|
173
|
+
</details>
|
|
174
|
+
|
|
175
|
+
<details>
|
|
176
|
+
<summary><b>Which warehouses does it work with?</b></summary>
|
|
177
|
+
|
|
178
|
+
Any adapter dbt Core supports: DuckDB, Postgres, Snowflake, BigQuery, Redshift, Databricks, SQL Server, Trino and more. dlt can load into any destination it supports; when a pipeline loads into your dbt connection, Marthouse reuses those credentials.
|
|
179
|
+
</details>
|
|
180
|
+
|
|
181
|
+
<details>
|
|
182
|
+
<summary><b>Does my data leave my machine?</b></summary>
|
|
183
|
+
|
|
184
|
+
Not in local mode. Marthouse runs dbt and dlt on your computer, listens on `127.0.0.1` only, and keeps passwords in the OS keychain. It sends no telemetry of its own, and turns off dbt's and dlt's anonymous usage stats for the jobs it runs.
|
|
185
|
+
</details>
|
|
186
|
+
|
|
187
|
+
<details>
|
|
188
|
+
<summary><b>Does it work on Windows?</b></summary>
|
|
189
|
+
|
|
190
|
+
Yes. Marthouse runs natively on Windows, macOS and Linux, and every change is tested on all three, including real dbt and dlt runs on Windows and Linux. It finds dbt in project `.venv` folders, on your PATH, and in pipx, uv and conda environments, and the Windows folder picker and "open in terminal" work too. Team mode's Docker setup runs on Linux servers.
|
|
191
|
+
</details>
|
|
192
|
+
|
|
193
|
+
## Roadmap
|
|
194
|
+
|
|
195
|
+
- [x] dbt: find or install, models, lineage, runs, tests, docs, freshness, connections
|
|
196
|
+
- [x] dlt: REST API, SQL, files and verified sources; schema, loads and state; dbt source generation
|
|
197
|
+
- [x] Visual model builder with live previews
|
|
198
|
+
- [x] Schedules with failure alerts
|
|
199
|
+
- [x] Self-hosted team mode with workspaces and roles
|
|
200
|
+
- [x] One-line install from PyPI (`uvx marthouse`)
|
|
201
|
+
- [ ] Turn hand-written SQL into builder steps
|
|
202
|
+
- [ ] dbt projects inside a subfolder of the repository
|
|
203
|
+
- [ ] Database migrations for upgrades (Alembic)
|
|
204
|
+
- [x] Windows, macOS and Linux
|
|
205
|
+
- [ ] Desktop builds
|
|
206
|
+
- [ ] More tools: SQLFluff, a dbt packages browser
|
|
207
|
+
|
|
208
|
+
Have an idea? [Open a feature request](https://github.com/godalida/marthouse/issues/new?template=feature_request.yml).
|
|
209
|
+
|
|
210
|
+
## Contributing
|
|
211
|
+
|
|
212
|
+
Contributions are welcome, from typo fixes to whole new tools. Start with [CONTRIBUTING.md](https://github.com/godalida/marthouse/blob/main/CONTRIBUTING.md). The end-to-end tests use a local DuckDB file, so you don't need a warehouse to work on Marthouse.
|
|
213
|
+
|
|
214
|
+
- [Report a bug](https://github.com/godalida/marthouse/issues/new?template=bug_report.yml)
|
|
215
|
+
- [Suggest a feature](https://github.com/godalida/marthouse/issues/new?template=feature_request.yml)
|
|
216
|
+
- [Report a security problem](https://github.com/godalida/marthouse/blob/main/SECURITY.md) privately
|
|
217
|
+
- [Code of conduct](https://github.com/godalida/marthouse/blob/main/CODE_OF_CONDUCT.md) · [Changelog](https://github.com/godalida/marthouse/blob/main/CHANGELOG.md)
|
|
218
|
+
|
|
219
|
+
## Acknowledgements
|
|
220
|
+
|
|
221
|
+
Marthouse stands on two excellent open-source projects:
|
|
222
|
+
- [dbt Core](https://github.com/dbt-labs/dbt-core) by dbt Labs;
|
|
223
|
+
- [dlt](https://github.com/dlt-hub/dlt) by dltHub.
|
|
224
|
+
|
|
225
|
+
It installs them with [uv](https://github.com/astral-sh/uv) from Astral.
|
|
226
|
+
|
|
227
|
+
"dbt" is a trademark of dbt Labs, Inc. "dlt" and "dltHub" are trademarks of their owner. Marthouse isn't affiliated with or endorsed by either company.
|
|
228
|
+
|
|
229
|
+
## License
|
|
230
|
+
|
|
231
|
+
[Apache 2.0](https://github.com/godalida/marthouse/blob/main/LICENSE). Use it, change it, ship it.
|
|
@@ -8,6 +8,7 @@ from fastapi import APIRouter, Depends, HTTPException
|
|
|
8
8
|
from pydantic import BaseModel
|
|
9
9
|
from sqlalchemy.orm import Session
|
|
10
10
|
|
|
11
|
+
from ..oscompat import exe, venv_bin
|
|
11
12
|
from .. import appsettings, jobs
|
|
12
13
|
from ..config import get_settings
|
|
13
14
|
from ..db import get_db
|
|
@@ -73,7 +74,7 @@ async def inspect(body: PathBody, c: Ctx = Depends(need("admin")), db: Session =
|
|
|
73
74
|
raise HTTPException(404)
|
|
74
75
|
p = Path(body.path).expanduser()
|
|
75
76
|
if p.is_dir():
|
|
76
|
-
p = p
|
|
77
|
+
p = venv_bin(p, "dbt") if venv_bin(p, "dbt").exists() else p / exe("dbt")
|
|
77
78
|
private = get_settings().private_dbt_dir.resolve()
|
|
78
79
|
kind = "private" if private in p.resolve().parents else "project" if ".venv" in p.parts else "custom"
|
|
79
80
|
inst = await asyncio.to_thread(detect.inspect, str(p), kind)
|
|
@@ -80,7 +80,7 @@ def get_pipeline(name: str, p: Project = Depends(get_project), db: Session = Dep
|
|
|
80
80
|
secrets = [{**f, "stored": secrets_store.has_secret(db, p.workspace_id, codegen.secret_env(name, f["key"]))}
|
|
81
81
|
for f in codegen.secret_fields(spec)]
|
|
82
82
|
return {"spec": spec, "summary": _summary(db, p, spec), "inspect": service.cached(p, name),
|
|
83
|
-
"code": script.read_text() if script.exists() else "", "script": script.name, "secrets": secrets}
|
|
83
|
+
"code": script.read_text(encoding="utf-8") if script.exists() else "", "script": script.name, "secrets": secrets}
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
@router.put("/{name}")
|
|
@@ -245,7 +245,7 @@ def verified_refresh(name: str, p: Project = Depends(get_project), c: Ctx = Depe
|
|
|
245
245
|
script = service.script_path(p, spec)
|
|
246
246
|
if not script.exists():
|
|
247
247
|
raise HTTPException(409, "dlt init hasn't written the script yet.")
|
|
248
|
-
m = re.findall(r'pipeline_name\s*=\s*["\']([A-Za-z0-9_]+)["\']', script.read_text())
|
|
248
|
+
m = re.findall(r'pipeline_name\s*=\s*["\']([A-Za-z0-9_]+)["\']', script.read_text(encoding="utf-8"))
|
|
249
249
|
v["pipeline_name"] = m[0] if m else v.get("pipeline_name") or name
|
|
250
250
|
v["secret_keys"] = service.read_verified_secrets(p, v["source"])
|
|
251
251
|
spec["verified"] = v
|
|
@@ -8,6 +8,7 @@ from fastapi import APIRouter, Depends, HTTPException
|
|
|
8
8
|
from pydantic import BaseModel
|
|
9
9
|
from sqlalchemy.orm import Session
|
|
10
10
|
|
|
11
|
+
from ..oscompat import venv_bin
|
|
11
12
|
from .. import appsettings, jobs, projects, secrets_store
|
|
12
13
|
from ..config import get_settings
|
|
13
14
|
from ..db import get_db
|
|
@@ -43,7 +44,7 @@ def project_dict(db: Session, p: Project, full: bool = False) -> dict:
|
|
|
43
44
|
except jobs.JobError as e:
|
|
44
45
|
d["dbt"], d["dbt_missing"], d["dbt_error"] = None, True, str(e)
|
|
45
46
|
d["dbt_override"] = p.dbt_path
|
|
46
|
-
d["venv_has_dbt"] = (Path(p.path) / ".venv"
|
|
47
|
+
d["venv_has_dbt"] = venv_bin(Path(p.path) / ".venv", "dbt").exists()
|
|
47
48
|
d["venv_exists"] = (Path(p.path) / ".venv").exists()
|
|
48
49
|
d["requirements"] = (Path(p.path) / "requirements.txt").exists()
|
|
49
50
|
d["profiles_path"] = str(jobs.profiles_path(p)) if not get_settings().hosted else "profiles.yml"
|
|
@@ -61,12 +61,17 @@ def _local_only() -> None:
|
|
|
61
61
|
|
|
62
62
|
@router.post("/choose-folder")
|
|
63
63
|
def choose_folder(_: Ctx = Depends(ctx)) -> dict:
|
|
64
|
-
"""Native folder picker (macOS) for Open Project and offline installs."""
|
|
64
|
+
"""Native folder picker (macOS and Windows) for Open Project and offline installs."""
|
|
65
65
|
_local_only()
|
|
66
|
+
if sys.platform == "win32":
|
|
67
|
+
ps = ("[Console]::OutputEncoding = [Text.Encoding]::UTF8; Add-Type -AssemblyName System.Windows.Forms; $f = New-Object System.Windows.Forms.FolderBrowserDialog; "
|
|
68
|
+
"$f.Description = 'Choose a folder'; if ($f.ShowDialog() -eq 'OK') { $f.SelectedPath }")
|
|
69
|
+
r = subprocess.run(["powershell", "-NoProfile", "-STA", "-Command", ps], capture_output=True, text=True, encoding="utf-8", errors="replace", timeout=600)
|
|
70
|
+
return {"path": r.stdout.strip() or None}
|
|
66
71
|
if sys.platform != "darwin":
|
|
67
72
|
raise HTTPException(501, "Type the folder path instead.")
|
|
68
73
|
r = subprocess.run(["osascript", "-e", 'POSIX path of (choose folder with prompt "Choose a folder")'],
|
|
69
|
-
capture_output=True, text=True, timeout=600)
|
|
74
|
+
capture_output=True, text=True, encoding="utf-8", errors="replace", timeout=600)
|
|
70
75
|
if r.returncode != 0:
|
|
71
76
|
return {"path": None}
|
|
72
77
|
return {"path": r.stdout.strip().rstrip("/") or "/"}
|
|
@@ -98,6 +103,8 @@ def reveal(body: PathBody, _: Ctx = Depends(ctx)) -> dict:
|
|
|
98
103
|
_local_only()
|
|
99
104
|
if sys.platform == "darwin":
|
|
100
105
|
subprocess.Popen(["open", "-R", body.path])
|
|
106
|
+
elif sys.platform == "win32":
|
|
107
|
+
subprocess.Popen(["explorer", f"/select,{body.path}"])
|
|
101
108
|
return {"ok": True}
|
|
102
109
|
|
|
103
110
|
|
|
@@ -107,4 +114,6 @@ def terminal(body: PathBody, c: Ctx = Depends(ctx), db: Session = Depends(get_db
|
|
|
107
114
|
app = appsettings.get(db, "terminal_app", c.ws) or "Terminal"
|
|
108
115
|
if sys.platform == "darwin":
|
|
109
116
|
subprocess.Popen(["open", "-a", app, body.path])
|
|
117
|
+
elif sys.platform == "win32" and Path(body.path).is_dir():
|
|
118
|
+
subprocess.Popen(["cmd.exe"], cwd=body.path, creationflags=subprocess.CREATE_NEW_CONSOLE)
|
|
110
119
|
return {"ok": True}
|