entropy-data 0.3.7__tar.gz → 0.3.8__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 (74) hide show
  1. {entropy_data-0.3.7 → entropy_data-0.3.8}/CHANGELOG.md +4 -0
  2. {entropy_data-0.3.7 → entropy_data-0.3.8}/PKG-INFO +1 -1
  3. {entropy_data-0.3.7 → entropy_data-0.3.8}/README.md +1 -0
  4. {entropy_data-0.3.7 → entropy_data-0.3.8}/pyproject.toml +1 -1
  5. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/cli.py +2 -0
  6. entropy_data-0.3.8/src/entropy_data/commands/policies.py +79 -0
  7. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/output.py +1 -0
  8. entropy_data-0.3.8/tests/commands/test_policies.py +89 -0
  9. {entropy_data-0.3.7 → entropy_data-0.3.8}/.editorconfig +0 -0
  10. {entropy_data-0.3.7 → entropy_data-0.3.8}/.github/dependabot.yml +0 -0
  11. {entropy_data-0.3.7 → entropy_data-0.3.8}/.github/pull_request_template.md +0 -0
  12. {entropy_data-0.3.7 → entropy_data-0.3.8}/.github/workflows/ci.yaml +0 -0
  13. {entropy_data-0.3.7 → entropy_data-0.3.8}/.github/workflows/release.yaml +0 -0
  14. {entropy_data-0.3.7 → entropy_data-0.3.8}/.gitignore +0 -0
  15. {entropy_data-0.3.7 → entropy_data-0.3.8}/.pre-commit-config.yaml +0 -0
  16. {entropy_data-0.3.7 → entropy_data-0.3.8}/CLAUDE.md +0 -0
  17. {entropy_data-0.3.7 → entropy_data-0.3.8}/Dockerfile +0 -0
  18. {entropy_data-0.3.7 → entropy_data-0.3.8}/LICENSE +0 -0
  19. {entropy_data-0.3.7 → entropy_data-0.3.8}/release +0 -0
  20. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/__init__.py +0 -0
  21. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/__main__.py +0 -0
  22. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/client.py +0 -0
  23. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/__init__.py +0 -0
  24. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/access.py +0 -0
  25. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/api_keys.py +0 -0
  26. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/assets.py +0 -0
  27. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/certifications.py +0 -0
  28. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/connection.py +0 -0
  29. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/connectors.py +0 -0
  30. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/costs.py +0 -0
  31. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/datacontracts.py +0 -0
  32. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/dataproducts.py +0 -0
  33. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/definitions.py +0 -0
  34. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/events.py +0 -0
  35. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/example_data.py +0 -0
  36. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/git_credentials.py +0 -0
  37. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/gitconnections.py +0 -0
  38. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/import_export.py +0 -0
  39. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/lineage.py +0 -0
  40. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/notification_channels.py +0 -0
  41. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/organization.py +0 -0
  42. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/search.py +0 -0
  43. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/semantics.py +0 -0
  44. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/settings.py +0 -0
  45. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/sourcesystems.py +0 -0
  46. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/tags.py +0 -0
  47. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/teams.py +0 -0
  48. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/test_results.py +0 -0
  49. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/commands/usage.py +0 -0
  50. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/config.py +0 -0
  51. {entropy_data-0.3.7 → entropy_data-0.3.8}/src/entropy_data/util.py +0 -0
  52. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/__init__.py +0 -0
  53. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/__init__.py +0 -0
  54. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_access_request.py +0 -0
  55. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_api_keys.py +0 -0
  56. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_assets.py +0 -0
  57. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_connection.py +0 -0
  58. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_connectors.py +0 -0
  59. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_costs.py +0 -0
  60. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_datacontracts.py +0 -0
  61. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_dataproducts.py +0 -0
  62. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_git_credentials.py +0 -0
  63. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_gitconnections.py +0 -0
  64. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_lineage.py +0 -0
  65. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_notification_channels.py +0 -0
  66. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_organization.py +0 -0
  67. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_semantics.py +0 -0
  68. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_settings.py +0 -0
  69. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_tags.py +0 -0
  70. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_teams.py +0 -0
  71. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/commands/test_usage.py +0 -0
  72. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/conftest.py +0 -0
  73. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/test_client.py +0 -0
  74. {entropy_data-0.3.7 → entropy_data-0.3.8}/tests/test_config.py +0 -0
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.3.8]
6
+
7
+ - Add `entropy-data policies list|get|put|delete` to manage policies. Wraps `/api/policies` and `/api/policies/{externalId}`.
8
+
5
9
  ## [0.3.7]
6
10
 
7
11
  - Add `yaml` as a third value for `--output` / `-o` alongside `table` and `json`. Useful when piping results into editors or files that expect YAML (e.g. data contracts).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: entropy-data
3
- Version: 0.3.7
3
+ Version: 0.3.8
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
@@ -87,6 +87,7 @@ entropy-data [--version] [--connection NAME] [--output table|json] [--debug]
87
87
  sourcesystems list | get | put | delete
88
88
  definitions list | get | put | delete
89
89
  certifications list | get | put | delete
