pvw-cli 1.0.6__tar.gz → 1.0.9__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.

Potentially problematic release.


This version of pvw-cli might be problematic. Click here for more details.

Files changed (74) hide show
  1. pvw_cli-1.0.9/PKG-INFO +800 -0
  2. pvw_cli-1.0.9/README.md +738 -0
  3. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/__init__.py +2 -2
  4. pvw_cli-1.0.9/purviewcli/cli/__init__.py +5 -0
  5. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/cli/cli.py +11 -13
  6. pvw_cli-1.0.9/purviewcli/cli/collections.py +502 -0
  7. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/cli/entity.py +464 -0
  8. pvw_cli-1.0.9/purviewcli/cli/search.py +319 -0
  9. pvw_cli-1.0.9/purviewcli/cli/unified_catalog.py +857 -0
  10. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/_search.py +7 -2
  11. pvw_cli-1.0.9/purviewcli/client/_unified_catalog.py +315 -0
  12. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/endpoint.py +13 -1
  13. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/sync_client.py +72 -15
  14. pvw_cli-1.0.9/pvw_cli.egg-info/PKG-INFO +800 -0
  15. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/pvw_cli.egg-info/SOURCES.txt +1 -3
  16. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/pvw_cli.egg-info/requires.txt +2 -1
  17. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/pyproject.toml +14 -10
  18. pvw-cli-1.0.6/PKG-INFO +0 -371
  19. pvw-cli-1.0.6/README.md +0 -336
  20. pvw-cli-1.0.6/purviewcli/cli/__init__.py +0 -5
  21. pvw-cli-1.0.6/purviewcli/cli/collections.py +0 -139
  22. pvw-cli-1.0.6/purviewcli/cli/data_product.py +0 -278
  23. pvw-cli-1.0.6/purviewcli/cli/search.py +0 -128
  24. pvw-cli-1.0.6/purviewcli/client/_data_product.py +0 -168
  25. pvw-cli-1.0.6/purviewcli/client/_unified_catalog.py +0 -318
  26. pvw-cli-1.0.6/pvw_cli.egg-info/PKG-INFO +0 -371
  27. pvw-cli-1.0.6/setup.py +0 -76
  28. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/__main__.py +0 -0
  29. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/cli/account.py +0 -0
  30. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/cli/domain.py +0 -0
  31. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/cli/glossary.py +0 -0
  32. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/cli/insight.py +0 -0
  33. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/cli/lineage.py +0 -0
  34. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/cli/management.py +0 -0
  35. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/cli/policystore.py +0 -0
  36. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/cli/relationship.py +0 -0
  37. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/cli/scan.py +0 -0
  38. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/cli/share.py +0 -0
  39. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/cli/types.py +0 -0
  40. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/cli/workflow.py +0 -0
  41. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/__init__.py +0 -0
  42. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/_account.py +0 -0
  43. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/_collections.py +0 -0
  44. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/_domain.py +0 -0
  45. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/_entity.py +0 -0
  46. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/_glossary.py +0 -0
  47. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/_insight.py +0 -0
  48. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/_lineage.py +0 -0
  49. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/_management.py +0 -0
  50. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/_policystore.py +0 -0
  51. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/_relationship.py +0 -0
  52. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/_scan.py +0 -0
  53. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/_share.py +0 -0
  54. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/_types.py +0 -0
  55. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/_workflow.py +0 -0
  56. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/api_client.py +0 -0
  57. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/business_rules.py +0 -0
  58. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/config.py +0 -0
  59. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/data_quality.py +0 -0
  60. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/endpoints.py +0 -0
  61. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/exceptions.py +0 -0
  62. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/lineage_visualization.py +0 -0
  63. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/monitoring_dashboard.py +0 -0
  64. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/rate_limiter.py +0 -0
  65. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/retry_handler.py +0 -0
  66. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/scanning_operations.py +0 -0
  67. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/client/settings.py +0 -0
  68. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/plugins/__init__.py +0 -0
  69. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/purviewcli/plugins/plugin_system.py +0 -0
  70. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/pvw_cli.egg-info/dependency_links.txt +0 -0
  71. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/pvw_cli.egg-info/entry_points.txt +0 -0
  72. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/pvw_cli.egg-info/not-zip-safe +0 -0
  73. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/pvw_cli.egg-info/top_level.txt +0 -0
  74. {pvw-cli-1.0.6 → pvw_cli-1.0.9}/setup.cfg +0 -0
