entropy-data 0.3.24__tar.gz → 0.3.25__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.
Files changed (109) hide show
  1. {entropy_data-0.3.24 → entropy_data-0.3.25}/.github/workflows/ci.yaml +2 -2
  2. {entropy_data-0.3.24 → entropy_data-0.3.25}/.github/workflows/release.yaml +1 -1
  3. {entropy_data-0.3.24 → entropy_data-0.3.25}/.pre-commit-config.yaml +1 -1
  4. {entropy_data-0.3.24 → entropy_data-0.3.25}/CHANGELOG.md +22 -0
  5. {entropy_data-0.3.24 → entropy_data-0.3.25}/CLAUDE.md +3 -3
  6. {entropy_data-0.3.24 → entropy_data-0.3.25}/Dockerfile +1 -1
  7. {entropy_data-0.3.24 → entropy_data-0.3.25}/PKG-INFO +49 -9
  8. {entropy_data-0.3.24 → entropy_data-0.3.25}/README.md +44 -5
  9. {entropy_data-0.3.24 → entropy_data-0.3.25}/pyproject.toml +5 -4
  10. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/cli.py +30 -12
  11. entropy_data-0.3.25/src/entropy_data/client.py +165 -0
  12. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/api_keys.py +27 -11
  13. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/assets.py +8 -21
  14. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/connection.py +89 -21
  15. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/costs.py +2 -2
  16. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/datacontract_branches.py +7 -30
  17. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/datacontracts.py +4 -9
  18. entropy_data-0.3.25/src/entropy_data/commands/dataproductbuilders.py +79 -0
  19. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/dataproducts.py +4 -34
  20. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/git_credentials.py +1 -9
  21. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/integrations.py +95 -5
  22. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/lineage.py +25 -4
  23. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/notification_channels.py +9 -25
  24. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/organization.py +1 -8
  25. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/semantic_branches.py +7 -30
  26. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/settings.py +87 -65
  27. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/test_results.py +34 -6
  28. entropy_data-0.3.25/src/entropy_data/commands/unity_catalog_metadata.py +215 -0
  29. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/usage.py +22 -4
  30. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/config.py +24 -3
  31. entropy_data-0.3.25/src/entropy_data/listing.py +226 -0
  32. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/output.py +29 -4
  33. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/resources.py +7 -1
  34. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/sync.py +7 -36
  35. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_access_request.py +16 -15
  36. entropy_data-0.3.25/tests/commands/test_api_keys.py +160 -0
  37. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_assets.py +23 -38
  38. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_classifications.py +13 -15
  39. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_connection.py +148 -23
  40. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_connectors.py +11 -13
  41. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_costs.py +11 -10
  42. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_datacontract_branches.py +36 -47
  43. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_datacontracts.py +33 -51
  44. entropy_data-0.3.25/tests/commands/test_dataproduct_types.py +99 -0
  45. entropy_data-0.3.25/tests/commands/test_dataproductbuilders.py +90 -0
  46. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_dataproducts.py +21 -30
  47. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_email_templates.py +13 -15
  48. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_git_credentials.py +24 -46
  49. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_gitconnections.py +30 -54
  50. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_import_export.py +98 -113
  51. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_integrations.py +95 -72
  52. entropy_data-0.3.25/tests/commands/test_lineage.py +167 -0
  53. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_notification_channels.py +12 -18
  54. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_organization.py +28 -40
  55. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_policies.py +12 -20
  56. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_schemas.py +20 -42
  57. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_semantic_branches.py +25 -31
  58. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_semantics.py +35 -42
  59. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_settings.py +24 -41
  60. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_tags.py +14 -17
  61. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_team_roles.py +17 -19
  62. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/test_teams.py +26 -35
  63. entropy_data-0.3.25/tests/commands/test_test_results.py +136 -0
  64. entropy_data-0.3.25/tests/commands/test_unity_catalog_metadata.py +178 -0
  65. entropy_data-0.3.25/tests/commands/test_usage.py +146 -0
  66. entropy_data-0.3.25/tests/test_cli.py +100 -0
  67. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/test_client.py +57 -56
  68. entropy_data-0.3.25/tests/test_listing.py +56 -0
  69. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/test_timeout.py +15 -12
  70. entropy_data-0.3.24/src/entropy_data/client.py +0 -240
  71. entropy_data-0.3.24/tests/commands/test_api_keys.py +0 -101
  72. entropy_data-0.3.24/tests/commands/test_lineage.py +0 -97
  73. entropy_data-0.3.24/tests/commands/test_test_results.py +0 -76
  74. entropy_data-0.3.24/tests/commands/test_usage.py +0 -74
  75. entropy_data-0.3.24/tests/test_cli.py +0 -43
  76. {entropy_data-0.3.24 → entropy_data-0.3.25}/.dockerignore +0 -0
  77. {entropy_data-0.3.24 → entropy_data-0.3.25}/.editorconfig +0 -0
  78. {entropy_data-0.3.24 → entropy_data-0.3.25}/.github/dependabot.yml +0 -0
  79. {entropy_data-0.3.24 → entropy_data-0.3.25}/.github/pull_request_template.md +0 -0
  80. {entropy_data-0.3.24 → entropy_data-0.3.25}/.github/workflows/dependabot-auto-merge.yaml +0 -0
  81. {entropy_data-0.3.24 → entropy_data-0.3.25}/.gitignore +0 -0
  82. {entropy_data-0.3.24 → entropy_data-0.3.25}/LICENSE +0 -0
  83. {entropy_data-0.3.24 → entropy_data-0.3.25}/docs/apply-command-plan.md +0 -0
  84. {entropy_data-0.3.24 → entropy_data-0.3.25}/release +0 -0
  85. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/__init__.py +0 -0
  86. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/__main__.py +0 -0
  87. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/__init__.py +0 -0
  88. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/access.py +0 -0
  89. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/certifications.py +0 -0
  90. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/classifications.py +0 -0
  91. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/connectors.py +0 -0
  92. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/definitions.py +0 -0
  93. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/events.py +0 -0
  94. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/example_data.py +0 -0
  95. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/gitconnections.py +0 -0
  96. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/import_export.py +0 -0
  97. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/policies.py +0 -0
  98. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/schemas.py +0 -0
  99. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/search.py +0 -0
  100. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/semantics.py +0 -0
  101. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/sourcesystems.py +0 -0
  102. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/sync.py +0 -0
  103. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/tags.py +0 -0
  104. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/commands/teams.py +0 -0
  105. {entropy_data-0.3.24 → entropy_data-0.3.25}/src/entropy_data/util.py +0 -0
  106. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/__init__.py +0 -0
  107. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/commands/__init__.py +0 -0
  108. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/conftest.py +0 -0
  109. {entropy_data-0.3.24 → entropy_data-0.3.25}/tests/test_config.py +0 -0
