murakumo 0.0.2 → 0.1.0

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.
package/README.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Murakumo
2
2
 
3
- **Model-first data engineering.** Design the logical model (entities, relationships, mappings) on a canvas, and Murakumo generates and maintains everything downstream: DDL, dbt projects, Spark and Python jobs, streaming configs, tests, audit tables, data contracts and orchestration, on an open lakehouse.
3
+ **Model-first data engineering.** Design the logical model (entities, relationships, mappings) on a
4
+ canvas, and Murakumo generates and maintains what comes after it: dbt projects, DDL, tests and
5
+ migrations, verified on DuckDB or Snowflake.
4
6
 
5
- This is an early placeholder release that reserves the package name. The engine and CLI ship on PyPI as [`murakumo`](https://pypi.org/project/murakumo/); this npm package will host the JavaScript SDK and canvas components.
7
+ Murakumo is a Python program, [published on PyPI](https://pypi.org/project/murakumo/). This npm
8
+ package gives you the same `murakumo` command, and runs it through [uv](https://docs.astral.sh/uv/),
9
+ which downloads Python and Murakumo the first time. You only need uv:
10
+
11
+ ```bash
12
+ brew install uv # or: curl -LsSf https://astral.sh/uv/install.sh | sh
13
+ ```
14
+
15
+ Then:
16
+
17
+ ```bash
18
+ npx murakumo init my_platform # or: npm install -g murakumo, then murakumo init my_platform
19
+ cd my_platform
20
+ npx murakumo setup # checks what the project needs and says how to set it up
21
+ npx murakumo canvas # the visual editor
22
+ ```
23
+
24
+ The first run takes a minute while uv downloads everything; later runs start straight away.
25
+
26
+ For Snowflake or Postgres, `murakumo setup` tells you what to add, for example:
27
+
28
+ ```bash
29
+ export MURAKUMO_EXTRAS="snowflake" MURAKUMO_WITH="dbt-snowflake"
30
+ ```
31
+
32
+ Documentation: [github.com/murakumo-data/murakumo](https://github.com/murakumo-data/murakumo).
package/bin/murakumo.js CHANGED
@@ -1,2 +1,66 @@
1
1
  #!/usr/bin/env node
2
- console.log("murakumo 0.0.2: model-first data engineering. Coming soon. The engine ships on PyPI: pip install murakumo");
2
+ // The `murakumo` command for npm users. Murakumo itself is a Python program (published on PyPI);
3
+ // this runs the same version of it through uv's `uvx`, which downloads Python and Murakumo the
4
+ // first time and reuses them after that. Nothing else to install but uv.
5
+ //
6
+ // npx murakumo init my_platform
7
+ // npm install -g murakumo && murakumo canvas
8
+ //
9
+ // MURAKUMO_EXTRAS adds extras (e.g. "snowflake,postgres") and MURAKUMO_WITH adds packages
10
+ // (e.g. "dbt-snowflake"); `murakumo setup` says when a project needs them. MURAKUMO_SPEC replaces
11
+ // the whole requirement, for testing an unpublished build.
12
+ "use strict";
13
+
14
+ const { spawnSync } = require("node:child_process");
15
+ const { version } = require("../package.json");
16
+
17
+ const BASE_EXTRAS = ["canvas", "verify", "duckdb"];
18
+
19
+ function list(value, separator) {
20
+ return (value || "")
21
+ .split(separator)
22
+ .map((item) => item.trim())
23
+ .filter(Boolean);
24
+ }
25
+
26
+ function requirement() {
27
+ if (process.env.MURAKUMO_SPEC) return process.env.MURAKUMO_SPEC;
28
+ const extras = [...new Set([...BASE_EXTRAS, ...list(process.env.MURAKUMO_EXTRAS, ",")])].sort();
29
+ return `murakumo[${extras.join(",")}]==${version}`;
30
+ }
31
+
32
+ function found(command) {
33
+ const result = spawnSync(command, ["--version"], { stdio: "ignore" });
34
+ return !result.error && result.status === 0;
35
+ }
36
+
37
+ if (!found("uvx")) {
38
+ console.error(
39
+ [
40
+ "Murakumo runs on Python, and the npm package starts it with uv. Install uv first:",
41
+ "",
42
+ " macOS: brew install uv",
43
+ " macOS / Linux: curl -LsSf https://astral.sh/uv/install.sh | sh",
44
+ ' Windows: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"',
45
+ "",
46
+ "Then open a new terminal and run the murakumo command again.",
47
+ "Or install it with pip instead: pip install \"murakumo[canvas,verify,duckdb]\"",
48
+ ].join("\n"),
49
+ );
50
+ process.exit(1);
51
+ }
52
+
53
+ const args = ["--from", requirement()];
54
+ for (const extra of list(process.env.MURAKUMO_WITH, /[\s,]+/)) args.push("--with", extra);
55
+ args.push("murakumo", ...process.argv.slice(2));
56
+
57
+ const result = spawnSync("uvx", args, {
58
+ stdio: "inherit",
59
+ // Lets `murakumo setup` give install advice that works through this launcher.
60
+ env: { ...process.env, MURAKUMO_LAUNCHER: "npm" },
61
+ });
62
+ if (result.error) {
63
+ console.error(`Could not start uvx: ${result.error.message}`);
64
+ process.exit(1);
65
+ }
66
+ process.exit(result.status === null ? 1 : result.status);
package/package.json CHANGED
@@ -1,8 +1,15 @@
1
1
  {
2
2
  "name": "murakumo",
3
- "version": "0.0.2",
4
- "description": "Model-first data engineering: design the logical model, generate the platform. Early placeholder release.",
5
- "keywords": ["data-engineering", "data-modelling", "dbt", "lakehouse", "iceberg", "code-generation"],
3
+ "version": "0.1.0",
4
+ "description": "Model-first data engineering: design the logical model, generate the platform. Runs the Murakumo CLI from PyPI through uv.",
5
+ "keywords": [
6
+ "data-engineering",
7
+ "data-modelling",
8
+ "dbt",
9
+ "lakehouse",
10
+ "iceberg",
11
+ "code-generation"
12
+ ],
6
13
  "license": "Apache-2.0",
7
14
  "homepage": "https://github.com/murakumo-data/murakumo",
8
15
  "repository": {
@@ -13,5 +20,11 @@
13
20
  "bin": {
14
21
  "murakumo": "bin/murakumo.js"
15
22
  },
16
- "files": ["bin", "README.md"]
23
+ "files": [
24
+ "bin",
25
+ "README.md"
26
+ ],
27
+ "engines": {
28
+ "node": ">=18"
29
+ }
17
30
  }