This skill provides guidance on building Python applications that use Microsoft Dataverse as a database. Use when users ask about "Python Dataverse app", "Flask Dataverse", "FastAPI Dataverse", "Dataverse backend", "Python API with Dataverse", "Dataverse data pipeline", or need help building Python applications with Dataverse.
Provides guidance for building Python applications that use Microsoft Dataverse as a database.
/plugin marketplace add Sahib-Sawhney-WH/dapr-claude-plugin/plugin install sahib-sawhney-wh-dataverse-plugins-dataverse@Sahib-Sawhney-WH/dapr-claude-pluginThis skill inherits all available tools. When active, it can use any tool Claude has access to.
This skill provides guidance on building Python applications that use Microsoft Dataverse as a database. Use when users ask about "Python Dataverse app", "Flask Dataverse", "FastAPI Dataverse", "Dataverse backend", "Python API with Dataverse", "Dataverse data pipeline", or need help building Python applications with Dataverse.
my-dataverse-app/
├── app/
│ ├── __init__.py
│ ├── dataverse_client.py # Dataverse connection
│ ├── models.py # Data models
│ ├── services.py # Business logic
│ └── api/
│ └── routes.py # API endpoints
├── config.py
├── requirements.txt
└── main.py
# dataverse_client.py
from PowerPlatform.Dataverse.client import DataverseClient
from azure.identity import ClientSecretCredential
import os
_client = None
def get_client() -> DataverseClient:
global _client
if _client is None:
credential = ClientSecretCredential(
tenant_id=os.environ["AZURE_TENANT_ID"],
client_id=os.environ["AZURE_CLIENT_ID"],
client_secret=os.environ["AZURE_CLIENT_SECRET"]
)
_client = DataverseClient(
os.environ["DATAVERSE_URL"],
credential
)
return _client
from flask import Flask, jsonify, request
from dataverse_client import get_client
app = Flask(__name__)
@app.route('/accounts', methods=['GET'])
def list_accounts():
client = get_client()
pages = client.get(
"account",
select=["accountid", "name"],
filter="statecode eq 0",
top=100
)
accounts = []
for page in pages:
accounts.extend(page)
return jsonify(accounts)
@app.route('/accounts', methods=['POST'])
def create_account():
data = request.json
client = get_client()
ids = client.create("account", data)
return jsonify({"id": ids[0]}), 201
@app.route('/accounts/<account_id>', methods=['GET'])
def get_account(account_id):
client = get_client()
account = client.get("account", account_id)
return jsonify(account)
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from typing import Optional, List
from dataverse_client import get_client
app = FastAPI()
class AccountCreate(BaseModel):
name: str
telephone1: Optional[str] = None
class Account(BaseModel):
accountid: str
name: str
telephone1: Optional[str]
@app.get("/accounts", response_model=List[Account])
async def list_accounts(top: int = 100):
client = get_client()
pages = client.get("account", select=["accountid", "name", "telephone1"], top=top)
accounts = []
for page in pages:
accounts.extend(page)
return accounts
@app.post("/accounts", response_model=dict)
async def create_account(account: AccountCreate):
client = get_client()
ids = client.create("account", account.model_dump(exclude_none=True))
return {"id": ids[0]}
@app.get("/accounts/{account_id}", response_model=Account)
async def get_account(account_id: str):
client = get_client()
try:
account = client.get("account", account_id)
return account
except Exception:
raise HTTPException(status_code=404, detail="Account not found")
# ETL pipeline with Dataverse
from dataverse_client import get_client
import pandas as pd
def extract_accounts():
"""Extract accounts from Dataverse."""
client = get_client()
pages = client.get(
"account",
select=["accountid", "name", "revenue", "industrycode"],
filter="statecode eq 0"
)
records = []
for page in pages:
records.extend(page)
return pd.DataFrame(records)
def transform_data(df: pd.DataFrame) -> pd.DataFrame:
"""Transform the data."""
df['revenue_millions'] = df['revenue'] / 1_000_000
df['has_revenue'] = df['revenue'] > 0
return df
def load_to_dataverse(df: pd.DataFrame, table: str):
"""Load data back to Dataverse."""
client = get_client()
records = df.to_dict('records')
ids = client.create(table, records)
return ids
# Pipeline execution
def run_pipeline():
df = extract_accounts()
df = transform_data(df)
# Save transformed data somewhere
df.to_csv('accounts_processed.csv', index=False)
references/flask-patterns.md for Flask examplesreferences/fastapi-patterns.md for FastAPI examplesreferences/pipeline-patterns.md for data pipeline patternsThis skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.