/dataverse-sdk-for-python:dataverse-python-usecase-builderfrom dataverse-sdk-for-python
Generates production-ready Python solutions for Microsoft Dataverse SDK business use cases including table design, CRUD, batch, query, file, and scheduled patterns.
Ships in dataverse-sdk-for-python. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Transform a Dataverse business need into a production-ready Python architecture with table design, pattern selection, SDK code, performance guidance, error handling, monitoring, and tests.
PowerPlatform.Dataverse.client.DataverseClient, PowerPlatform.Dataverse.core.config.DataverseConfig, and azure.identity.ClientSecretCredential when authentication is needed.| Area | Ask or infer |
|---|---|
| Operations | Create, Read, Update, Delete, Bulk, Query, file upload, or delete. |
| Volume | Record count, file sizes, page sizes, and batch sizes. |
| Frequency | One-time, batch, real-time, scheduled, daily, weekly, monthly. |
| Performance | Response time, throughput, timeout tolerance. |
| Error tolerance | Retry strategy, idempotency, partial success handling, resume behavior. |
| Audit | Logging, history, compliance, privacy, user activity tracking. |
Use proposed schema blocks like this when the real schema is not provided:
tables = {
"account": {
"custom_fields": ["new_documentcount", "new_lastdocumentdate"]
},
"new_document": {
"primary_key": "new_documentid",
"columns": {
"new_name": "string",
"new_documenttype": "enum",
"new_parentaccount": "lookup(account)",
"new_uploadedby": "lookup(user)",
"new_uploadeddate": "datetime",
"new_documentfile": "file"
}
}
}
| Pattern | Use when | Examples |
|---|---|---|
| Transactional CRUD Operations | Single record creation/update, immediate consistency, relationships, lookups. | Order management, invoice creation. |
| Batch Processing | Bulk create/update/delete, performance priority, partial failure acceptable. | Data migration, daily sync. |
| Query & Analytics | Complex filtering, aggregation, pagination, optimized reads. | Reporting, dashboards. |
| File Management | Document upload/storage, chunked transfers, audit trail. | Contract management, media library. |
| Scheduled Jobs | Recurring operations, external synchronization, resumable cleanup. | Nightly syncs, cleanup tasks. |
| Real-time Integration | Event-driven low-latency processing with status tracking. | Order processing, approval workflows. |
import logging
from enum import IntEnum
from typing import Optional, List, Dict, Any
from datetime import datetime
from pathlib import Path
from PowerPlatform.Dataverse.client import DataverseClient
from PowerPlatform.Dataverse.core.config import DataverseConfig
from PowerPlatform.Dataverse.core.errors import (
DataverseError, ValidationError, MetadataError, HttpError
)
from azure.identity import ClientSecretCredential
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
class Status(IntEnum):
DRAFT = 1
ACTIVE = 2
ARCHIVED = 3
class DataverseService:
_instance = None
def __new__(cls):
if cls._instance is None:
cls._instance = super().__new__(cls)
cls._instance._initialize()
return cls._instance
def _initialize(self):
config = DataverseConfig()
credential = ClientSecretCredential(
tenant_id=config.tenant_id,
client_id=config.client_id,
client_secret=config.client_secret,
)
self.client = DataverseClient(config=config, credential=credential)
Include CRUD, bulk, query, file, or scheduled methods after this skeleton based on the selected pattern.
| Scenario | Pattern |
|---|---|
| High-volume create/update | Use batch operations: client.create("table", [record1, record2, record3]); avoid one network call per row. |
| Bulk load | Chunk input and track successful IDs: client.create("table", [record] * 1000). |
| Complex query | Use filter, select, orderby, and top=500; process pages instead of materializing all results. |
| Large file transfer | Use chunked upload with chunk_size=4 * 1024 * 1024 for 4 MB chunks. |
| Recovery | Store checkpoints, retry transient HttpError, and treat validation failures as data-quality records. |
for page in client.get(
"table",
filter="status eq 1",
select=["id", "name", "amount"],
orderby="name",
top=500
):
pass
client.upload_file(
table_name="table",
record_id=id,
file_column_name="new_file",
file_path=path,
chunk_size=4 * 1024 * 1024
)
| Category | Typical cases |
|---|---|
| Customer Relationship Management | Lead management, account hierarchy, contact tracking, opportunity pipeline, activity history. |
| Document Management | Storage and retrieval, version control, access control, audit trails, compliance tracking. |
| Data Integration | ETL, data synchronization, external system integration, migration, backup/restore. |
| Business Process | Order management, approval workflows, project tracking, inventory, resource allocation. |
| Reporting & Analytics | Aggregation, historical analysis, KPI tracking, dashboard data, export functionality. |
| Compliance & Audit | Change tracking, user activity logging, governance, retention policies, privacy management. |
Use these labels when structuring generated code and architecture notes: Backup/restore, CLASS, CONFIGURATION, CONSTANTS, ENUMS, ERROR, EXAMPLE, HANDLING, OPERATIONS, PATTERN, RECOVERY, SERVICE, SETUP, SINGLETON, SPECIFIC, USAGE, Upload/store, and relationships/lookups.
## Dataverse Python solution - <use case>
**Status:** complete | needs details | blocked
**Pattern:** Transactional CRUD Operations | Batch Processing | Query & Analytics | File Management | Scheduled Jobs | Real-time Integration
### Architecture overview
<2-3 sentence design summary>
### Data model
| Table | Relationship | Key columns | Notes |
| --- | --- | --- | --- |
| `<logical name>` | `<relationship>` | `<columns>` | `<constraints>` |
### Implementation code
```python
<complete Python 3.10+ code>
| Failure | Recovery |
|---|---|
<failure> | <retry, skip, compensate, or alert> |
## Quality gate
- [ ] The solution states operations, volume, frequency, performance, error tolerance, and audit assumptions.
- [ ] Proposed table and column names are labeled when not user-provided.
- [ ] Code includes all imports, type hints, logging, and Dataverse error handling.
- [ ] The selected pattern matches the use case category and volume.
- [ ] Bulk, paging, or chunking is used for high-volume records or files.
- [ ] Usage, monitoring, and testing guidance are included.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub gbb-acelerators/awesome-harness-primitives --plugin dataverse-sdk-for-python4 skills in this plugin
/dataverse-python-advanced-patternsGenerate production-ready Microsoft Dataverse SDK for Python code using advanced error handling, retries, batch operations, optimized OData queries, metadata management, timeouts, cache invalidation, file upload, and pandas workflows. Use when the user asks for production Dataverse Python patterns beyond quickstart CRUD./dataverse-python-production-codeGenerate production-ready Python 3.10+ code for the PowerPlatform-Dataverse-Client SDK with DataverseError handling, singleton client management, retry with exponential backoff for 429/timeout failures, OData optimization, audit logging, type hints, docstrings, configuration handling, and usage examples. Use when asked for Dataverse Python code, SDK examples, or system instructions./dataverse-python-quickstartGenerate concise Microsoft Dataverse SDK for Python preview setup, authentication, CRUD, bulk create/update, paging, and optional File column upload snippets using official patterns. Use when the user asks for Dataverse Python quickstart code, SDK setup, InteractiveBrowserCredential, retrieve-multiple paging, or basic CRUD examples.Other plugins' skills for the same job