pvw_cli-1.0.9/PKG-INFO ADDED
@@ -0,0 +1,800 @@
1
+ Metadata-Version: 2.4
2
+ Name: pvw-cli
3
+ Version: 1.0.9
4
+ Summary: Microsoft Purview CLI with comprehensive automation capabilities
5
+ Author-email: AYOUB KEBAILI <keayoub@msn.com>
6
+ Maintainer-email: AYOUB KEBAILI <keayoub@msn.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/Keayoub/Purview_cli
9
+ Project-URL: Documentation, https://github.com/Keayoub/Purview_cli/wiki
10
+ Project-URL: Repository, https://github.com/Keayoub/Purview_cli.git
11
+ Project-URL: Bug Tracker, https://github.com/Keayoub/Purview_cli/issues
12
+ Project-URL: Source, https://github.com/Keayoub/Purview_cli
13
+ Keywords: azure,purview,cli,data,catalog,governance,automation,pvw
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: System Administrators
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.8
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
+ Classifier: Topic :: System :: Systems Administration
26
+ Classifier: Topic :: Database
27
+ Classifier: Topic :: Internet :: WWW/HTTP
28
+ Requires-Python: >=3.8
29
+ Description-Content-Type: text/markdown
30
+ Requires-Dist: click>=8.0.0
31
+ Requires-Dist: rich>=12.0.0
32
+ Requires-Dist: azure-identity>=1.12.0
33
+ Requires-Dist: azure-core>=1.24.0
34
+ Requires-Dist: requests>=2.28.0
35
+ Requires-Dist: pandas>=1.5.0
36
+ Requires-Dist: aiohttp>=3.8.0
37
+ Requires-Dist: pydantic<3.0.0,>=1.10.0
38
+ Requires-Dist: typer>=0.7.0
39
+ Requires-Dist: PyYAML>=6.0
40
+ Requires-Dist: python-dotenv>=0.19.0
41
+ Requires-Dist: asyncio-throttle>=1.0.0
42
+ Requires-Dist: tabulate>=0.9.0
43
+ Requires-Dist: cryptography<46.0.0,>=41.0.5
44
+ Provides-Extra: dev
45
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
46
+ Requires-Dist: pytest-asyncio>=0.20.0; extra == "dev"
47
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
48
+ Requires-Dist: black>=22.0.0; extra == "dev"
49
+ Requires-Dist: isort>=5.10.0; extra == "dev"
50
+ Requires-Dist: flake8>=5.0.0; extra == "dev"
51
+ Requires-Dist: mypy>=0.991; extra == "dev"
52
+ Requires-Dist: pre-commit>=2.20.0; extra == "dev"
53
+ Provides-Extra: docs
54
+ Requires-Dist: sphinx>=5.0.0; extra == "docs"
55
+ Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "docs"
56
+ Requires-Dist: myst-parser>=0.18.0; extra == "docs"
57
+ Provides-Extra: test
58
+ Requires-Dist: pytest>=7.0.0; extra == "test"
59
+ Requires-Dist: pytest-asyncio>=0.20.0; extra == "test"
60
+ Requires-Dist: pytest-cov>=4.0.0; extra == "test"
61
+ Requires-Dist: requests-mock>=1.9.0; extra == "test"
62
+
63
+ # PURVIEW CLI v1.0.9 - Microsoft Purview Automation & Data Governance
64
+
65
+ > **LATEST UPDATE (September 2025):**
66
+ > - **🚀 MAJOR: Complete Microsoft Purview Unified Catalog (UC) Support** (see new `uc` command group)
67
+ > - Full governance domains, glossary terms, data products, OKRs, and critical data elements management
68
+ > - Feature parity with UnifiedCatalogPy project with enhanced CLI experience
69
+ > - Advanced Data Product Management (legacy `data-product` command group)
70
+ > - Enhanced Discovery Query/Search support
71
+ > - **Fixed all command examples to use correct `pvw` command**
72
+
73
+ ---
74
+
75
+ ## What is PVW CLI?
76
+
77
+ **PVW CLI v1.0.9** is a modern, full-featured command-line interface and Python library for Microsoft Purview. It enables automation and management of *all major Purview APIs* including:
78
+
79
+ - **NEW Unified Catalog (UC) Management** - Complete governance domains, glossary terms, data products, OKRs, CDEs (NEW)
80
+ - Entity management (create, update, bulk, import/export)
81
+ - Glossary and term management
82
+ - Lineage operations
83
+ - Collection and account management
84
+ - Advanced search and discovery
85
+ - Data product management (legacy compatibility)
86
+ - Classification, label, and status management
87
+ - And more (see command reference)
88
+
89
+ The CLI is designed for data engineers, stewards, architects, and platform teams to automate, scale, and enhance their Microsoft Purview experience.
90
+
91
+ ---
92
+
93
+ ## Quick Start (pip install)
94
+
95
+ Get started with PVW CLI in minutes:
96
+
97
+ 1. **Install the CLI**
98
+
99
+ ```bash
100
+ pip install pvw-cli
101
+ ```
102
+
103
+ 2. **Set Required Environment Variables**
104
+
105
+ ```bash
106
+ # Required for Purview API access
107
+ set PURVIEW_ACCOUNT_NAME=your-purview-account
108
+ set PURVIEW_ACCOUNT_ID=your-purview-account-id-guid
109
+ set PURVIEW_RESOURCE_GROUP=your-resource-group-name
110
+
111
+ # Optional
112
+ set AZURE_REGION= # (optional, e.g. 'china', 'usgov')
113
+ ```
114
+
115
+ 3. **Authenticate**
116
+
117
+ - Run `az login` (recommended)
118
+ - Or set Service Principal credentials as environment variables
119
+
120
+ 4. **List Your Governance Domains (UC)**
121
+
122
+ ```bash
123
+ pvw uc domain list
124
+ ```
125
+
126
+ 5. **Run Your First Search**
127
+
128
+ ```bash
129
+ pvw search query --keywords="customer" --limit=5
130
+ ```
131
+
132
+ 6. **See All Commands**
133
+
134
+ ```bash
135
+ pvw --help
136
+ pvw uc --help
137
+ ```
138
+
139
+ For more advanced usage, see the sections below or visit the [documentation](https://pvw-cli.readthedocs.io/).
140
+
141
+ ---
142
+
143
+ ## Overview
144
+
145
+ **PVW CLI v1.0.9** is a modern command-line interface and Python library for Microsoft Purview, enabling:
146
+
147
+ - Advanced data catalog search and discovery
148
+ - Bulk import/export of entities, glossary terms, and lineage
149
+ - Real-time monitoring and analytics
150
+ - Automated governance and compliance
151
+ - Extensible plugin system
152
+
153
+ ---
154
+
155
+ ## Installation
156
+
157
+ You can install PVW CLI in two ways:
158
+
159
+ 1. **From PyPI (recommended for most users):**
160
+
161
+ ```bash
162
+ pip install pvw-cli
163
+ ```
164
+
165
+ 2. **Directly from the GitHub repository (for latest/dev version):**
166
+
167
+ ```bash
168
+ pip install git+https://github.com/Keayoub/Purview_cli.git
169
+ ```
170
+
171
+ Or for development (editable install):
172
+
173
+ ```bash
174
+ git clone https://github.com/Keayoub/Purview_cli.git
175
+ cd Purview_cli
176
+ pip install -r requirements.txt
177
+ pip install -e .
178
+ ```
179
+
180
+ ---
181
+
182
+ ## Requirements
183
+
184
+ - Python 3.8+
185
+ - Azure CLI (`az login`) or Service Principal credentials
186
+ - Microsoft Purview account
187
+
188
+ ---
189
+
190
+ ## Getting Started
191
+
192
+ 1. **Install**
193
+
194
+ ```bash
195
+ pip install pvw-cli
196
+ ```
197
+
198
+ 2. **Set Required Environment Variables**
199
+
200
+ ```bash
201
+ # Required for Purview API access
202
+ set PURVIEW_ACCOUNT_NAME=your-purview-account
203
+ set PURVIEW_ACCOUNT_ID=your-purview-account-id-guid
204
+ set PURVIEW_RESOURCE_GROUP=your-resource-group-name
205
+
206
+ # Optional
207
+ set AZURE_REGION= # (optional, e.g. 'china', 'usgov')
208
+ ```
209
+
210
+ 3. **Authenticate**
211
+
212
+ - Azure CLI: `az login`
213
+
214
+ - Or set Service Principal credentials as environment variables
215
+
216
+ 4. **Run a Command**
217
+
218
+ ```bash
219
+ pvw search query --keywords="customer" --limit=5
220
+ ```
221
+
222
+ 5. **See All Commands**
223
+
224
+ ```bash
225
+ pvw --help
226
+ ```
227
+
228
+ ---
229
+
230
+ ## Authentication
231
+
232
+ PVW CLI supports multiple authentication methods for connecting to Microsoft Purview, powered by Azure Identity's `DefaultAzureCredential`. This allows you to use the CLI securely in local development, CI/CD, and production environments.
233
+
234
+ ### 1. Azure CLI Authentication (Recommended for Interactive Use)
235
+
236
+ - Run `az login` to authenticate interactively with your Azure account.
237
+ - The CLI will automatically use your Azure CLI credentials.
238
+
239
+ ### 2. Service Principal Authentication (Recommended for Automation/CI/CD)
240
+
241
+ Set the following environment variables before running any PVW CLI command:
242
+
243
+ - `AZURE_CLIENT_ID` (your Azure AD app registration/client ID)
244
+ - `AZURE_TENANT_ID` (your Azure AD tenant ID)
245
+ - `AZURE_CLIENT_SECRET` (your client secret)
246
+
247
+ **Example (Windows):**
248
+
249
+ ```cmd
250
+ set AZURE_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
251
+ set AZURE_TENANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
252
+ set AZURE_CLIENT_SECRET=your-client-secret
253
+ ```
254
+
255
+ **Example (Linux/macOS):**
256
+
257
+ ```bash
258
+ export AZURE_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
259
+ export AZURE_TENANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
260
+ export AZURE_CLIENT_SECRET=your-client-secret
261
+ ```
262
+
263
+ ### 3. Managed Identity (for Azure VMs, App Services, etc.)
264
+
265
+ If running in Azure with a managed identity, no extra configuration is needed. The CLI will use the managed identity automatically.
266
+
267
+ ### 4. Visual Studio/VS Code Authentication
268
+
269
+ If you are signed in to Azure in Visual Studio or VS Code, `DefaultAzureCredential` can use those credentials as a fallback.
270
+
271
+ ---
272
+
273
+ **Note:**
274
+ - The CLI will try all supported authentication methods in order. The first one that works will be used.
275
+ - For most automation and CI/CD scenarios, service principal authentication is recommended.
276
+ - For local development, Azure CLI authentication is easiest.
277
+
278
+ For more details, see the [Azure Identity documentation](https://learn.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python).
279
+
280
+ ---
281
+
282
+ ## Required Purview Configuration
283
+
284
+ Before using PVW CLI, you need to set three essential environment variables. Here's how to find them:
285
+
286
+ ### 🔍 **How to Find Your Purview Values**
287
+
288
+ #### **1. PURVIEW_ACCOUNT_NAME**
289
+ - This is your Purview account name as it appears in Azure Portal
290
+ - Example: `kaydemopurview`
291
+
292
+ #### **2. PURVIEW_ACCOUNT_ID**
293
+ - This is the GUID that identifies your Purview account for Unified Catalog APIs
294
+ - **✅ Important: For most Purview deployments, this is your Azure Tenant ID**
295
+
296
+ - **Method 1 - Get your Tenant ID (recommended):**
297
+
298
+ **Bash/Command Prompt:**
299
+ ```bash
300
+ az account show --query tenantId -o tsv
301
+ ```
302
+
303
+ **PowerShell:**
304
+ ```powershell
305
+ az account show --query tenantId -o tsv
306
+ # Or store directly in environment variable:
307
+ $env:PURVIEW_ACCOUNT_ID = az account show --query tenantId -o tsv
308
+ ```
309
+
310
+ - **Method 2 - Azure CLI (extract from Atlas endpoint):**
311
+ ```bash
312
+ az purview account show --name YOUR_ACCOUNT_NAME --resource-group YOUR_RG --query endpoints.catalog -o tsv
313
+ ```
314
+ Extract the GUID from the URL (before `-api.purview-service.microsoft.com`)
315
+
316
+ - **Method 3 - Azure Portal:**
317
+ 1. Go to your Purview account in Azure Portal
318
+ 2. Navigate to Properties → Atlas endpoint URL
319
+ 3. Extract GUID from: `https://GUID-api.purview-service.microsoft.com/catalog`
320
+
321
+ #### **3. PURVIEW_RESOURCE_GROUP**
322
+ - The Azure resource group containing your Purview account
323
+ - Example: `fabric-artifacts`
324
+
325
+ ### 📋 **Setting the Variables**
326
+
327
+ **Windows Command Prompt:**
328
+ ```cmd
329
+ set PURVIEW_ACCOUNT_NAME=your-purview-account
330
+ set PURVIEW_ACCOUNT_ID=your-purview-account-id
331
+ set PURVIEW_RESOURCE_GROUP=your-resource-group
332
+ ```
333
+
334
+ **Windows PowerShell:**
335
+ ```powershell
336
+ $env:PURVIEW_ACCOUNT_NAME="your-purview-account"
337
+ $env:PURVIEW_ACCOUNT_ID="your-purview-account-id"
338
+ $env:PURVIEW_RESOURCE_GROUP="your-resource-group"
339
+ ```
340
+
341
+ **Linux/macOS:**
342
+ ```bash
343
+ export PURVIEW_ACCOUNT_NAME=your-purview-account
344
+ export PURVIEW_ACCOUNT_ID=your-purview-account-id
345
+ export PURVIEW_RESOURCE_GROUP=your-resource-group
346
+ ```
347
+
348
+ **Permanent (Windows Command Prompt):**
349
+ ```cmd
350
+ setx PURVIEW_ACCOUNT_NAME "your-purview-account"
351
+ setx PURVIEW_ACCOUNT_ID "your-purview-account-id"
352
+ setx PURVIEW_RESOURCE_GROUP "your-resource-group"
353
+ ```
354
+
355
+ **Permanent (Windows PowerShell):**
356
+ ```powershell
357
+ [Environment]::SetEnvironmentVariable("PURVIEW_ACCOUNT_NAME", "your-purview-account", "User")
358
+ [Environment]::SetEnvironmentVariable("PURVIEW_ACCOUNT_ID", "your-purview-account-id", "User")
359
+ [Environment]::SetEnvironmentVariable("PURVIEW_RESOURCE_GROUP", "your-resource-group", "User")
360
+ ```
361
+
362
+ ### 🔧 **Debug Environment Issues**
363
+
364
+ If you experience issues with environment variables between different terminals, use these debug commands:
365
+
366
+ **Command Prompt/Bash:**
367
+ ```bash
368
+ # Run this to check your current environment
369
+ python -c "
370
+ import os
371
+ print('PURVIEW_ACCOUNT_NAME:', os.getenv('PURVIEW_ACCOUNT_NAME'))
372
+ print('PURVIEW_ACCOUNT_ID:', os.getenv('PURVIEW_ACCOUNT_ID'))
373
+ print('PURVIEW_RESOURCE_GROUP:', os.getenv('PURVIEW_RESOURCE_GROUP'))
374
+ "
375
+ ```
376
+
377
+ **PowerShell:**
378
+ ```powershell
379
+ # Check environment variables in PowerShell
380
+ python -c "
381
+ import os
382
+ print('PURVIEW_ACCOUNT_NAME:', os.getenv('PURVIEW_ACCOUNT_NAME'))
383
+ print('PURVIEW_ACCOUNT_ID:', os.getenv('PURVIEW_ACCOUNT_ID'))
384
+ print('PURVIEW_RESOURCE_GROUP:', os.getenv('PURVIEW_RESOURCE_GROUP'))
385
+ "
386
+
387
+ # Or use PowerShell native commands
388
+ Write-Host "PURVIEW_ACCOUNT_NAME: $env:PURVIEW_ACCOUNT_NAME"
389
+ Write-Host "PURVIEW_ACCOUNT_ID: $env:PURVIEW_ACCOUNT_ID"
390
+ Write-Host "PURVIEW_RESOURCE_GROUP: $env:PURVIEW_RESOURCE_GROUP"
391
+ ```
392
+
393
+ ---
394
+
395
+ ## Search Command (Discovery Query API)
396
+
397
+ The PVW CLI provides advanced search using the latest Microsoft Purview Discovery Query API:
398
+
399
+ - Search for assets, tables, files, and more with flexible filters
400
+ - Use autocomplete and suggestion endpoints
401
+ - Perform faceted, time-based, and entity-type-specific queries
402
+
403
+ ### CLI Usage Examples
404
+
405
+ #### 🎯 **Multiple Output Formats**
406
+
407
+ ```bash
408
+ # 1. Table Format (Default) - Quick overview
409
+ pvw search query --keywords="customer" --limit=5
410
+ # → Clean table with Name, Type, Collection, Classifications, Qualified Name
411
+
412
+ # 2. Detailed Format - Human-readable with all metadata
413
+ pvw search query --keywords="customer" --limit=5 --detailed
414
+ # → Rich panels showing full details, timestamps, search scores
415
+
416
+ # 3. JSON Format - Complete technical details with syntax highlighting (WELL-FORMATTED)
417
+ pvw search query --keywords="customer" --limit=5 --json
418
+ # → Full JSON response with indentation, line numbers and color coding
419
+
420
+ # 4. Table with IDs - For entity operations
421
+ pvw search query --keywords="customer" --limit=5 --show-ids
422
+ # → Table format + entity GUIDs for copy/paste into update commands
423
+ ```
424
+
425
+ #### 🔍 **Search Operations**
426
+
427
+ ```bash
428
+ # Basic search for assets with keyword 'customer'
429
+ pvw search query --keywords="customer" --limit=5
430
+
431
+ # Advanced search with classification filter
432
+ pvw search query --keywords="sales" --classification="PII" --objectType="Tables" --limit=10
433
+
434
+ # Pagination through large result sets
435
+ pvw search query --keywords="SQL" --offset=10 --limit=5
436
+
437
+ # Autocomplete suggestions for partial keyword
438
+ pvw search autocomplete --keywords="ord" --limit=3
439
+
440
+ # Get search suggestions (fuzzy matching)
441
+ pvw search suggest --keywords="prod" --limit=2
442
+
443
+ **⚠️ IMPORTANT - Command Line Quoting:**
444
+ ```cmd
445
+ # ✅ CORRECT - Use quotes around keywords
446
+ pvw search query --keywords="customer" --limit=5
447
+
448
+ # ✅ CORRECT - For wildcard searches, use quotes
449
+ pvw search query --keywords="*" --limit=5
450
+
451
+ # ❌ WRONG - Don't use unquoted * (shell expands to file names)
452
+ pvw search query --keywords=* --limit=5
453
+ # This causes: "Error: Got unexpected extra arguments (dist doc ...)"
454
+ ```
455
+
456
+ ```bash
457
+ # Faceted search with aggregation
458
+ pvw search query --keywords="finance" --facetFields="objectType,classification" --limit=5
459
+
460
+ # Browse entities by type and path
461
+ pvw search browse --entityType="Tables" --path="/root/finance" --limit=2
462
+
463
+ # Time-based search for assets created after a date
464
+ pvw search query --keywords="audit" --createdAfter="2024-01-01" --limit=1
465
+
466
+ # Entity type specific search
467
+ pvw search query --keywords="finance" --entityTypes="Files,Tables" --limit=2
468
+ ```
469
+
470
+ #### 💡 **Usage Scenarios**
471
+
472
+ - **Daily browsing**: Use default table format for quick scans
473
+ - **Understanding assets**: Use `--detailed` for rich information panels
474
+ - **Technical work**: Use `--json` for complete API data access
475
+ - **Entity operations**: Use `--show-ids` to get GUIDs for updates
476
+
477
+ ### Python Usage Example
478
+
479
+ ```python
480
+ from purviewcli.client._search import Search
481
+
482
+ search = Search()
483
+ args = {"--keywords": "customer", "--limit": 5}
484
+ search.searchQuery(args)
485
+ print(search.payload) # Shows the constructed search payload
486
+ ```
487
+
488
+ ### Test Examples
489
+
490
+ See `tests/test_search_examples.py` for ready-to-run pytest examples covering all search scenarios:
491
+
492
+ - Basic query
493
+ - Advanced filter
494
+ - Autocomplete
495
+ - Suggest
496
+ - Faceted search
497
+ - Browse
498
+ - Time-based search
499
+ - Entity type search
500
+
501
+ ---
502
+
503
+ ## Unified Catalog Management (NEW)
504
+
505
+ PVW CLI now includes comprehensive **Microsoft Purview Unified Catalog (UC)** support with the new `uc` command group. This provides complete management of modern data governance features including governance domains, glossary terms, data products, objectives (OKRs), and critical data elements.
506
+
507
+ **🎯 Feature Parity**: Full compatibility with [UnifiedCatalogPy](https://github.com/olafwrieden/unifiedcatalogpy) functionality.
508
+
509
+ See [`doc/commands/unified-catalog.md`](doc/commands/unified-catalog.md) for complete documentation and examples.
510
+
511
+ ### Quick UC Examples
512
+
513
+ #### 🏛️ **Governance Domains Management**
514
+
515
+ ```bash
516
+ # List all governance domains
517
+ pvw uc domain list
518
+
519
+ # Create a new governance domain
520
+ pvw uc domain create --name "Finance" --description "Financial data governance domain"
521
+
522
+ # Get domain details
523
+ pvw uc domain get --domain-id "abc-123-def-456"
524
+
525
+ # Update domain information
526
+ pvw uc domain update --domain-id "abc-123" --description "Updated financial governance"
527
+ ```
528
+
529
+ #### 📖 **Glossary Terms in UC**
530
+
531
+ ```bash
532
+ # List all terms in a domain
533
+ pvw uc term list --domain-id "abc-123"
534
+
535
+ # Create a new glossary term
536
+ pvw uc term create --name "Customer" --domain-id "abc-123" --definition "A person or entity that purchases products"
537
+
538
+ # Get term details with relationships
539
+ pvw uc term get --term-id "term-456" --domain-id "abc-123"
540
+
541
+ # Link terms to data assets
542
+ pvw uc term assign --term-id "term-456" --asset-id "asset-789" --domain-id "abc-123"
543
+ ```
544
+
545
+ #### 📦 **Data Products Management**
546
+
547
+ ```bash
548
+ # List all data products in a domain
549
+ pvw uc dataproduct list --domain-id "abc-123"
550
+
551
+ # Create a comprehensive data product
552
+ pvw uc dataproduct create \
553
+ --name "Customer Analytics Dashboard" \
554
+ --domain-id "abc-123" \
555
+ --description "360-degree customer analytics with behavioral insights" \
556
+ --owner "data-team@company.com"
557
+
558
+ # Get detailed data product information
559
+ pvw uc dataproduct get --product-id "prod-789" --domain-id "abc-123"
560
+
561
+ # Update data product metadata
562
+ pvw uc dataproduct update \
563
+ --product-id "prod-789" \
564
+ --domain-id "abc-123" \
565
+ --status "active" \
566
+ --version "v2.1.0"
567
+
568
+ # Add data assets to a data product
569
+ pvw uc dataproduct add-asset \
570
+ --product-id "prod-789" \
571
+ --domain-id "abc-123" \
572
+ --asset-id "ece43ce5-ac45-4e50-a4d0-365a64299efc"
573
+ ```
574
+
575
+ #### 🎯 **Objectives & Key Results (OKRs)**
576
+
577
+ ```bash
578
+ # List objectives for a domain
579
+ pvw uc objective list --domain-id "abc-123"
580
+
581
+ # Create measurable objectives
582
+ pvw uc objective create \
583
+ --definition "Improve data quality score by 25% within Q4" \
584
+ --domain-id "abc-123" \
585
+ --target-value "95" \
586
+ --measurement-unit "percentage"
587
+
588
+ # Track objective progress
589
+ pvw uc objective update \
590
+ --objective-id "obj-456" \
591
+ --domain-id "abc-123" \
592
+ --current-value "87" \
593
+ --status "in-progress"
594
+ ```
595
+
596
+ #### 🔑 **Critical Data Elements (CDEs)**
597
+
598
+ ```bash
599
+ # List critical data elements
600
+ pvw uc cde list --domain-id "abc-123"
601
+
602
+ # Define critical data elements with governance rules
603
+ pvw uc cde create \
604
+ --name "Social Security Number" \
605
+ --data-type "String" \
606
+ --domain-id "abc-123" \
607
+ --classification "PII" \
608
+ --retention-period "7-years"
609
+
610
+ # Associate CDEs with data assets
611
+ pvw uc cde link \
612
+ --cde-id "cde-789" \
613
+ --domain-id "abc-123" \
614
+ --asset-id "ea3412c3-7387-4bc1-9923-11f6f6f60000"
615
+ ```
616
+
617
+ #### 🔄 **Integrated Workflow Example**
618
+
619
+ ```bash
620
+ # 1. Discover assets to govern
621
+ pvw search query --keywords="customer" --detailed
622
+
623
+ # 2. Create governance domain for discovered assets
624
+ pvw uc domain create --name "Customer Data" --description "Customer information governance"
625
+
626
+ # 3. Define governance terms
627
+ pvw uc term create --name "Customer PII" --domain-id "new-domain-id" --definition "Personal customer information"
628
+
629
+ # 4. Create data product from discovered assets
630
+ pvw uc dataproduct create --name "Customer Master Data" --domain-id "new-domain-id"
631
+
632
+ # 5. Set governance objectives
633
+ pvw uc objective create --definition "Ensure 100% PII classification compliance" --domain-id "new-domain-id"
634
+ ```
635
+
636
+ ---
637
+
638
+ ## Entity Management & Updates
639
+
640
+ PVW CLI provides comprehensive entity management capabilities for updating Purview assets like descriptions, classifications, and custom attributes.
641
+
642
+ ### 🔄 **Entity Update Examples**
643
+
644
+ #### **Update Asset Descriptions**
645
+
646
+ ```bash
647
+ # Update table description using GUID
648
+ pvw entity update-attribute \
649
+ --guid "ece43ce5-ac45-4e50-a4d0-365a64299efc" \
650
+ --attribute "description" \
651
+ --value "Updated customer data warehouse table with enhanced analytics"
652
+
653
+ # Update dataset description using qualified name
654
+ pvw entity update-attribute \
655
+ --qualifiedName "https://app.powerbi.com/groups/abc-123/datasets/def-456" \
656
+ --attribute "description" \
657
+ --value "Power BI dataset for customer analytics dashboard"
658
+ ```
659
+
660
+ #### **Bulk Entity Operations**
661
+
662
+ ```bash
663
+ # Read entity details before updating
664
+ pvw entity read-by-attribute \
665
+ --guid "ea3412c3-7387-4bc1-9923-11f6f6f60000" \
666
+ --attribute "description,classifications,customAttributes"
667
+
668
+ # Update multiple attributes at once
669
+ pvw entity update-bulk \
670
+ --input-file entities_to_update.json \
671
+ --output-file update_results.json
672
+ ```
673
+
674
+ #### **Column-Level Updates**
675
+
676
+ ```bash
677
+ # Update specific column descriptions in a table
678
+ pvw entity update-attribute \
679
+ --guid "column-guid-123" \
680
+ --attribute "description" \
681
+ --value "Customer unique identifier - Primary Key"
682
+
683
+ # Add classifications to sensitive columns
684
+ pvw entity add-classification \
685
+ --guid "column-guid-456" \
686
+ --classification "MICROSOFT.PERSONAL.EMAIL"
687
+ ```
688
+
689
+ ### 🔍 **Discovery to Update Workflow**
690
+
691
+ ```bash
692
+ # 1. Find assets that need updates
693
+ pvw search query --keywords="customer table" --show-ids --limit=10
694
+
695
+ # 2. Get detailed information about a specific asset
696
+ pvw entity read-by-attribute --guid "FOUND_GUID" --attribute "description,classifications"
697
+
698
+ # 3. Update the asset description
699
+ pvw entity update-attribute \
700
+ --guid "FOUND_GUID" \
701
+ --attribute "description" \
702
+ --value "Updated description based on business requirements"
703
+
704
+ # 4. Verify the update
705
+ pvw search query --keywords="FOUND_GUID" --detailed
706
+ ```
707
+
708
+ ---
709
+
710
+ ## Data Product Management (Legacy)
711
+
712
+ PVW CLI also includes the original `data-product` command group for backward compatibility with traditional data product lifecycle management.
713
+
714
+ See [`doc/commands/data-product.md`](doc/commands/data-product.md) for full documentation and examples.
715
+
716
+ ### Example Commands
717
+
718
+ ```bash
719
+ # Create a data product
720
+ pvw data-product create --qualified-name="product.test.1" --name="Test Product" --description="A test data product"
721
+
722
+ # Add classification and label
723
+ pvw data-product add-classification --qualified-name="product.test.1" --classification="PII"
724
+ pvw data-product add-label --qualified-name="product.test.1" --label="gold"
725
+
726
+ # Link glossary term
727
+ pvw data-product link-glossary --qualified-name="product.test.1" --term="Customer"
728
+
729
+ # Set status and show lineage
730
+ pvw data-product set-status --qualified-name="product.test.1" --status="active"
731
+ pvw data-product show-lineage --qualified-name="product.test.1"
732
+ ```
733
+
734
+ ---
735
+
736
+ ## Core Features
737
+
738
+ - **Unified Catalog (UC)**: Complete modern data governance (NEW)
739
+ ```bash
740
+ # Manage governance domains, terms, data products, OKRs, CDEs
741
+ pvw uc domain list
742
+ pvw uc term create --name "Customer" --domain-id "abc-123"
743
+ pvw uc objective create --definition "Improve quality" --domain-id "abc-123"
744
+ ```
745
+ - **Discovery Query/Search**: Flexible, advanced search for all catalog assets
746
+ - **Entity Management**: Bulk import/export, update, and validation
747
+ - **Glossary Management**: Import/export terms, assign terms in bulk
748
+ ```bash
749
+ # List all terms in a glossary
750
+ pvw glossary list-terms --glossary-guid "your-glossary-guid"
751
+
752
+ # Create and manage glossary terms
753
+ pvw glossary create-term --payload-file term.json
754
+ ```
755
+ - **Lineage Operations**: Lineage discovery, CSV-based bulk lineage
756
+ - **Monitoring & Analytics**: Real-time dashboards, metrics, and reporting
757
+ - **Plugin System**: Extensible with custom plugins
758
+
759
+ ---
760
+
761
+ ## API Coverage and Support
762
+
763
+ PVW CLI provides comprehensive automation for all major Microsoft Purview APIs, including the new **Unified Catalog APIs** for modern data governance.
764
+
765
+ ### Supported API Groups
766
+
767
+ - **Unified Catalog**: Complete governance domains, glossary terms, data products, OKRs, CDEs management ✅
768
+ - **Data Map**: Full entity and lineage management ✅
769
+ - **Discovery**: Advanced search, browse, and query capabilities ✅
770
+ - **Collections**: Collection and account management ✅
771
+ - **Management**: Administrative operations ✅
772
+ - **Scan**: Data source scanning and configuration ✅
773
+
774
+ ### API Version Support
775
+
776
+ - **Unified Catalog**: Latest UC API endpoints (September 2025)
777
+ - Data Map: **2024-03-01-preview** (default) or **2023-09-01** (stable)
778
+ - Collections: **2019-11-01-preview**
779
+ - Account: **2019-11-01-preview**
780
+ - Management: **2021-07-01**
781
+ - Scan: **2018-12-01-preview**
782
+
783
+ For the latest API documentation and updates, see:
784
+ - [Microsoft Purview REST API reference](https://learn.microsoft.com/en-us/rest/api/purview/)
785
+ - [Atlas 2.2 API documentation](https://learn.microsoft.com/en-us/purview/data-gov-api-atlas-2-2)
786
+ - [Azure Updates](https://azure.microsoft.com/updates/) for new releases
787
+
788
+ If you need a feature that is not yet implemented, please open an issue or check for updates in future releases.
789
+
790
+ ---
791
+
792
+ ## Contributing & Support
793
+
794
+ - [Documentation](https://github.com/Keayoub/Purview_cli/blob/main/doc/README.md)
795
+ - [Issue Tracker](https://github.com/Keayoub/Purview_cli/issues)
796
+ - [Email Support](mailto:keayoub@msn.com)
797
+
798
+ ---
799
+
800
+ **PVW CLI empowers data engineers, stewards, and architects to automate, scale, and enhance their Microsoft Purview experience with powerful command-line and programmatic capabilities.**