# PURVIEW CLI v1.0.0 - Microsoft Purview Automation & Data Governance
> **LATEST UPDATE (June 2025):**
> - Major: Advanced Data Product Management (see new `data-product` command group)
> - Enhanced Discovery Query/Search support (see below for usage).
---
## What is PVW CLI?
**PVW CLI v1.0.0** 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:
- Entity management (create, update, bulk, import/export)
- Glossary and term management
- Lineage operations
- Collection and account management
- Advanced search and discovery
- Data product management (new, see below)
- Classification, label, and status management
- And more (see command reference)
The CLI is designed for data engineers, stewards, architects, and platform teams to automate, scale, and enhance their Microsoft Purview experience.
---
## Quick Start (pip install)
Get started with PVW CLI in minutes:
1. **Install the CLI**
```bash
pip install pvw-cli
```
2. **Set Environment Variables**
```bash
set PURVIEW_ACCOUNT_NAME=your-purview-account
set AZURE_REGION= # (optional, e.g. 'china', 'usgov')
```
3. **Authenticate**
- Run `az login` (recommended)
- Or set Service Principal credentials as environment variables
4. **Run Your First Search**
```bash
pvw search query --keywords="customer" --limit=5
```
5. **See All Commands**
```bash
pvw --help
```
For more advanced usage, see the sections below or visit the [documentation](https://pvw-cli.readthedocs.io/).
---
## Overview
**PVW CLI v1.0.0** is a modern command-line interface and Python library for Microsoft Purview, enabling:
- Advanced data catalog search and discovery
- Bulk import/export of entities, glossary terms, and lineage
- Real-time monitoring and analytics
- Automated governance and compliance
- Extensible plugin system
---
## Installation
You can install PVW CLI in two ways:
1. **From PyPI (recommended for most users):**
```bash
pip install pvw-cli
```
2. **Directly from the GitHub repository (for latest/dev version):**
```bash
pip install git+https://github.com/Keayoub/Purview_cli.git
```
Or for development (editable install):
```bash
git clone https://github.com/Keayoub/Purview_cli.git
cd Purview_cli
pip install -r requirements.txt
pip install -e .
```
---
## Requirements
- Python 3.8+
- Azure CLI (`az login`) or Service Principal credentials
- Microsoft Purview account
---
## Getting Started
1. **Install**
```bash
pip install pvw-cli
```
2. **Set Environment Variables**
```bash
set PURVIEW_ACCOUNT_NAME=your-purview-account
set AZURE_REGION= # (optional, e.g. 'china', 'usgov')
```
3. **Authenticate**
- Azure CLI: `az login`
- Or set Service Principal credentials as environment variables
4. **Run a Command**
```bash
pvw search query --keywords="customer" --limit=5
```
5. **See All Commands**
```bash
pvw --help
```
---
## Authentication
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.
### 1. Azure CLI Authentication (Recommended for Interactive Use)
- Run `az login` to authenticate interactively with your Azure account.
- The CLI will automatically use your Azure CLI credentials.
### 2. Service Principal Authentication (Recommended for Automation/CI/CD)
Set the following environment variables before running any PVW CLI command:
- `AZURE_CLIENT_ID` (your Azure AD app registration/client ID)
- `AZURE_TENANT_ID` (your Azure AD tenant ID)
- `AZURE_CLIENT_SECRET` (your client secret)
**Example (Windows):**
```cmd
set AZURE_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
set AZURE_TENANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
set AZURE_CLIENT_SECRET=your-client-secret
```
**Example (Linux/macOS):**
```bash
export AZURE_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export AZURE_TENANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export AZURE_CLIENT_SECRET=your-client-secret
```
### 3. Managed Identity (for Azure VMs, App Services, etc.)
If running in Azure with a managed identity, no extra configuration is needed. The CLI will use the managed identity automatically.
### 4. Visual Studio/VS Code Authentication
If you are signed in to Azure in Visual Studio or VS Code, `DefaultAzureCredential` can use those credentials as a fallback.
---
**Note:**
- The CLI will try all supported authentication methods in order. The first one that works will be used.
- For most automation and CI/CD scenarios, service principal authentication is recommended.
- For local development, Azure CLI authentication is easiest.
For more details, see the [Azure Identity documentation](https://learn.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python).
---
## Search Command (Discovery Query API)
The PVW CLI provides advanced search using the latest Microsoft Purview Discovery Query API:
- Search for assets, tables, files, and more with flexible filters
- Use autocomplete and suggestion endpoints
- Perform faceted, time-based, and entity-type-specific queries
### CLI Usage Examples
```bash
# Basic search for assets with keyword 'customer'
pvw search query --keywords="customer" --limit=5
# Advanced search with classification filter
pvw search query --keywords="sales" --classification="PII" --objectType="Tables" --limit=10
# Autocomplete suggestions for partial keyword
pvw search autocomplete --keywords="ord" --limit=3
# Get search suggestions (fuzzy matching)
pvw search suggest --keywords="prod" --limit=2
# Faceted search with aggregation
pvw search query --keywords="finance" --facetFields="objectType,classification" --limit=5
# Browse entities by type and path
pvw search browse --entityType="Tables" --path="/root/finance" --limit=2
# Time-based search for assets created after a date
pvw search query --keywords="audit" --createdAfter="2024-01-01" --limit=1
# Entity type specific search
pvw search query --entityTypes="Files,Tables" --limit=2
```
### Python Usage Example
```python
from purviewcli.client._search import Search
search = Search()
args = {"--keywords": "customer", "--limit": 5}
search.searchQuery(args)
print(search.payload) # Shows the constructed search payload
```
### Test Examples
See `tests/test_search_examples.py` for ready-to-run pytest examples covering all search scenarios:
- Basic query
- Advanced filter
- Autocomplete
- Suggest
- Faceted search
- Browse
- Time-based search
- Entity type search
---
## Data Product Management (Advanced)
PVW CLI now includes a powerful `data-product` command group for advanced data product lifecycle management. This is in addition to the CLI's support for all core Purview APIs.
See [`doc/commands/data-product.md`](doc/commands/data-product.md) for full documentation and examples.
### Example Commands
```bash
# Create a data product
pvw data-product create --qualified-name="product.test.1" --name="Test Product" --description="A test data product"
# Add classification and label
pvw data-product add-classification --qualified-name="product.test.1" --classification="PII"
pvw data-product add-label --qualified-name="product.test.1" --label="gold"
# Link glossary term
data-product link-glossary --qualified-name="product.test.1" --term="Customer"
# Set status and show lineage
data-product set-status --qualified-name="product.test.1" --status="active"
data-product show-lineage --qualified-name="product.test.1"
```
---
## Core Features
- **Discovery Query/Search**: Flexible, advanced search for all catalog assets
- **Entity Management**: Bulk import/export, update, and validation
- **Glossary Management**: Import/export terms, assign terms in bulk
```bash
# List all terms in a glossary
pvw glossary list-terms --glossary-guid "your-glossary-guid"
# Create and manage glossary terms
pvw glossary create-term --payload-file term.json
```
- **Lineage Operations**: Lineage discovery, CSV-based bulk lineage
- **Monitoring & Analytics**: Real-time dashboards, metrics, and reporting
- **Plugin System**: Extensible with custom plugins
---
## API Coverage and Upcoming Features
PVW CLI aims to provide comprehensive automation for all major Microsoft Purview APIs. However, some features—such as governance domain CRUD operations—are not yet available via the public REST API as of June 2025.
- For the latest API documentation and updates, see:
- [Microsoft Purview REST API reference](https://learn.microsoft.com/en-us/rest/api/purview/)
- [Atlas 2.2 API documentation](https://learn.microsoft.com/en-us/purview/data-gov-api-atlas-2-2)
### API Version Support
- Data Map: **2024-03-01-preview** (default) or **2023-09-01** (stable)
- Collections: **2019-11-01-preview**
- Account: **2019-11-01-preview**
- Management: **2021-07-01**
- Scan: **2018-12-01-preview**
**Note:**
- Domain management (create, update, delete) is not currently supported by the public API. The CLI will add support for these features as soon as Microsoft releases the necessary endpoints.
- Please monitor the above links and [Azure Updates](https://azure.microsoft.com/updates/) for new API releases.
If you need a feature that is not yet implemented due to API limitations, please open an issue or check for updates in future releases.
---
## Contributing & Support
- [Documentation](https://github.com/Keayoub/Purview_cli/blob/main/doc/README.md)
- [Issue Tracker](https://github.com/Keayoub/Purview_cli/issues)
- [Email Support](mailto:keayoub@msn.com)
---
**PVW CLI empowers data engineers, stewards, and architects to automate, scale, and enhance their Microsoft Purview experience with powerful command-line and programmatic capabilities.**
Raw data
{
"_id": null,
"home_page": "https://github.com/Keayoub/Purview_cli",
"name": "pvw-cli",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "AYOUB KEBAILI <keayoub@msn.com>",
"keywords": "azure, purview, cli, data, catalog, governance, automation, pvw",
"author": "Ayoub KEBAILI",
"author_email": "AYOUB KEBAILI <keayoub@msn.com>",
"download_url": "https://files.pythonhosted.org/packages/8b/8b/af7548a69d37cd6150efa72931ae7974da2b8c36f61bc9a378d80de56dbd/pvw-cli-1.0.6.tar.gz",
"platform": null,
"description": "# PURVIEW CLI v1.0.0 - Microsoft Purview Automation & Data Governance\n\n> **LATEST UPDATE (June 2025):**\n> - Major: Advanced Data Product Management (see new `data-product` command group)\n> - Enhanced Discovery Query/Search support (see below for usage).\n\n---\n\n## What is PVW CLI?\n\n**PVW CLI v1.0.0** 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:\n\n- Entity management (create, update, bulk, import/export)\n- Glossary and term management\n- Lineage operations\n- Collection and account management\n- Advanced search and discovery\n- Data product management (new, see below)\n- Classification, label, and status management\n- And more (see command reference)\n\nThe CLI is designed for data engineers, stewards, architects, and platform teams to automate, scale, and enhance their Microsoft Purview experience.\n\n---\n\n## Quick Start (pip install)\n\nGet started with PVW CLI in minutes:\n\n1. **Install the CLI**\n\n ```bash\n pip install pvw-cli\n ```\n\n2. **Set Environment Variables**\n\n ```bash\n set PURVIEW_ACCOUNT_NAME=your-purview-account\n set AZURE_REGION= # (optional, e.g. 'china', 'usgov')\n ```\n\n3. **Authenticate**\n\n - Run `az login` (recommended)\n - Or set Service Principal credentials as environment variables\n\n4. **Run Your First Search**\n\n ```bash\n pvw search query --keywords=\"customer\" --limit=5\n ```\n\n5. **See All Commands**\n\n ```bash\n pvw --help\n ```\n\nFor more advanced usage, see the sections below or visit the [documentation](https://pvw-cli.readthedocs.io/).\n\n---\n\n## Overview\n\n**PVW CLI v1.0.0** is a modern command-line interface and Python library for Microsoft Purview, enabling:\n\n- Advanced data catalog search and discovery\n- Bulk import/export of entities, glossary terms, and lineage\n- Real-time monitoring and analytics\n- Automated governance and compliance\n- Extensible plugin system\n\n---\n\n## Installation\n\nYou can install PVW CLI in two ways:\n\n1. **From PyPI (recommended for most users):**\n\n ```bash\n pip install pvw-cli\n ```\n\n2. **Directly from the GitHub repository (for latest/dev version):**\n\n ```bash\n pip install git+https://github.com/Keayoub/Purview_cli.git\n ```\n\nOr for development (editable install):\n\n```bash\ngit clone https://github.com/Keayoub/Purview_cli.git\ncd Purview_cli\npip install -r requirements.txt\npip install -e .\n```\n\n---\n\n## Requirements\n\n- Python 3.8+\n- Azure CLI (`az login`) or Service Principal credentials\n- Microsoft Purview account\n\n---\n\n## Getting Started\n\n1. **Install**\n\n ```bash\n pip install pvw-cli\n ```\n\n2. **Set Environment Variables**\n\n ```bash\n set PURVIEW_ACCOUNT_NAME=your-purview-account\n set AZURE_REGION= # (optional, e.g. 'china', 'usgov')\n ```\n\n3. **Authenticate**\n\n - Azure CLI: `az login`\n\n - Or set Service Principal credentials as environment variables\n\n4. **Run a Command**\n\n ```bash\n pvw search query --keywords=\"customer\" --limit=5\n ```\n\n5. **See All Commands**\n\n ```bash\n pvw --help\n ```\n\n---\n\n## Authentication\n\nPVW 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.\n\n### 1. Azure CLI Authentication (Recommended for Interactive Use)\n\n- Run `az login` to authenticate interactively with your Azure account.\n- The CLI will automatically use your Azure CLI credentials.\n\n### 2. Service Principal Authentication (Recommended for Automation/CI/CD)\n\nSet the following environment variables before running any PVW CLI command:\n\n- `AZURE_CLIENT_ID` (your Azure AD app registration/client ID)\n- `AZURE_TENANT_ID` (your Azure AD tenant ID)\n- `AZURE_CLIENT_SECRET` (your client secret)\n\n**Example (Windows):**\n\n```cmd\nset AZURE_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\nset AZURE_TENANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\nset AZURE_CLIENT_SECRET=your-client-secret\n```\n\n**Example (Linux/macOS):**\n\n```bash\nexport AZURE_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\nexport AZURE_TENANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\nexport AZURE_CLIENT_SECRET=your-client-secret\n```\n\n### 3. Managed Identity (for Azure VMs, App Services, etc.)\n\nIf running in Azure with a managed identity, no extra configuration is needed. The CLI will use the managed identity automatically.\n\n### 4. Visual Studio/VS Code Authentication\n\nIf you are signed in to Azure in Visual Studio or VS Code, `DefaultAzureCredential` can use those credentials as a fallback.\n\n---\n\n**Note:**\n- The CLI will try all supported authentication methods in order. The first one that works will be used.\n- For most automation and CI/CD scenarios, service principal authentication is recommended.\n- For local development, Azure CLI authentication is easiest.\n\nFor more details, see the [Azure Identity documentation](https://learn.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python).\n\n---\n\n## Search Command (Discovery Query API)\n\nThe PVW CLI provides advanced search using the latest Microsoft Purview Discovery Query API:\n\n- Search for assets, tables, files, and more with flexible filters\n- Use autocomplete and suggestion endpoints\n- Perform faceted, time-based, and entity-type-specific queries\n\n### CLI Usage Examples\n\n```bash\n# Basic search for assets with keyword 'customer'\npvw search query --keywords=\"customer\" --limit=5\n\n# Advanced search with classification filter\npvw search query --keywords=\"sales\" --classification=\"PII\" --objectType=\"Tables\" --limit=10\n\n# Autocomplete suggestions for partial keyword\npvw search autocomplete --keywords=\"ord\" --limit=3\n\n# Get search suggestions (fuzzy matching)\npvw search suggest --keywords=\"prod\" --limit=2\n\n# Faceted search with aggregation\npvw search query --keywords=\"finance\" --facetFields=\"objectType,classification\" --limit=5\n\n# Browse entities by type and path\npvw search browse --entityType=\"Tables\" --path=\"/root/finance\" --limit=2\n\n# Time-based search for assets created after a date\npvw search query --keywords=\"audit\" --createdAfter=\"2024-01-01\" --limit=1\n\n# Entity type specific search\npvw search query --entityTypes=\"Files,Tables\" --limit=2\n```\n\n### Python Usage Example\n\n```python\nfrom purviewcli.client._search import Search\n\nsearch = Search()\nargs = {\"--keywords\": \"customer\", \"--limit\": 5}\nsearch.searchQuery(args)\nprint(search.payload) # Shows the constructed search payload\n```\n\n### Test Examples\n\nSee `tests/test_search_examples.py` for ready-to-run pytest examples covering all search scenarios:\n\n- Basic query\n- Advanced filter\n- Autocomplete\n- Suggest\n- Faceted search\n- Browse\n- Time-based search\n- Entity type search\n\n---\n\n## Data Product Management (Advanced)\n\nPVW CLI now includes a powerful `data-product` command group for advanced data product lifecycle management. This is in addition to the CLI's support for all core Purview APIs.\n\nSee [`doc/commands/data-product.md`](doc/commands/data-product.md) for full documentation and examples.\n\n### Example Commands\n\n```bash\n# Create a data product\npvw data-product create --qualified-name=\"product.test.1\" --name=\"Test Product\" --description=\"A test data product\"\n\n# Add classification and label\npvw data-product add-classification --qualified-name=\"product.test.1\" --classification=\"PII\"\npvw data-product add-label --qualified-name=\"product.test.1\" --label=\"gold\"\n\n# Link glossary term\ndata-product link-glossary --qualified-name=\"product.test.1\" --term=\"Customer\"\n\n# Set status and show lineage\ndata-product set-status --qualified-name=\"product.test.1\" --status=\"active\"\ndata-product show-lineage --qualified-name=\"product.test.1\"\n```\n\n---\n\n## Core Features\n\n- **Discovery Query/Search**: Flexible, advanced search for all catalog assets\n- **Entity Management**: Bulk import/export, update, and validation\n- **Glossary Management**: Import/export terms, assign terms in bulk\n ```bash\n # List all terms in a glossary\n pvw glossary list-terms --glossary-guid \"your-glossary-guid\"\n \n # Create and manage glossary terms\n pvw glossary create-term --payload-file term.json\n ```\n- **Lineage Operations**: Lineage discovery, CSV-based bulk lineage\n- **Monitoring & Analytics**: Real-time dashboards, metrics, and reporting\n- **Plugin System**: Extensible with custom plugins\n\n---\n\n## API Coverage and Upcoming Features\n\nPVW CLI aims to provide comprehensive automation for all major Microsoft Purview APIs. However, some features\u2014such as governance domain CRUD operations\u2014are not yet available via the public REST API as of June 2025.\n\n- For the latest API documentation and updates, see:\n - [Microsoft Purview REST API reference](https://learn.microsoft.com/en-us/rest/api/purview/)\n - [Atlas 2.2 API documentation](https://learn.microsoft.com/en-us/purview/data-gov-api-atlas-2-2)\n\n### API Version Support\n\n- Data Map: **2024-03-01-preview** (default) or **2023-09-01** (stable)\n- Collections: **2019-11-01-preview**\n- Account: **2019-11-01-preview**\n- Management: **2021-07-01**\n- Scan: **2018-12-01-preview**\n\n**Note:**\n- Domain management (create, update, delete) is not currently supported by the public API. The CLI will add support for these features as soon as Microsoft releases the necessary endpoints.\n- Please monitor the above links and [Azure Updates](https://azure.microsoft.com/updates/) for new API releases.\n\nIf you need a feature that is not yet implemented due to API limitations, please open an issue or check for updates in future releases.\n\n---\n\n## Contributing & Support\n\n- [Documentation](https://github.com/Keayoub/Purview_cli/blob/main/doc/README.md)\n- [Issue Tracker](https://github.com/Keayoub/Purview_cli/issues)\n- [Email Support](mailto:keayoub@msn.com)\n\n---\n\n**PVW CLI empowers data engineers, stewards, and architects to automate, scale, and enhance their Microsoft Purview experience with powerful command-line and programmatic capabilities.**\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Microsoft Purview CLI with comprehensive automation capabilities",
"version": "1.0.6",
"project_urls": {
"Bug Tracker": "https://github.com/your-org/pvw-cli/issues",
"Changelog": "https://github.com/your-org/pvw-cli/blob/main/CHANGELOG.md",
"Documentation": "https://pvw-cli.readthedocs.io/",
"Homepage": "https://github.com/your-org/pvw-cli",
"Repository": "https://github.com/your-org/pvw-cli.git"
},
"split_keywords": [
"azure",
" purview",
" cli",
" data",
" catalog",
" governance",
" automation",
" pvw"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "acb02fdf06fecf21815385034a425ce9af35fbe857a33898f61263dbe9bdeb57",
"md5": "fea3b82852070b90274e98416751215e",
"sha256": "3fd60549a0353b0e2f2508406912d950d2ed71bd36de35d0303305217b10405a"
},
"downloads": -1,
"filename": "pvw_cli-1.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fea3b82852070b90274e98416751215e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 132927,
"upload_time": "2025-07-10T20:28:08",
"upload_time_iso_8601": "2025-07-10T20:28:08.271569Z",
"url": "https://files.pythonhosted.org/packages/ac/b0/2fdf06fecf21815385034a425ce9af35fbe857a33898f61263dbe9bdeb57/pvw_cli-1.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "8b8baf7548a69d37cd6150efa72931ae7974da2b8c36f61bc9a378d80de56dbd",
"md5": "979293e2e8894192cfa3dde0b71de555",
"sha256": "43aba256e2daafaab2a11b0feae0b0ff1e19b650061733d20895445859a61646"
},
"downloads": -1,
"filename": "pvw-cli-1.0.6.tar.gz",
"has_sig": false,
"md5_digest": "979293e2e8894192cfa3dde0b71de555",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 114018,
"upload_time": "2025-07-10T20:28:09",
"upload_time_iso_8601": "2025-07-10T20:28:09.639342Z",
"url": "https://files.pythonhosted.org/packages/8b/8b/af7548a69d37cd6150efa72931ae7974da2b8c36f61bc9a378d80de56dbd/pvw-cli-1.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-10 20:28:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Keayoub",
"github_project": "Purview_cli",
"github_not_found": true,
"lcname": "pvw-cli"
}