@@ -26,7 +26,7 @@ jobs:
26
26
  - uses: actions/checkout@v7
27
27
  - name: Install uv
28
28
  # setup-uv no longer publishes floating major tags, so pin the exact version.
29
- uses: astral-sh/setup-uv@v10.0.1
29
+ uses: astral-sh/setup-uv@v10.3.0
30
30
  with:
31
31
  python-version: ${{ matrix.python-version }}
32
32
  - name: Install the project
@@ -46,7 +46,7 @@ jobs:
46
46
  steps:
47
47
  - uses: actions/checkout@v7
48
48
  - name: Install uv
49
- uses: astral-sh/setup-uv@v10.0.1
49
+ uses: astral-sh/setup-uv@v10.3.0
50
50
  with:
51
51
  python-version: ${{ matrix.python-version }}
52
52
  - name: Install the project
@@ -66,7 +66,7 @@ jobs:
66
66
  with:
67
67
  fetch-depth: 0
68
68
  - name: Install uv
69
- uses: astral-sh/setup-uv@v10.0.1
69
+ uses: astral-sh/setup-uv@v10.3.0
70
70
  with:
71
71
  python-version: "3.12"
72
72
  - name: Build package
@@ -1,6 +1,6 @@
1
1
  repos:
2
2
  - repo: https://github.com/astral-sh/ruff-pre-commit
3
- rev: v0.16.6
3
+ rev: v0.17.0
4
4
  hooks:
5
5
  - id: ruff