90
+ policies list | get | put | delete
90
91
  example-data list | get | put | delete
91
92
  test-results list | get | publish | delete
92
93
  costs list | add | delete
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "entropy-data"
3
- version = "0.3.7"
3
+ version = "0.3.8"
4
4
  description = "CLI for Entropy Data"
5
5
  requires-python = ">=3.11"
6
6
  license = "MIT"
@@ -105,6 +105,7 @@ from entropy_data.commands.example_data import example_data_app # noqa: E402
105
105
  from entropy_data.commands.import_export import import_app # noqa: E402
106
106
  from entropy_data.commands.lineage import lineage_app # noqa: E402
107
107
  from entropy_data.commands.organization import organization_app # noqa: E402
108
+ from entropy_data.commands.policies import policies_app # noqa: E402
108
109
  from entropy_data.commands.search import search_app # noqa: E402
109
110
  from entropy_data.commands.semantics import semantics_app # noqa: E402
110
111
  from entropy_data.commands.settings import settings_app # noqa: E402
@@ -122,6 +123,7 @@ app.add_typer(access_app, name="access", help="Manage access (data usage agreeme
122
123
  app.add_typer(sourcesystems_app, name="sourcesystems", help="Manage source systems.")
123
124
  app.add_typer(definitions_app, name="definitions", help="Manage definitions.")
124
125
  app.add_typer(certifications_app, name="certifications", help="Manage certifications.")
126
+ app.add_typer(policies_app, name="policies", help="Manage policies.")
125
127
  app.add_typer(example_data_app, name="example-data", help="Manage example data.")
126
128
  app.add_typer(test_results_app, name="test-results", help="Manage test results.")
127
129
  app.add_typer(costs_app, name="costs", help="Manage costs.")
@@ -0,0 +1,79 @@
1
+ """Policies commands."""
2
+
3
+ from pathlib import Path
4
+ from typing import Annotated, Optional
5
+
6
+ import typer
7
+
8
+ from entropy_data.output import OutputFormat, print_link, print_resource, print_resource_list, print_success
9
+ from entropy_data.util import read_body
10
+
11
+ policies_app = typer.Typer(no_args_is_help=True)
12
+ RESOURCE_PATH = "policies"
13
+ RESOURCE_TYPE = "policies"
14
+
15
+
16
+ @policies_app.command("list")
17
+ def list_policies(
18
+ output: Annotated[Optional[OutputFormat], typer.Option("--output", "-o", help="Output format.")] = None,
19
+ ) -> None:
20
+ """List all policies."""
21
+ from entropy_data.cli import get_client, get_output_format, handle_error
22
+
23
+ fmt = output or get_output_format()
24
+ try:
25
+ client = get_client()
26
+ data, has_next = client.list_resources(RESOURCE_PATH)
27
+ print_resource_list(data, RESOURCE_TYPE, fmt, has_next_page=has_next)
28
+ except Exception as e:
29
+ handle_error(e)
30
+
31
+
32
+ @policies_app.command("get")
33
+ def get_policy(
34
+ id: Annotated[str, typer.Argument(help="Policy ID.")],
35
+ output: Annotated[Optional[OutputFormat], typer.Option("--output", "-o", help="Output format.")] = None,
36
+ ) -> None:
37
+ """Get a policy by ID."""
38
+ from entropy_data.cli import get_client, get_output_format, handle_error
39
+
40
+ fmt = output or get_output_format()
41
+ try:
42
+ client = get_client()
43
+ data = client.get_resource(RESOURCE_PATH, id)
44
+ print_resource(data, RESOURCE_TYPE, fmt)
45
+ except Exception as e:
46
+ handle_error(e)
47
+
48
+
49
+ @policies_app.command("put")
50
+ def put_policy(
51
+ id: Annotated[str, typer.Argument(help="Policy ID.")],
52
+ file: Annotated[Path, typer.Option("--file", "-f", help="JSON or YAML file (use - for stdin).")] = ...,
53
+ ) -> None:
54
+ """Create or update a policy."""
55
+ from entropy_data.cli import get_client, handle_error
56
+
57
+ try:
58
+ body = read_body(file)
59
+ client = get_client()
60
+ location = client.put_resource(RESOURCE_PATH, id, body)
61
+ print_success(f"Policy '{id}' saved.")
62
+ print_link(location)
63
+ except Exception as e:
64
+ handle_error(e)
65
+
66
+
67
+ @policies_app.command("delete")
68
+ def delete_policy(
69
+ id: Annotated[str, typer.Argument(help="Policy ID.")],
70
+ ) -> None:
71
+ """Delete a policy."""
72
+ from entropy_data.cli import get_client, handle_error
73
+
74
+ try:
75
+ client = get_client()
76
+ client.delete_resource(RESOURCE_PATH, id)
77
+ print_success(f"Policy '{id}' deleted.")
78
+ except Exception as e:
79
+ handle_error(e)
@@ -42,6 +42,7 @@ RESOURCE_COLUMNS: dict[str, list[tuple[str, str]]] = {
42
42
  "sourcesystems": [("ID", "id"), ("Name", "name"), ("Owner", "owner")],
43
43
  "definitions": [("ID", "id"), ("Name", "title"), ("Owner", "owner")],
44
44
  "certifications": [("ID", "id"), ("Name", "name"), ("Rank", "rank"), ("Tag", "tag")],
45
+ "policies": [("ID", "id"), ("Name", "name"), ("Status", "status")],
45
46
  "example-data": [("ID", "id"), ("Data Product", "dataProductId"), ("Schema", "schemaName")],
46
47
  "test-results": [("ID", "id"), ("Data Contract", "dataContractId"), ("Result", "result")],
47
48
  "events": [("ID", "id"), ("Type", "type"), ("Subject", "subject"), ("Time", "time")],
@@ -0,0 +1,89 @@
1
+ """Tests for policies commands."""
2
+
3
+ import json
4
+
5
+ import responses
6
+ from typer.testing import CliRunner
7
+
8
+ import entropy_data.config as cfg
9
+ from entropy_data.cli import app
10
+
11
+ runner = CliRunner()
12
+ BASE_URL = "https://api.entropy-data.com"
13
+
14
+ POLICIES_LIST = [
15
+ {"id": "pol_pii_handling", "name": "PII Handling", "status": "Published", "content": "..."},
16
+ {"id": "pol_retention", "name": "Data Retention", "status": "Draft", "content": "..."},
17
+ ]
18
+
19
+
20
+ @responses.activate
21
+ def test_policies_list(monkeypatch, tmp_path):
22
+ monkeypatch.setattr(cfg, "CONFIG_FILE", tmp_path / "config.toml")
23
+ monkeypatch.setenv("ENTROPY_DATA_API_KEY", "test-key")
24
+ responses.add(responses.GET, f"{BASE_URL}/api/policies", json=POLICIES_LIST, status=200)
25
+ result = runner.invoke(app, ["policies", "list"])
26
+ assert result.exit_code == 0
27
+ assert "PII Handling" in result.output
28
+ assert "Data Retention" in result.output
29
+
30
+
31
+ @responses.activate
32
+ def test_policies_list_json(monkeypatch, tmp_path):
33
+ monkeypatch.setattr(cfg, "CONFIG_FILE", tmp_path / "config.toml")
34
+ monkeypatch.setenv("ENTROPY_DATA_API_KEY", "test-key")
35
+ responses.add(responses.GET, f"{BASE_URL}/api/policies", json=POLICIES_LIST, status=200)
36
+ result = runner.invoke(app, ["policies", "list", "--output", "json"])
37
+ assert result.exit_code == 0
38
+ data = json.loads(result.output)
39
+ assert len(data) == 2
40
+
41
+
42
+ @responses.activate
43
+ def test_policies_get(monkeypatch, tmp_path):
44
+ monkeypatch.setattr(cfg, "CONFIG_FILE", tmp_path / "config.toml")
45
+ monkeypatch.setenv("ENTROPY_DATA_API_KEY", "test-key")
46
+ responses.add(
47
+ responses.GET,
48
+ f"{BASE_URL}/api/policies/pol_pii_handling",
49
+ json=POLICIES_LIST[0],
50
+ status=200,
51
+ )
52
+ result = runner.invoke(app, ["policies", "get", "pol_pii_handling"])
53
+ assert result.exit_code == 0
54
+ assert "PII Handling" in result.output
55
+
56
+
57
+ @responses.activate
58
+ def test_policies_put(monkeypatch, tmp_path):
59
+ monkeypatch.setattr(cfg, "CONFIG_FILE", tmp_path / "config.toml")
60
+ monkeypatch.setenv("ENTROPY_DATA_API_KEY", "test-key")
61
+ responses.add(
62
+ responses.PUT,
63
+ f"{BASE_URL}/api/policies/pol_pii_handling",
64
+ status=200,
65
+ )
66
+ policy_file = tmp_path / "policy.json"
67
+ policy_file.write_text(json.dumps({"id": "pol_pii_handling", "name": "PII Handling", "status": "Draft"}))
68
+ result = runner.invoke(app, ["policies", "put", "pol_pii_handling", "--file", str(policy_file)])
69
+ assert result.exit_code == 0
70
+ assert "saved" in result.output
71
+
72
+
73
+ @responses.activate
74
+ def test_policies_delete(monkeypatch, tmp_path):
75
+ monkeypatch.setattr(cfg, "CONFIG_FILE", tmp_path / "config.toml")
76
+ monkeypatch.setenv("ENTROPY_DATA_API_KEY", "test-key")
77
+ responses.add(responses.DELETE, f"{BASE_URL}/api/policies/pol_pii_handling", status=200)
78
+ result = runner.invoke(app, ["policies", "delete", "pol_pii_handling"])
79
+ assert result.exit_code == 0
80
+ assert "deleted" in result.output
81
+
82
+
83
+ def test_policies_help():
84
+ result = runner.invoke(app, ["policies", "--help"])
85
+ assert result.exit_code == 0
86
+ assert "list" in result.output
87
+ assert "get" in result.output
88
+ assert "put" in result.output
89
+ assert "delete" in result.output
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes