Dataverse-Python-Api-Reference
Dataverse-Python-Api-Reference是一款code方向的AI技能,核心价值是# Dataverse SDK for Python — API Reference Guide ## DataverseClient Class Main client for interacting with Dataverse,可用于解决开发者在code领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。
# Dataverse SDK for Python — API Reference Guide ## DataverseClient Class Main client for interacting with Dataverse. Initialize with base URL and Azure credentials. ### Key Methods #### create(tab
mkdir -p ./skills/dataverse-python-api-reference && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/dataverse-python-api-reference/SKILL.md -o ./skills/dataverse-python-api-reference/SKILL.md Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).
Skill Content
# Dataverse SDK for Python — API Reference Guide
DataverseClient Class
Main client for interacting with Dataverse. Initialize with base URL and Azure credentials.
Key Methods
#### create(table_schema_name, records)
Create single or bulk records. Returns list of GUIDs.
# Single record
ids = client.create("account", {"name": "Acme"})
print(ids[0]) # First GUID
# Bulk create
ids = client.create("account", [{"name": "Contoso"}, {"name": "Fabrikam"}])#### get(table_schema_name, record_id=None, select, filter, orderby, top, expand, page_size)
Fetch single record or query multiple with OData options.
# Single record
record = client.get("account", record_id="guid-here")
# Query with filter and paging
for batch in client.get(
"account",
filter="statecode eq 0",
select=["name", "telephone1"],
orderby=["createdon desc"],
top=100,
page_size=50
):
for record in batch:
print(record["name"])#### update(table_schema_name, ids, changes)
Update single or bulk records.
# Single update
client.update("account", "guid-here", {"telephone1": "555-0100"})
# Broadcast: apply same changes to many IDs
client.update("account", [id1, id2, id3], {"statecode": 1})
# Paired: one-to-one mapping
client.update("account", [id1, id2], [{"name": "A"}, {"name": "B"}])#### delete(table_schema_name, ids, use_bulk_delete=True)
Delete single or bulk records.
# Single delete
client.delete("account", "guid-here")
# Bulk delete (async)
job_id = client.delete("account", [id1, id2, id3])#### create_table(table_schema_name, columns, solution_unique_name=None, primary_column_schema_name=None)
Create custom table.
from enum import IntEnum
class ItemStatus(IntEnum):
ACTIVE = 1
INACTIVE = 2
__labels__ = {
1033: {"ACTIVE": "Active", "INACTIVE": "Inactive"}
}
info = client.create_table("new_MyTable", {
"new_Title": "string",
"new_Quantity": "int",
"new_Price": "decimal",
"new_Active": "bool",
"new_Status": ItemStatus
})
print(info["entity_logical_name"])#### create_columns(table_schema_name, columns)
Add columns to existing table.
created = client.create_columns("new_MyTable", {
"new_Notes": "string",
"new_Count": "int"
})#### delete_columns(table_schema_name, columns)
Remove columns from table.
removed = client.delete_columns("new_MyTable", ["new_Notes", "new_Count"])#### delete_table(table_schema_name)
Delete custom table (irreversible).
client.delete_table("new_MyTable")#### get_table_info(table_schema_name)
Retrieve table metadata.
info = client.get_table_info("new_MyTable")
if info:
print(info["table_logical_name"])
print(info["entity_set_name"])#### list_tables()
List all custom tables.
tables = client.list_tables()
for table in tables:
print(table)#### flush_cache(kind)
Clear SDK caches (e.g., picklist labels).
removed = client.flush_cache("picklist")DataverseConfig Class
Configure client behavior (timeouts, retries, language).
from PowerPlatform.Dataverse.core.config import DataverseConfig
cfg = DataverseConfig()
cfg.http_retries = 3
cfg.http_backoff = 1.0
cfg.http_timeout = 30
cfg.language_code = 1033 # English
client = DataverseClient(base_url=url, credential=cred, config=cfg)Error Handling
Catch `DataverseError` for SDK-specific exceptions. Check `is_transient` to decide retry.
from PowerPlatform.Dataverse.core.errors import DataverseError
try:
client.create("account", {"name": "Test"})
except DataverseError as e:
print(f"Code: {e.code}")
print(f"Message: {e.message}")
print(f"Transient: {e.is_transient}")
print(f"Details: {e.to_dict()}")OData Filter Tips
- Use exact logical names (lowercase) in filter expressions
- Column names in `select` are auto-lowercased
- Navigation property names in `expand` are ca
🎯 Best For
- UI designers
- Product designers
- Claude users
- GitHub Copilot users
- Software engineers
💡 Use Cases
- Generating component mockups
- Creating design system tokens
- Python code quality enforcement
- Dependency management
📖 How to Use This Skill
- 1
Install the Skill
Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.
- 2
Load into Your AI Assistant
Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.
- 3
Apply Dataverse-Python-Api-Reference to Your Work
Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.
- 4
Review and Refine
Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.
❓ Frequently Asked Questions
Does this work with Figma?
Some design skills integrate with Figma plugins. Check the Works With section for supported tools.
Is Dataverse-Python-Api-Reference compatible with Cursor and VS Code?
Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.
Do I need specific dependencies for Dataverse-Python-Api-Reference?
Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.
How do I install Dataverse-Python-Api-Reference?
Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/dataverse-python-api-reference/SKILL.md, ready to use.
Can I customize this skill for my team?
Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.
⚠️ Common Mistakes to Avoid
Skipping usability testing
AI-generated designs should be validated with real users before development.
Skipping validation
Always test AI-generated code changes, even for simple refactors.
Missing dependency updates
Check if the skill requires updated dependencies or new packages.