6
6
  args: [ --fix ]
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ## [0.3.25]
6
+
7
+ - Fix: `connection list` honours `-o json` / `-o yaml`, both as the global option (`entropy-data -o json connection list`) and on the command, and prints every connection with its full name, host, vanity URL and `default` flag. Before, it always printed the table, with long names truncated, so scripts could not read which connection is the default. With `ENTROPY_DATA_API_KEY` or `ENTROPY_DATA_HOST` set, it warns that they override the default connection (marked `* (env)`, and `overridden_by` in JSON/YAML).
8
+ - With `-o json` or `-o yaml`, errors are a structured document on stderr (`{"error": {"type", "message", "status", "url"}}`), so scripts and agents parse failures like results.
9
+ - `connection test` names the organization it reached, the host, and where the API key came from (`--api-key`, `--connection`, `ENTROPY_DATA_API_KEY`, or the default connection), because an environment variable silently overrides the default connection.
10
+ - `connection add --help` says that the added connection becomes the default.
11
+ - `connection add` says when it switches the default connection ("Default connection switched from 'prod' to 'demo'.") and how to switch back with `connection set-default`. Before, the default changed silently, and the next commands went to the new organization.
12
+ - `usage list`, `lineage list` and `test-results list` take `--since`/`--until` (ISO date or date-time, or relative like `7d`), `--page`, `--limit` and `--all` to follow every page, newest first; `test-results list` also takes `--server`. Before, `test-results list` only showed the first 10 results. Server-side filtering needs entropy-data#1784; against an older server the CLI filters itself and warns.
13
+ - `costs add` says what it does: a cost with the same data product, name and month as an existing one replaces it (as the API always did), so it prints "Cost saved." instead of "Cost added.".
14
+ - The CLI now talks to the API through the [entropy-data-sdk](https://pypi.org/project/entropy-data-sdk/) package (httpx) instead of its own requests-based client. Commands behave as before; connection setup failures are retried a few times, and an API host with a path prefix (for example behind a reverse proxy) is kept in every request URL.
15
+ - Fix: a `.env` file in the current working directory is loaded again. The CLI searched for `.env` upward from its installed package instead of from where it runs, so a project's `.env` was ignored when the CLI was installed with `uv tool` or `pip`.
16
+ - Add `entropy-data dataproductbuilders list|get|put|delete` (EXPERIMENTAL) to manage data product builders, the coding agent plugins offered on a data product's Build page. Builders are addressed by a stable external ID (e.g. `dbt`); `put` creates a builder under a new ID and otherwise replaces the whole builder. Wraps `/api/dataproductbuilders` (entropy-data#1776, external IDs from entropy-data#1782).
17
+ - Add `entropy-data settings dataproduct-types get|put` to manage the organization's data product types as one document. `put` replaces the whole list; `behavior` and `builtIn` are read-only, so a `get` written back unchanged is accepted. Wraps `GET`/`PUT /api/settings/dataproduct-types`.
18
+ - `export`, `apply`, `import`, and `sync` handle `dataproduct-types` as an organization-level singleton and `dataproductbuilders`, both applied after `policies` and before the data products that reference the type ids.
19
+ - `entropy-data integrations …` now addresses the asset imports on `/api/integrations/ingest/…`, their new home; the paths without `ingest` stay on the server as deprecated. Requires entropy-data#1763.
20
+ - Add `entropy-data integrations put <externalId> --file <file>` to create or change an asset import from its configuration as `integrations get` prints it (`configuration`, plus `credential` and `enabled`; `--credential-file` and `--enabled/--disabled` override the file), and `entropy-data integrations delete <integration> [--delete-assets]`.
21
+ - Add `entropy-data integrations unity-catalog-metadata` for the integrations that write data contract metadata to Databricks Unity Catalog: `list`, `get`, `put` (from `--name`/`--host`/`--client-id`/`--client-secret`/`--warehouse-id`/`--enabled` or a file), `delete`, `tables` (what was written, `--state`), `queue` (what waits), `retry-failed` and `discard-queue`.
22
+
3
23
  ## [0.3.24]
4
24
 
5
25
  - Add the global `--timeout <seconds>` option (or `ENTROPY_DATA_TIMEOUT`) to set how long every API request waits for a response. The default stays 30 seconds, and commands that already wait longer by themselves (`datacontracts test`, `datacontracts generate`) keep doing so unless `--timeout` is given. Replacing a branch with a large semantic ontology can take the server more than 30 seconds.
@@ -69,6 +89,8 @@
69
89
 
70
90
  - Add `entropy-data integrations runs-get <integration> <run-id>` to fetch a single ingestion run by id. Wraps `GET /api/integrations/{ingestionId}/runs/{ingestionRunId}`, the last documented API endpoint not yet exposed by the CLI. Like the other `integrations` commands, the integration argument accepts an `externalId`, display `name`, or UUID.
71
91
 
92
+ - `entropy-data api-keys create` takes `--permission NAME` (repeatable) to create a key that may write only with those permissions, and `--read-only` for a key that reads what the team sees and changes nothing. Without either, the key carries everything your own key holds on the team, which is what it did before. `--scope` now defaults to `team`. Needs a server that knows the `permissions` field on `POST /api/api-keys`; an older server ignores it and creates the key as before.
93
+
72
94
  ## [0.3.11]
73
95
 
74
96
  - Add `entropy-data integrations list|get|configuration|runs|run|cancel` to manage native data-platform integrations (Snowflake, Databricks, BigQuery, Postgres, MySQL, MariaDB, MSSQL, Glue, Alation, Fabric, Power BI). Wraps the new `/api/integrations` endpoints. Commands accept the integration's `externalId`, display `name`, or UUID; name-to-UUID resolution happens client-side. `integrations run` supports `--wait` to poll the run until it reaches a terminal status (SUCCESS, FAILED, CANCELLED), useful for CI and automation that wants to know the outcome before continuing.
@@ -43,7 +43,7 @@ CLI for Entropy Data.
43
43
  ### Core Modules
44
44
  - `cli.py` — Typer app, global options, command group registration
45
45
  - `config.py` — Connection config management (~/.entropy-data/config.toml)
46
- - `client.py` — HTTP client wrapping requests (generic CRUD + actions)
46
+ - `client.py` — path-and-dict client over the `entropy-data-sdk` package (generic CRUD + actions); `client.sdk` is the typed SDK client, `client.http` its HTTP layer for endpoints without a method
47
47
  - `output.py` — Output formatting (Rich tables, JSON)
48
48
 
49
49
  ### Command Modules (`commands/`)
@@ -57,6 +57,6 @@ Resources: dataproducts, datacontracts, access, teams, sourcesystems, definition
57
57
 
58
58
  ## Code Conventions
59
59
  - Python 3.11+
60
- - Typer for CLI, Rich for output, Pydantic for models, requests for HTTP
60
+ - Typer for CLI, Rich for output, Pydantic for models, `entropy-data-sdk` (httpx) for HTTP
61
61
  - Ruff for linting/formatting (line-length 120)
62
- - Tests use pytest + responses (mocked HTTP)
62
+ - Tests use pytest + respx (mocked HTTP)
@@ -1,7 +1,7 @@
1
1
  # Named stage rather than an inline `COPY --from=ghcr.io/astral-sh/uv:...`:
2
2
  # Dependabot's Docker parser only reads FROM lines, so an inline image
3
3
  # reference is never updated.
4
- FROM ghcr.io/astral-sh/uv:0.12.13 AS uv
4
+ FROM ghcr.io/astral-sh/uv:0.13.1 AS uv
5
5
 
6
6
  FROM python:3.14-slim
7
7
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: entropy-data
3
- Version: 0.3.24
3
+ Version: 0.3.25
4
4
  Summary: CLI for Entropy Data
5
5
  Project-URL: Homepage, https://entropy-data.com
6
6
  Project-URL: Documentation, https://docs.entropy-data.com
@@ -16,19 +16,20 @@ Classifier: Programming Language :: Python :: 3.12
16
16
  Classifier: Programming Language :: Python :: 3.13
17
17
  Classifier: Programming Language :: Python :: 3.14
18
18
  Requires-Python: >=3.11
19
+ Requires-Dist: entropy-data-sdk<0.2,>=0.1.0
19
20
  Requires-Dist: pydantic<3.0,>=2.10
20
21
  Requires-Dist: python-dotenv<2.0,>=1.0
21
22
  Requires-Dist: pyyaml<7.0,>=6.0
22
- Requires-Dist: requests<3.0,>=2.33
23
23
  Requires-Dist: rich<16.0,>=14.0
24
24
  Requires-Dist: tomli-w<2.0,>=1.0
25
25
  Requires-Dist: truststore<1.0,>=0.10
26
26
  Requires-Dist: typer<1.0,>=0.15.0
27
27
  Provides-Extra: dev
28
+ Requires-Dist: httpx>=0.28.1; extra == 'dev'
28
29
  Requires-Dist: pre-commit>=3.7; extra == 'dev'
29
30
  Requires-Dist: pytest>=9.0.3; extra == 'dev'
30
- Requires-Dist: responses>=0.25; extra == 'dev'
31
- Requires-Dist: ruff<0.17,>=0.8; extra == 'dev'
31
+ Requires-Dist: respx>=0.22; extra == 'dev'
32
+ Requires-Dist: ruff<0.18,>=0.8; extra == 'dev'
32
33
  Description-Content-Type: text/markdown
33
34
 
34
35
  # Entropy Data CLI
@@ -83,6 +84,8 @@ entropy-data connection add prod
83
84
  # prompts for API key and host
84
85
  ```
85
86
 
87
+ The added connection becomes the default. Switch with `entropy-data connection set-default <name>`, or pick one per call with `--connection <name>`.
88
+
86
89
  ### 2. Explore your data platform
87
90
 
88
91
  ```bash
@@ -129,6 +132,25 @@ entropy-data semantics branches changes sales add-credit-limit
129
132
  entropy-data semantics branches merge sales add-credit-limit
130
133
  ```
131
134
 
135
+ ### Time ranges and paging for usage, lineage, and test results
136
+
137
+ `usage list`, `lineage list`, and `test-results list` show the newest records first, one page at a time (100 per page, 10 for test results):
138
+
139
+ ```bash
140
+ # Lineage events of the last 24 hours
141
+ entropy-data lineage list --since 24h
142
+
143
+ # Every test run of a contract against production in September
144
+ entropy-data test-results list --data-contract-id orders --server production --since 2026-09-01 --until 2026-10-01 --all
145
+
146
+ # Usage spans in pages of 500
147
+ entropy-data usage list --scope-name usage --limit 500 --page 1
148
+ ```
149
+
150
+ `--since` (inclusive) and `--until` (exclusive) take an ISO date or date-time (UTC unless it has an offset), or a relative time like `30m`, `24h`, `7d`, `2w`. `--all` follows every page. With `-o json`, a note on stderr says when more pages exist.
151
+
152
+ The server applies these filters. A server from before that feature ignores them, so the CLI applies them to what it gets back and says so on stderr.
153
+
132
154
  ## Commands
133
155
 
134
156
  ```
@@ -145,16 +167,17 @@ entropy-data [--version] [--connection NAME] [--output table|json|yaml] [--debug
145
167
  certifications list | get | put | delete
146
168
  classifications list | get | put | delete
147
169
  policies list | get | put | delete
170
+ dataproductbuilders list | get | put | delete
148
171
  example-data list | get | put | delete
149
172
  test-results list | get | publish | delete
150
- costs list | add | delete
173
+ costs list | add (upsert) | delete
151
174
  assets list | get | put | delete | tags ...
152
175
  tags list | get | put | delete
153
176
  api-keys create | delete
154
177
  connectors list | get | put | delete
155
- integrations list | get | runs | runs-get | runs-latest | run | cancel
178
+ integrations list | get | put | delete | runs | runs-get | runs-latest | run | cancel | unity-catalog-metadata ...
156
179
  organization get | members ... | git-credentials ...
157
- settings get-customization | put-customization | get-scim-mapping | put-scim-mapping | team-roles ... | email-templates ...
180
+ settings get-customization | put-customization | get-scim-mapping | put-scim-mapping | team-roles ... | email-templates ... | dataproduct-types ...
158
181
  events poll
159
182
  lineage list | submit | delete
160
183
  schemas get
@@ -180,7 +203,7 @@ idempotent PUT-by-id, so runs converge and are safe to repeat.
180
203
  `sync` copies **nothing by default** — name the resources to sync with `--include`.
181
204
 
182
205
  **Supported resources** (in dependency order): `teams`, `tags`, `definitions`, `policies`,
183
- `sourcesystems`, `certifications`, `classification-schemes`, `assets`, `datacontracts`,
206
+ `dataproduct-types`, `dataproductbuilders`, `sourcesystems`, `certifications`, `classification-schemes`, `assets`, `datacontracts`,
184
207
  `dataproducts`, `example-data`, `access`, `semantic-namespaces`, `semantic-ontology`,
185
208
  `email-templates`, `organization-features`.
186
209
 
@@ -287,7 +310,24 @@ ENTROPY_DATA_HOST=https://api.entropy-data.com
287
310
 
288
311
  Values from `.env` are loaded as environment variables and do **not** override already-set environment variables.
289
312
 
290
- Resolution precedence: CLI options > environment variables / `.env` > config file.
313
+ Resolution precedence: CLI options (`--api-key`, `--host`, `--connection`) > environment variables / `.env` > default connection from the config file.
314
+
315
+ `entropy-data connection list` warns (on stderr) when `ENTROPY_DATA_API_KEY` or `ENTROPY_DATA_HOST` is set, because those override the default connection; in the table the default is marked `* (env)`, and in `-o json` it carries `"overridden_by": [...]`.
316
+
317
+ ### Errors
318
+
319
+ Errors are written to stderr, never stdout, and the CLI exits non-zero (2 for configuration errors, 1 otherwise). With `-o json` or `-o yaml` the error is a structured document, so scripts can parse it:
320
+
321
+ ```json
322
+ {
323
+ "error": {
324
+ "type": "api_error",
325
+ "message": "HTTP 404 from https://api.entropy-data.com/api/teams/missing: Team not found",
326
+ "status": 404,
327
+ "url": "https://api.entropy-data.com/api/teams/missing"
328
+ }
329
+ }
330
+ ```
291
331
 
292
332
  ### TLS behind a corporate proxy or internal CA
293
333
 
@@ -50,6 +50,8 @@ entropy-data connection add prod
50
50
  # prompts for API key and host
51
51
  ```
52
52
 
53
+ The added connection becomes the default. Switch with `entropy-data connection set-default <name>`, or pick one per call with `--connection <name>`.
54
+
53
55
  ### 2. Explore your data platform
54
56
 
55
57
  ```bash
@@ -96,6 +98,25 @@ entropy-data semantics branches changes sales add-credit-limit
96
98
  entropy-data semantics branches merge sales add-credit-limit
97
99
  ```
98
100
 
101
+ ### Time ranges and paging for usage, lineage, and test results
102
+
103
+ `usage list`, `lineage list`, and `test-results list` show the newest records first, one page at a time (100 per page, 10 for test results):
104
+
105
+ ```bash
106
+ # Lineage events of the last 24 hours
107
+ entropy-data lineage list --since 24h
108
+
109
+ # Every test run of a contract against production in September
110
+ entropy-data test-results list --data-contract-id orders --server production --since 2026-09-01 --until 2026-10-01 --all
111
+
112
+ # Usage spans in pages of 500
113
+ entropy-data usage list --scope-name usage --limit 500 --page 1
114
+ ```
115
+
116
+ `--since` (inclusive) and `--until` (exclusive) take an ISO date or date-time (UTC unless it has an offset), or a relative time like `30m`, `24h`, `7d`, `2w`. `--all` follows every page. With `-o json`, a note on stderr says when more pages exist.
117
+
118
+ The server applies these filters. A server from before that feature ignores them, so the CLI applies them to what it gets back and says so on stderr.
119
+
99
120
  ## Commands
100
121
 
101
122
  ```
@@ -112,16 +133,17 @@ entropy-data [--version] [--connection NAME] [--output table|json|yaml] [--debug
112
133
  certifications list | get | put | delete
113
134
  classifications list | get | put | delete
114
135
  policies list | get | put | delete
136
+ dataproductbuilders list | get | put | delete
115
137
  example-data list | get | put | delete
116
138
  test-results list | get | publish | delete
117
- costs list | add | delete
139
+ costs list | add (upsert) | delete
118
140
  assets list | get | put | delete | tags ...
119
141
  tags list | get | put | delete
120
142
  api-keys create | delete
121
143
  connectors list | get | put | delete
122
- integrations list | get | runs | runs-get | runs-latest | run | cancel
144
+ integrations list | get | put | delete | runs | runs-get | runs-latest | run | cancel | unity-catalog-metadata ...
123
145
  organization get | members ... | git-credentials ...
124
- settings get-customization | put-customization | get-scim-mapping | put-scim-mapping | team-roles ... | email-templates ...
146
+ settings get-customization | put-customization | get-scim-mapping | put-scim-mapping | team-roles ... | email-templates ... | dataproduct-types ...
125
147
  events poll
126
148
  lineage list | submit | delete
127
149
  schemas get
@@ -147,7 +169,7 @@ idempotent PUT-by-id, so runs converge and are safe to repeat.
147
169
  `sync` copies **nothing by default** — name the resources to sync with `--include`.
148
170
 
149
171
  **Supported resources** (in dependency order): `teams`, `tags`, `definitions`, `policies`,
150
- `sourcesystems`, `certifications`, `classification-schemes`, `assets`, `datacontracts`,
172
+ `dataproduct-types`, `dataproductbuilders`, `sourcesystems`, `certifications`, `classification-schemes`, `assets`, `datacontracts`,
151
173
  `dataproducts`, `example-data`, `access`, `semantic-namespaces`, `semantic-ontology`,
152
174
  `email-templates`, `organization-features`.
153
175
 
@@ -254,7 +276,24 @@ ENTROPY_DATA_HOST=https://api.entropy-data.com
254
276
 
255
277
  Values from `.env` are loaded as environment variables and do **not** override already-set environment variables.
256
278
 
257
- Resolution precedence: CLI options > environment variables / `.env` > config file.
279
+ Resolution precedence: CLI options (`--api-key`, `--host`, `--connection`) > environment variables / `.env` > default connection from the config file.
280
+
281
+ `entropy-data connection list` warns (on stderr) when `ENTROPY_DATA_API_KEY` or `ENTROPY_DATA_HOST` is set, because those override the default connection; in the table the default is marked `* (env)`, and in `-o json` it carries `"overridden_by": [...]`.
282
+
283
+ ### Errors
284
+
285
+ Errors are written to stderr, never stdout, and the CLI exits non-zero (2 for configuration errors, 1 otherwise). With `-o json` or `-o yaml` the error is a structured document, so scripts can parse it:
286
+
287
+ ```json
288
+ {
289
+ "error": {
290
+ "type": "api_error",
291
+ "message": "HTTP 404 from https://api.entropy-data.com/api/teams/missing: Team not found",
292
+ "status": 404,
293
+ "url": "https://api.entropy-data.com/api/teams/missing"
294
+ }
295
+ }
296
+ ```
258
297
 
259
298
  ### TLS behind a corporate proxy or internal CA
260
299
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "entropy-data"
3
- version = "0.3.24"
3
+ version = "0.3.25"
4
4
  description = "CLI for Entropy Data"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -28,11 +28,11 @@ dependencies = [
28
28
  "typer>=0.15.0,<1.0",
29
29
  "rich>=14.0,<16.0",
30
30
  "pydantic>=2.10,<3.0",
31
- "requests>=2.33,<3.0",
32
31
  "tomli_w>=1.0,<2.0",
33
32
  "pyyaml>=6.0,<7.0",
34
33
  "python-dotenv>=1.0,<2.0",
35
34
  "truststore>=0.10,<1.0",
35
+ "entropy-data-sdk>=0.1.0,<0.2",
36
36
  ]
37
37
 
38
38
  [project.urls]
@@ -48,12 +48,13 @@ entropy-data = "entropy_data.cli:app"
48
48
  [project.optional-dependencies]
49
49
  dev = [
50
50
  "pytest>=9.0.3",
51
- "responses>=0.25",
52
51
  # 0.16 is allowed: its formatter style is applied to the tree, and the
53
52
  # lint rules it would otherwise widen are stated explicitly under
54
53
  # [tool.ruff.lint].
55
- "ruff>=0.8,<0.17",
54
+ "ruff>=0.8,<0.18",
56
55
  "pre-commit>=3.7",
56
+ "respx>=0.22",
57
+ "httpx>=0.28.1",
57
58
  ]
58
59
 
59
60
  [build-system]
@@ -5,13 +5,13 @@ import sys
5
5
  from typing import Annotated, Optional
6
6
 
7
7
  import typer
8
- from dotenv import load_dotenv
8
+ from dotenv import find_dotenv, load_dotenv
9
9
  from rich.console import Console
10
10
 
11
11
  from entropy_data import __version__
12
12
  from entropy_data.client import ApiError, EntropyDataClient
13
13
  from entropy_data.config import ConfigurationError, resolve_connection
14
- from entropy_data.output import OutputFormat
14
+ from entropy_data.output import OutputFormat, print_data
15
15
 
16
16
  # Global state shared across commands
17
17
  _connection_name: str | None = None
@@ -49,17 +49,28 @@ def get_output_format() -> OutputFormat:
49
49
 
50
50
 
51
51
  def handle_error(e: Exception) -> None:
52
- """Handle errors with appropriate output and exit codes."""
52
+ """Handle errors with appropriate output and exit codes.
53
+
54
+ Errors always go to stderr. With -o json/yaml they are written as a structured
55
+ document, so scripts and agents can parse failures the same way as results.
56
+ """
53
57
  if _debug:
54
58
  raise e
55
59
  if isinstance(e, ConfigurationError):
56
- error_console.print(f"[red]Configuration error: {e}[/red]")
57
- raise SystemExit(2)
58
- if isinstance(e, ApiError):
59
- error_console.print(f"[red]API error: {e}[/red]")
60
- raise SystemExit(1)
61
- error_console.print(f"[red]Error: {e}[/red]")
62
- raise SystemExit(1)
60
+ kind, label, exit_code = "configuration_error", "Configuration error", 2
61
+ elif isinstance(e, ApiError):
62
+ kind, label, exit_code = "api_error", "API error", 1
63
+ else:
64
+ kind, label, exit_code = "error", "Error", 1
65
+ if _output_format != OutputFormat.table:
66
+ error: dict = {"type": kind, "message": str(e)}
67
+ if isinstance(e, ApiError):
68
+ error["status"] = e.status_code
69
+ error["url"] = e.url
70
+ print_data({"error": error}, _output_format, stream=sys.stderr)
71
+ else:
72
+ error_console.print(f"[red]{label}: {e}[/red]", highlight=False, soft_wrap=True)
73
+ raise SystemExit(exit_code)
63
74
 
64
75
 
65
76
  def version_callback(value: bool) -> None:
@@ -72,7 +83,7 @@ def inject_system_truststore() -> None:
72
83
  """Verify TLS using the operating system's certificate trust store instead of the
73
84
  bundled CA certificates. This lets the CLI work behind corporate proxies or with
74
85
  internal CAs whose root certificates are installed in the OS trust store but not in
75
- the certifi bundle that requests uses by default."""
86
+ the certifi bundle that httpx uses by default."""
76
87
  try:
77
88
  import truststore
78
89
  except ImportError:
@@ -122,7 +133,8 @@ def main(
122
133
  ) -> None:
123
134
  """Entropy Data CLI — manage your data platform from the command line."""
124
135
  global _connection_name, _cli_api_key, _cli_host, _output_format, _debug, _timeout
125
- load_dotenv()
136
+ # usecwd: find the .env where the user runs the CLI, not next to the installed package.
137
+ load_dotenv(find_dotenv(usecwd=True))
126
138
  _connection_name = connection
127
139
  _cli_api_key = api_key
128
140
  _cli_host = host
@@ -145,6 +157,7 @@ from entropy_data.commands.connection import connection_app # noqa: E402
145
157
  from entropy_data.commands.connectors import connectors_app # noqa: E402
146
158
  from entropy_data.commands.costs import costs_app # noqa: E402
147
159
  from entropy_data.commands.datacontracts import datacontracts_app # noqa: E402
160
+ from entropy_data.commands.dataproductbuilders import dataproductbuilders_app # noqa: E402
148
161
  from entropy_data.commands.dataproducts import dataproducts_app # noqa: E402
149
162
  from entropy_data.commands.definitions import definitions_app # noqa: E402
150
163
  from entropy_data.commands.events import events_app # noqa: E402
@@ -175,6 +188,11 @@ app.add_typer(definitions_app, name="definitions", help="Manage definitions.")
175
188
  app.add_typer(certifications_app, name="certifications", help="Manage certifications.")
176
189
  app.add_typer(classifications_app, name="classifications", help="Manage classification schemes.")
177
190
  app.add_typer(policies_app, name="policies", help="Manage policies.")
191
+ app.add_typer(
192
+ dataproductbuilders_app,
193
+ name="dataproductbuilders",
194
+ help="EXPERIMENTAL Manage data product builders.",
195
+ )
178
196
  app.add_typer(example_data_app, name="example-data", help="Manage example data.")
179
197
  app.add_typer(test_results_app, name="test-results", help="Manage test results.")
180
198
  app.add_typer(costs_app, name="costs", help="Manage costs.")
@@ -0,0 +1,165 @@
1
+ """The commands' client for the Entropy Data API, built on the Python SDK.
2
+
3
+ Commands print what the server returns, so this client speaks in paths and dictionaries and leaves
4
+ parsing to the output layer. ``sdk`` is the typed SDK client underneath, and ``http`` its HTTP layer
5
+ for endpoints without a method here.
6
+ """
7
+
8
+ import re
9
+
10
+ from entropy_data_sdk import EntropyDataClient as SdkClient
11
+ from entropy_data_sdk.errors import ApiError, NotFoundError, UnprocessableContentError
12
+
13
+ from entropy_data.config import ConnectionConfig
14
+
15
+ __all__ = [
16
+ "ApiError",
17
+ "EntropyDataClient",
18
+ "NotFoundError",
19
+ "REQUEST_TIMEOUT",
20
+ "SCHEMA_SPECS",
21
+ "UnprocessableContentError",
22
+ ]
23
+
24
+ REQUEST_TIMEOUT = 30
25
+ MAX_RESOURCE_ID_LENGTH = 256
26
+
27
+ SCHEMA_SPECS = ("odcs", "odps")
28
+ _SCHEMA_VERSION_PATTERN = re.compile(r"^\d+\.\d+\.\d+$")
29
+
30
+
31
+ def _validate_resource_id(resource_id: str) -> None:
32
+ """Reject empty, too-long, or path-traversal resource IDs."""
33
+ if not resource_id:
34
+ raise ValueError("Resource ID must not be empty.")
35
+ if len(resource_id) > MAX_RESOURCE_ID_LENGTH:
36
+ raise ValueError(f"Resource ID must not exceed {MAX_RESOURCE_ID_LENGTH} characters.")
37
+ if ".." in resource_id.split("/"):
38
+ raise ValueError(f"Resource ID must not contain path traversal: '{resource_id}'")
39
+
40
+
41
+ def _validate_page(page: int) -> None:
42
+ """Reject negative page numbers."""
43
+ if page < 0:
44
+ raise ValueError(f"Page number must not be negative: {page}")
45
+
46
+
47
+ def _has_next_page(response) -> bool:
48
+ return bool(re.search(r'rel="next"', response.headers.get("Link", "")))
49
+
50
+
51
+ class EntropyDataClient:
52
+ def __init__(self, config: ConnectionConfig, timeout: int | None = None):
53
+ # An explicit --timeout also overrides the longer waits some commands choose for themselves.
54
+ self.timeout_override = timeout
55
+ self.timeout = timeout or REQUEST_TIMEOUT
56
+ self.sdk = SdkClient(config.api_key, config.host, timeout=self.timeout)
57
+ self.http = self.sdk.http
58
+
59
+ @property
60
+ def base_url(self) -> str:
61
+ return self.http.base_url
62
+
63
+ def list_resources(self, path: str, params: dict | None = None) -> tuple[list[dict], bool]:
64
+ """GET /api/{path}. Returns (items, has_next_page)."""
65
+ if params and "p" in params:
66
+ _validate_page(int(params["p"]))
67
+ response = self.http.request("GET", f"/api/{path}", params=params)
68
+ return response.json(), _has_next_page(response)
69
+
70
+ def get_resource(self, path: str, resource_id: str) -> dict:
71
+ """GET /api/{path}/{id}."""
72
+ _validate_resource_id(resource_id)
73
+ return self.http.get_json(f"/api/{path}/{resource_id}")
74
+
75
+ def put_resource(self, path: str, resource_id: str, body: dict) -> str | None:
76
+ """PUT /api/{path}/{id}. Returns location-html URL if present."""
77
+ _validate_resource_id(resource_id)
78
+ if "id" in body and body["id"] != resource_id:
79
+ body = {**body, "id": resource_id}
80
+ return self.http.put_json(f"/api/{path}/{resource_id}", body).location_html
81
+
82
+ def delete_resource(self, path: str, resource_id: str) -> None:
83
+ """DELETE /api/{path}/{id}."""
84
+ _validate_resource_id(resource_id)
85
+ self.http.delete(f"/api/{path}/{resource_id}")
86
+
87
+ def post_action(self, path: str, resource_id: str, action: str) -> str | None:
88
+ """POST /api/{path}/{id}/{action}. Returns location-html URL if present."""
89
+ _validate_resource_id(resource_id)
90
+ return self.http.post_json(f"/api/{path}/{resource_id}/{action}").location_html
91
+
92
+ def post_action_json(
93
+ self,
94
+ path: str,
95
+ resource_id: str,
96
+ action: str,
97
+ params: dict | None = None,
98
+ body: dict | None = None,
99
+ timeout: int | None = None,
100
+ ) -> dict:
101
+ """POST /api/{path}/{id}/{action}. Returns response JSON."""
102
+ _validate_resource_id(resource_id)
103
+ response = self.http.request(
104
+ "POST",
105
+ f"/api/{path}/{resource_id}/{action}",
106
+ params=params,
107
+ json=body,
108
+ timeout=self.timeout_override or timeout,
109
+ )
110
+ return response.json()
111
+
112
+ def post_resource(self, path: str, body: dict, params: dict | None = None) -> str | None:
113
+ """POST /api/{path}. Returns location-html URL if present."""
114
+ return self.http.post_json(f"/api/{path}", body, params=params).location_html
115
+
116
+ def delete_resources(self, path: str, params: dict | None = None) -> dict:
117
+ """DELETE /api/{path} with query params. Returns response JSON."""
118
+ return self.http.delete(f"/api/{path}", params=params).data or {}
119
+
120
+ def get_events(self, last_event_id: str | None = None) -> list[dict]:
121
+ """GET /api/events. Returns list of events."""
122
+ return self.http.get_json("/api/events", params={"lastEventId": last_event_id})
123
+
124
+ def get_gitconnection(self, path: str, resource_id: str) -> dict:
125
+ """GET /api/{path}/{id}/gitconnection."""
126
+ _validate_resource_id(resource_id)
127
+ return self.http.get_json(f"/api/{path}/{resource_id}/gitconnection")
128
+
129
+ def put_gitconnection(self, path: str, resource_id: str, body: dict) -> dict:
130
+ """PUT /api/{path}/{id}/gitconnection."""
131
+ _validate_resource_id(resource_id)
132
+ return self.http.request("PUT", f"/api/{path}/{resource_id}/gitconnection", json=body).json()
133
+
134
+ def delete_gitconnection(self, path: str, resource_id: str) -> None:
135
+ """DELETE /api/{path}/{id}/gitconnection."""
136
+ _validate_resource_id(resource_id)
137
+ self.http.delete(f"/api/{path}/{resource_id}/gitconnection")
138
+
139
+ def gitconnection_action(
140
+ self,
141
+ path: str,
142
+ resource_id: str,
143
+ action: str,
144
+ body: dict | None = None,
145
+ ) -> dict:
146
+ """POST /api/{path}/{id}/gitconnection/{action}. action ∈ {pull, push, push-pr}."""
147
+ _validate_resource_id(resource_id)
148
+ return self.http.request("POST", f"/api/{path}/{resource_id}/gitconnection/{action}", json=body).json()
149
+
150
+ def get_schema(self, spec: str, version: str | None = None, custom: bool = False) -> tuple[str, str | None]:
151
+ """GET /api/schemas/{spec}[-{version}][-custom].schema.json.
152
+
153
+ Returns (schema JSON text, served base version from the X-Schema-Version header).
154
+ """
155
+ if spec not in SCHEMA_SPECS:
156
+ raise ValueError(f"Unknown specification '{spec}'. Expected one of: {', '.join(SCHEMA_SPECS)}.")
157
+ if version is not None and not _SCHEMA_VERSION_PATTERN.match(version):
158
+ raise ValueError(f"Invalid schema version '{version}'. Expected a version like 3.1.0.")
159
+ filename = f"{spec}{f'-{version}' if version else ''}{'-custom' if custom else ''}.schema.json"
160
+ response = self.http.request("GET", f"/api/schemas/{filename}")
161
+ return response.text, response.headers.get("X-Schema-Version")
162
+
163
+ def search(self, query: str, **params) -> dict:
164
+ """GET /api/search."""
165
+ return self.http.get_json("/api/search", params={**params, "query": query})