
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
azure-purview-catalog
Advanced tools
Azure Purview Catalog is a fully managed cloud service whose users can discover the data sources they need and understand the data sources they find. At the same time, Data Catalog helps organizations get more value from their existing investments.
Please rely heavily on the service's documentation and our client docs to use this library
Source code | Package (PyPI) | API reference documentation| Product documentation
Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691
Follow these instructions to create your Purview resource
Install the Azure Purview Catalog client library for Python with pip:
pip install azure-purview-catalog
To use an Azure Active Directory (AAD) token credential, provide an instance of the desired credential type obtained from the azure-identity library.
To authenticate with AAD, you must first pip install azure-identity
and
enable AAD authentication on your Purview resource
After setup, you can choose which type of credential from azure.identity to use. As an example, DefaultAzureCredential can be used to authenticate the client:
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET
Use the returned token credential to authenticate the client:
from azure.purview.catalog import PurviewCatalogClient
from azure.identity import DefaultAzureCredential
credential = DefaultAzureCredential()
client = PurviewCatalogClient(endpoint="https://<my-account-name>.purview.azure.com", credential=credential)
This package offers request builders so you can build http requests and send these requests to the service using the send_request
method.
For more information on how to use request builders and our clients, see here.
The following section shows you how to initialize and authenticate your client, then get all of your type-defs.
from azure.purview.catalog import PurviewCatalogClient
from azure.identity import DefaultAzureCredential
from azure.core.exceptions import HttpResponseError
credential = DefaultAzureCredential()
client = PurviewCatalogClient(endpoint="https://<my-account-name>.purview.azure.com", credential=credential)
try:
response = client.types.get_all_type_definitions()
# print out all of your entity definitions
print(response['entityDefs'])
except HttpResponseError as e:
print(e)
The Purview Catalog client will raise exceptions defined in Azure Core if you call .raise_for_status()
on your responses.
This library uses the standard logging library for logging. Basic information about HTTP sessions (URLs, headers, etc.) is logged at INFO level.
Detailed DEBUG level logging, including request/response bodies and unredacted
headers, can be enabled on a client with the logging_enable
keyword argument:
import sys
import logging
from azure.identity import DefaultAzureCredential
from azure.purview.catalog import PurviewCatalogClient
# Create a logger for the 'azure' SDK
logger = logging.getLogger('azure')
logger.setLevel(logging.DEBUG)
# Configure a console output
handler = logging.StreamHandler(stream=sys.stdout)
logger.addHandler(handler)
endpoint = "https://<my-account-name>.purview.azure.com"
credential = DefaultAzureCredential()
# This client will log detailed information about its HTTP sessions, at DEBUG level
client = PurviewCatalogClient(endpoint=endpoint, credential=credential, logging_enable=True)
Similarly, logging_enable
can enable detailed logging for a single send_request
call,
even when it isn't enabled for the client:
result = client.types.get_all_type_definitions(logging_enable=True)
For more generic samples, see our client docs.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Features
Bugs Fixed
includeTermHierarchy
for update term APIexcludeRelationshipTypes
for get term APIBugs Fixed
delete_by_guids
to get rid of bad request error #22487Features
Breaking changes
README.md
)http_request
to request
FAQs
Microsoft Azure Azure Purview Catalog Client Library for Python
We found that azure-purview-catalog demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.