You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
6.**Internal vs public naming** - Modules, files, and functions not meant to be part of the public API must use a `_` prefix (e.g., `_odata.py`, `_relationships.py`). Files without the prefix (e.g., `constants.py`, `metadata.py`) are public and importable by SDK consumers
22
+
7.**Async client** - The SDK ships a full async client (`AsyncDataverseClient`) under `src/PowerPlatform/Dataverse/aio/`. When adding a feature to the sync client, add it to the async client too. The async operation namespaces mirror the sync ones: `aio/operations/async_records.py`, `async_query.py`, `async_tables.py`, `async_batch.py`, `async_files.py`. Pure logic (payload builders, URL construction) goes in `data/_odata_base.py` — inherited by both `_ODataClient` and `_AsyncODataClient` — so it only needs to be written once; HTTP-calling code goes in `data/_odata.py` (sync) or `aio/data/_async_odata.py` (async). Async tests live in `tests/unit/aio/` and async examples in `examples/aio/`. The `aiohttp` dependency is an optional extra (`pip install "PowerPlatform-Dataverse-Client[async]"`) — do not move it into the required `dependencies` list in `pyproject.toml`.
Copy file name to clipboardExpand all lines: .claude/skills/dataverse-sdk-use/SKILL.md
+109Lines changed: 109 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -588,6 +588,115 @@ except ValidationError as e:
588
588
10.**Test in non-production environments** first
589
589
11.**Use named constants** - Import cascade behavior constants from `PowerPlatform.Dataverse.common.constants`
590
590
591
+
## Async Client
592
+
593
+
The SDK ships a full async client, `AsyncDataverseClient`, under `PowerPlatform.Dataverse.aio`. Requires the `[async]` extra: `pip install "PowerPlatform-Dataverse-Client[async]"`.
594
+
595
+
### Import
596
+
```python
597
+
from azure.identity.aio import DefaultAzureCredential
598
+
from PowerPlatform.Dataverse.aio import AsyncDataverseClient
Create relationships between tables using the relationship API. For a complete working example, see [examples/advanced/relationships.py](https://github.com/microsoft/PowerPlatform-DataverseClient-Python/blob/main/examples/advanced/relationships.py).
615
616
616
617
```python
617
-
from PowerPlatform.Dataverse.models.relationship import (
618
+
from PowerPlatform.Dataverse.models import (
619
+
CascadeConfiguration,
620
+
Label,
621
+
LocalizedLabel,
618
622
LookupAttributeMetadata,
619
-
OneToManyRelationshipMetadata,
620
623
ManyToManyRelationshipMetadata,
624
+
OneToManyRelationshipMetadata,
621
625
)
622
-
from PowerPlatform.Dataverse.models.labels import Label, LocalizedLabel
623
626
624
627
# Create a one-to-many relationship: Department (1) -> Employee (N)
625
628
# This adds a "Department" lookup field to the Employee table
@@ -783,6 +786,99 @@ result = batch.execute()
783
786
784
787
For a complete example see [examples/advanced/batch.py](https://github.com/microsoft/PowerPlatform-DataverseClient-Python/blob/main/examples/advanced/batch.py).
785
788
789
+
## Async client
790
+
791
+
The SDK ships a full async client, `AsyncDataverseClient`, for use in async applications. It mirrors every operation of the sync client — the same namespaces (`records`, `query`, `tables`, `files`, `batch`), the same method signatures, and the same return types.
792
+
793
+
### Install
794
+
795
+
The async client requires `aiohttp`, which is an optional extra:
See [examples/aio/](https://github.com/microsoft/PowerPlatform-DataverseClient-Python/tree/main/examples/aio) for async equivalents of all sync examples.
881
+
786
882
## Next steps
787
883
788
884
### More sample code
@@ -808,7 +904,7 @@ For comprehensive information on Microsoft Dataverse and related technologies:
808
904
| Resource | Description |
809
905
|----------|-------------|
810
906
|**[Dataverse Developer Guide](https://learn.microsoft.com/power-apps/developer/data-platform/)**| Complete developer documentation for Microsoft Dataverse |
811
-
|**[Dataverse Web API Reference](https://learn.microsoft.com/power-apps/developer/data-platform/webapi/)**| Detailed Web API reference and examples |
907
+
|**[Dataverse Web API Reference](https://learn.microsoft.com/power-apps/developer/data-platform/webapi/)**| Detailed Web API reference and examples |
812
908
|**[Azure Identity for Python](https://learn.microsoft.com/python/api/overview/azure/identity-readme)**| Authentication library documentation and credential types |
813
909
|**[Power Platform Developer Center](https://learn.microsoft.com/power-platform/developer/)**| Broader Power Platform development resources |
814
910
|**[Dataverse SDK for .NET](https://learn.microsoft.com/power-apps/developer/data-platform/org-service/overview)**| Official .NET SDK for Microsoft Dataverse |
@@ -862,8 +958,7 @@ Enable file-based HTTP logging to capture all requests and responses for debuggi
862
958
863
959
```python
864
960
from PowerPlatform.Dataverse.client import DataverseClient
865
-
from PowerPlatform.Dataverse.core.config import DataverseConfig
866
-
from PowerPlatform.Dataverse.core.log_config import LogConfig
961
+
from PowerPlatform.Dataverse.core import DataverseConfig, LogConfig
867
962
868
963
log_cfg = LogConfig(
869
964
log_folder="./my_logs", # Directory for log files (created if missing)
0 commit comments