Skip to content

Commit 3504b8a

Browse files
author
Max Wang
committed
Merge branch 'main' of https://github.com/microsoft/PowerPlatform-DataverseClient-Python into users/zhaodongwang/deleteUpdate
2 parents cd87933 + cb1d79e commit 3504b8a

46 files changed

Lines changed: 2409 additions & 1203 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: |
2929
python -m pip install --upgrade pip
3030
python -m pip install flake8 black build
31-
if [ -f dev_dependencies.txt ]; then pip install -r dev_dependencies.txt; fi
31+
python -m pip install -e .[dev]
3232
3333
- name: Check format with black
3434
continue-on-error: true # TODO: fix detected formatting errors and remove this line.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ htmlcov/
2121
.idea/
2222
Thumbs.db
2323
.DS_Store
24+
*.tm7

CHANGELOG.md

Lines changed: 34 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,42 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7-
8-
## [Unreleased]
5+
## [0.1.0b1] - 2025-11-14
96

107
### Added
11-
- Initial SDK implementation with CRUD operations
12-
- Service principal authentication support
13-
- Interactive browser authentication support
14-
- SQL query execution via `query_sql()`
15-
- File upload capabilities
16-
- Pandas integration for query results
17-
- Structured error handling with specific exception types
18-
- GitHub Actions CI pipeline for automated testing
8+
**Initial beta release** of Microsoft Dataverse SDK for Python
9+
10+
**Core Client & Authentication:**
11+
- Core `DataverseClient` with Azure Identity authentication support
12+
- Secure authentication using Azure Identity credentials (Service Principal, Managed Identity, Interactive Browser)
13+
- TLS 1.2+ encryption for all API communications
14+
- Proper credential handling without exposing secrets in logs
15+
16+
**Data Operations:**
17+
- Complete CRUD operations (create, read, update, delete) for Dataverse records
18+
- Advanced OData query support with filtering, sorting, and expansion
19+
- SQL query execution via `query_sql()` method with result pagination
20+
- Support for batch operations and transaction handling
21+
- File upload capabilities for file and image columns
22+
23+
**Table Management:**
24+
- Table metadata operations (create, inspect, delete custom tables)
25+
26+
**Integration & Analysis:**
27+
- Pandas DataFrame integration for seamless data analysis workflows
28+
29+
**Reliability & Error Handling:**
30+
- Comprehensive error handling with specific exception types (`DataverseError`, `AuthenticationError`, etc.)
31+
- HTTP retry logic with exponential backoff for resilient operations
32+
33+
**Developer Experience:**
34+
- Example scripts demonstrating common integration patterns
35+
- Complete documentation with quickstart guides and API reference
36+
- Modern Python packaging using `pyproject.toml` configuration
37+
38+
**Quality Assurance:**
39+
- Comprehensive test suite with unit and integration tests
40+
- GitHub Actions CI/CD pipeline for automated testing and validation
1941
- Azure DevOps PR validation pipeline
2042

2143
### Changed
@@ -32,42 +54,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3254

3355
### Security
3456
- N/A
35-
36-
## [0.1.0] - TBD
37-
38-
### Added
39-
- First alpha release
40-
- Core Dataverse client with authentication
41-
- Basic CRUD operations (create, get, update, delete)
42-
- OData query support
43-
- SQL query support
44-
- Error handling framework
45-
- Example scripts for common scenarios
46-
47-
---
48-
49-
## Release Notes Template
50-
51-
When creating a new release, copy this template:
52-
53-
```markdown
54-
## [X.Y.Z] - YYYY-MM-DD
55-
56-
### Added
57-
- New features
58-
59-
### Changed
60-
- Changes in existing functionality
61-
62-
### Deprecated
63-
- Soon-to-be removed features
64-
65-
### Removed
66-
- Removed features
67-
68-
### Fixed
69-
- Bug fixes
70-
71-
### Security
72-
- Security improvements or fixes
73-
```

CODEOWNERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# CODEOWNERS for Dataverse Client Python SDK
2+
# This file defines who gets automatically requested for review when PRs are opened.
3+
# See: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
4+
5+
# Global ownership - fallback for any files not covered by more specific rules
6+
* @microsoft/powerplatform-dataverseclient-python-maintainers
7+
# Team is found here:
8+
# https://github.com/orgs/microsoft/teams/powerplatform-dataverseclient-python-maintainers

README.md

Lines changed: 275 additions & 297 deletions
Large diffs are not rendered by default.

SUPPORT.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
# TODO: The maintainer of this repo has not yet edited this file
1+
# Support
22

3-
**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project?
3+
## How to file issues and get help
44

5-
- **No CSS support:** Fill out this template with information about how to file issues and get help.
6-
- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps.
7-
- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide.
5+
This project uses GitHub Issues to track bugs and feature requests. Please search the existing
6+
issues before filing new issues to avoid duplicates. For new issues, file your bug or
7+
feature request as a new Issue.
88

9-
*Then remove this first heading from this SUPPORT.MD file before publishing your repo.*
9+
### Getting Help
1010

11-
# Support
11+
For help and questions about using the Microsoft Dataverse SDK for Python:
1212

13-
## How to file issues and get help
13+
- **Documentation**: Check the [README](README.md) for quickstart guides and examples
14+
- **GitHub Issues**: [File an issue](https://github.com/microsoft/PowerPlatform-DataverseClient-Python/issues) for bugs or feature requests
1415

15-
This project uses GitHub Issues to track bugs and feature requests. Please search the existing
16-
issues before filing new issues to avoid duplicates. For new issues, file your bug or
17-
feature request as a new Issue.
16+
### Reporting Security Issues
17+
18+
Security issues should be reported privately via the [Microsoft Security Response Center (MSRC)](https://aka.ms/opensource/security/msrc) or by emailing [secure@microsoft.com](mailto:secure@microsoft.com). Please do not report security vulnerabilities through public GitHub issues.
19+
20+
## Microsoft Support Policy
1821

19-
For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE
20-
FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER
21-
CHANNEL. WHERE WILL YOU HELP PEOPLE?**.
22+
This is a community-supported project. Support for the Microsoft Dataverse SDK for Python is provided on a best-effort basis through:
2223

23-
## Microsoft Support Policy
24+
- Community contributions via GitHub Issues and Pull Requests
25+
- Documentation and examples in this repository
2426

25-
Support for this **PROJECT or PRODUCT** is limited to the resources listed above.
27+
This project is not covered by Microsoft's standard product support services. For issues with Microsoft Dataverse itself (not this SDK), please use the official Microsoft support channels.

dev_dependencies.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

examples/README.md

Lines changed: 76 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,98 @@
1-
# Dataverse SDK Examples
1+
# PowerPlatform Dataverse Client Examples
22

3-
This directory contains comprehensive examples demonstrating how to use the Microsoft Dataverse SDK for Python.
3+
This directory contains comprehensive examples demonstrating how to use the **PowerPlatform-Dataverse-Client** SDK for Python. The examples are organized in a progressive learning path: **Install → Learn → Test**.
4+
5+
## 📦 Installation
6+
7+
Install the PowerPlatform Dataverse Client SDK:
8+
9+
```bash
10+
pip install PowerPlatform-Dataverse-Client
11+
```
412

513
## 📁 Directory Structure
614

715
### 🌱 Basic Examples (`basic/`)
8-
Get started quickly with fundamental Dataverse operations:
9-
- **`quickstart.py`** - Basic client setup, authentication, and simple CRUD operations
10-
- Authentication setup with Azure Identity
11-
- Creating, reading, updating, and deleting records
12-
- Basic error handling
13-
14-
### 🚀 Advanced Examples (`advanced/`)
15-
Explore powerful features for complex scenarios:
16-
- **`file_upload.py`** - File upload to Dataverse file columns with chunking
17-
- **`pandas_integration.py`** - DataFrame-based operations for data analysis
16+
Start here for getting up and running with the SDK:
17+
18+
- **`installation_example.py`** - **START HERE** 🎯
19+
- Package installation validation and import verification
20+
- Method availability checking and troubleshooting
21+
- Basic usage examples and code patterns
22+
- Optional interactive testing with real environment
23+
- Perfect for first-run validation after installation
24+
25+
- **`functional_testing.py`** - **TEST BASIC FUNCTIONALITY** 🧪
26+
- Simple functional testing in real Dataverse environments
27+
- Basic CRUD operations validation with clean patterns
28+
- Table creation and basic querying tests
29+
- Interactive cleanup and straightforward validation
30+
- Perfect for verifying SDK works in your environment
31+
32+
### 🔬 Advanced Examples (`advanced/`)
33+
Deep-dive into production-ready patterns and specialized functionality:
34+
35+
- **`complete_walkthrough.py`** - **COMPREHENSIVE DEMO** 🚀
36+
- Full SDK feature demonstration with production-ready patterns
37+
- Table creation with custom schemas and enums
38+
- Single and bulk CRUD operations with error handling
39+
- Advanced querying (SQL and OData) with paging
40+
- Column metadata management and multi-language support
41+
- Interactive cleanup and best practices
42+
43+
- **`file_upload.py`** - **FILE OPERATIONS** 📎
44+
- File upload to Dataverse file columns with chunking
45+
- Advanced file handling patterns
46+
47+
- **`pandas_integration.py`** - **DATA ANALYSIS** 📊
48+
- DataFrame-based operations for data analysis
49+
- Pandas integration patterns
1850

1951
## 🚀 Getting Started
2052

21-
1. **Install Dependencies**:
22-
```bash
23-
pip install -r requirements.txt
24-
```
53+
Follow this recommended progression for the best learning experience:
54+
55+
### 📋 Step 1: Validate Installation
56+
```bash
57+
# Install the SDK and dependencies
58+
pip install PowerPlatform-Dataverse-Client azure-identity
59+
60+
# Validate installation and imports
61+
python examples/basic/installation_example.py
62+
```
63+
64+
### 🧪 Step 2: Test Basic Functionality (Optional)
65+
```bash
66+
# Basic functional testing in your environment
67+
python examples/basic/functional_testing.py
68+
```
69+
70+
### 🚀 Step 3: Master Advanced Features
71+
```bash
72+
# Comprehensive walkthrough with production patterns
73+
python examples/advanced/complete_walkthrough.py
74+
```
2575

26-
2. **Set Up Authentication**:
27-
Configure Azure Identity credentials (see individual examples for details)
76+
## 🎯 Quick Start Recommendations
2877

29-
3. **Run Basic Example**:
30-
```bash
31-
python examples/basic/quickstart.py
32-
```
78+
- **New to the SDK?** → Start with `examples/basic/installation_example.py`
79+
- **Need to test/validate?** → Use `examples/basic/functional_testing.py`
80+
- **Want to see all features?** → Run `examples/advanced/complete_walkthrough.py`
81+
- **Building production apps?** → Study patterns in `examples/advanced/complete_walkthrough.py`
3382

3483
## 📋 Prerequisites
3584

36-
- Python 3.8+
85+
- Python 3.10+
86+
- PowerPlatform-Dataverse-Client SDK installed (`pip install PowerPlatform-Dataverse-Client`)
3787
- Azure Identity credentials configured
3888
- Access to a Dataverse environment
39-
- Required packages installed from `requirements.txt`
4089

4190
## 🔒 Authentication
4291

4392
All examples use Azure Identity for authentication. Common patterns:
44-
- `DefaultAzureCredential` for development
45-
- `ClientSecretCredential` for production services
46-
- `InteractiveBrowserCredential` for interactive scenarios
93+
- `InteractiveBrowserCredential` for development and interactive scenarios
94+
- `DeviceCodeCredential` for development on headless systems
95+
- `ClientSecretCredential` for production services with service principals
4796

4897
## 📖 Documentation
4998

0 commit comments

Comments
 (0)