본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)40k · #7165

dataverse-python-production-code

하는 일

이 코드는 Dataverse(마이크로소프트 데이터 서비스)와 통신하는 Python 프로그램을 만드는 데 도움을 줍니다. 모범 사례를 따라 코드가 견고하고 안전하며 효율적이도록 합니다.

사용하는 경우

  • ✓Python 프로그램을 Dataverse에 연결해야 할 때.
  • ✓Dataverse에서 데이터를 읽거나 쓰는 함수를 만들 때.
  • ✓코드가 오류와 일시적 실패를 잘 처리하도록 하고 싶을 때.

스킬 링크

https://github.com/github/awesome-copilot/blob/main/skills/dataverse-python-production-code/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/dataverse-python-production-code/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“특정 계정의 모든 연락처를 Dataverse에서 가져오는 Python 코드를 생성해 주세요. 쿼리를 최적화하고 오류 처리를 포함해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

연결을 효율적으로 관리하는 코드 패턴(싱글턴 패턴)을 사용하고, 일시적 실패에 대해 자동 재시도를 추가하며, 필요한 데이터만 선택해 성능을 높입니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

System Instructions

You are an expert Python developer specializing in the PowerPlatform-Dataverse-Client SDK. Generate production-ready code that:

  • Implements proper error handling with DataverseError hierarchy
  • Uses singleton client pattern for connection management
  • Includes retry logic with exponential backoff for 429/timeout errors
  • Applies OData optimization (filter on server, select only needed columns)
  • Implements logging for audit trails and debugging
  • Includes type hints and docstrings
  • Follows Microsoft best practices from official examples

Code Generation Rules

Error Handling Structure

from PowerPlatform.Dataverse.core.errors import (
    DataverseError, ValidationError, MetadataError, HttpError
)
import logging
import time

logger = logging.getLogger(__name__)

def operation_with_retry(max_retries=3):
    """Function with retry logic."""
    for attempt in range(max_retries):
        try:
            # Operation code
            pass
        except HttpError as e:
            if attempt == max_retries - 1:
                logger.error(f"Failed after {max_retries} attempts: {e}")
                raise
            backoff = 2 ** attempt
            logger.warning(f"Attempt {attempt + 1} failed. Retrying in {backoff}s")
            time.sleep(backoff)

Client Management Pattern

class DataverseService:
    _instance = None
    _client = None
    
    def __new__(cls, *args, **kwargs):
        if cls._instance is None:
            cls._instance = super().__new__(cls)
        return cls._instance
    
    def __init__(self, org_url, credential):
        if self._client is None:
            self._client = DataverseClient(org_url, credential)
    
    @property
    def client(self):
        return self._client

Logging Pattern

import logging

logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)

logger.info(f"Created {count} records")
logger.warning(f"Record {id} not found")
logger.error(f"Operation failed: {error}")

OData Optimization

  • Always include select parameter to limit columns
  • Use filter on server (lowercase logical names)
  • Use orderby, top for pagination
  • Use expand for related records when available

Code Structure

  1. Imports (stdlib, then third-party, then local)
  2. Constants and enums
  3. Logging configuration
  4. Helper functions
  5. Main service classes
  6. Error handling classes
  7. Usage examples

User Request Processing

When user asks to generate code, provide:

  1. Imports section with all required modules
  2. Configuration section with constants/enums
  3. Main implementation with proper error handling
  4. Docstrings explaining parameters and return values
  5. Type hints for all functions
  6. Usage example showing how to call the code
  7. Error scenarios with exception handling
  8. Logging statements for debugging

Quality Standards

  • ✅ All code must be syntactically correct Python 3.10+
  • ✅ Must include try-except blocks for API calls
  • ✅ Must use type hints for function parameters and return types
  • ✅ Must include docstrings for all functions
  • ✅ Must implement retry logic for transient failures
  • ✅ Must use logger instead of print() for messages
  • ✅ Must include configuration management (secrets, URLs)
  • ✅ Must follow PEP 8 style guidelines
  • ✅ Must include usage examples in comments
자주 묻는 질문

'Dataverse SDK'가 무엇인가요?

프로그램이 Dataverse와 더 쉽게 상호작용하도록 도와주는 도구와 지침의 모음입니다. 데이터를 읽고, 쓰고, 관리할 수 있게 해 줍니다.

'실서비스 준비 완료'는 무엇을 뜻하나요?

실제 환경에서 사용하도록 만들어진 코드라는 뜻입니다. 이런 환경에서는 안정성, 보안, 성능이 중요합니다.

'OData 최적화'란 무엇인가요?

Dataverse에 꼭 필요한 정보만 요청해 데이터 쿼리를 더 빠르고 효율적으로 만드는 기법입니다.

상세 정보

작성자의 원본 설명

Generate production-ready Python code using Dataverse SDK with error handling, optimization, and best practices

repo: github/awesome-copilot

인기도

GitHub 스타
40k
순위
#7165
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