From 1a142d5f67eb24a3a6c4a2cd9c3b829a52d545ae Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Wed, 5 Jul 2023 17:56:46 -0400 Subject: [PATCH 01/10] reformat index page Signed-off-by: Hannah Hunter --- daprdocs/content/en/python-sdk-docs/_index.md | 89 ++++++++++++++++--- .../en/python-sdk-docs/python-client.md | 5 +- 2 files changed, 79 insertions(+), 15 deletions(-) diff --git a/daprdocs/content/en/python-sdk-docs/_index.md b/daprdocs/content/en/python-sdk-docs/_index.md index 4c0059c8..0eaf63e6 100644 --- a/daprdocs/content/en/python-sdk-docs/_index.md +++ b/daprdocs/content/en/python-sdk-docs/_index.md @@ -9,46 +9,109 @@ no_list: true Dapr offers a variety of packages to help with the development of Python applications. Using them you can create Python clients, servers, and virtual actors with Dapr. -## Available packages +## Prerequisites + +- [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed +- Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}}) +- [Python 3.7+](https://www.python.org/downloads/) installed -- [**Dapr client**]({{< ref python-client.md >}}) for writing Python applications to interact with the Dapr sidecar and other Dapr applications -- [**Dapr actor**]({{< ref python-actor.md >}}) for creating and interacting with stateful virtual actors in Python -- [**Extensions**]({{< ref python-sdk-extensions >}}) for adding Dapr capabilities to other Python frameworks - - [**gRPC extension**]({{< ref python-grpc.md >}}) for creating a gRPC server with Dapr - - [**FastAPI extension**]({{< ref python-fastapi.md >}}) for adding Dapr actor capabilities to FastAPI applications - - [**Flask extension**]({{< ref python-flask.md >}}) for adding Dapr actor capabilities to Flask applications +## Installation -## Install the Dapr module +To get started with the Python SDK, install the Dapr Python SDK package {{< tabs Stable Development>}} {{% codetab %}} + ```bash pip install dapr ``` {{% /codetab %}} {{% codetab %}} -{{% alert title="Note" color="warning" %}} -The development package will contain features and behavior that will be compatible with the pre-release version of the Dapr runtime. Make sure to uninstall any stable versions of the Python SDK before installing the dapr-dev package. + +> **Note:** The development package will contain features and behavior that will be compatible with the pre-release version of the Dapr runtime. Make sure to uninstall any stable versions of the Python SDK before installing the dapr-dev package. {{% /alert %}} ```bash pip install dapr-dev ``` + {{% /codetab %}} {{< /tabs >}} + ## Try it out -Clone the Python SDK repo to try out some of the [examples](https://github.com/dapr/python-sdk/tree/master/examples). +Clone the Python SDK repo. ```bash git clone https://github.com/dapr/python-sdk.git ``` +Walk through the Python quickstarts, tutorials, and examples to see Dapr in action: + +| SDK samples | Description | +| ----------- | ----------- | +| [Quickstarts]({{< ref quickstarts >}}) | Experience Dapr's API building blocks in just a few minutes using the Python SDK. | +| [SDK samples](https://github.com/dapr/python-sdk/tree/master/examples) | Clone the SDK repo to try out some examples and get started. | +| [Bindings tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/bindings) | See how Dapr Python SDK works alongside other Dapr SDKs to enable bindings. | +| [Distributed Calculator tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/distributed-calculator/python) | Use the Dapr Python SDK to handle method invocation and state persistent capabilities. | +| [Hello World tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/hello-world) | Learn how to get Dapr up and running locally on your machine with the Python SDK. | +| [Hello Kubernetes tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/hello-kubernetes) | Get up and running with the Dapr Python SDK in a Kubernetes cluster. | +| [Observability tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/observability) | Explore Dapr's metric collection, tracing, logging and health check capabilities using the Python SDK. | +| [Pub/sub tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/pub-sub) | See how Dapr Python SDK works alongside other Dapr SDKs to enable pub/sub applications. | + + +## Available packages + +
+
+
+
Client
+

Write Python applications to interact with a Dapr sidecar and other Dapr applications.

+ +
+
+
+
+
Actors
+

Create and interact with stateful virtual actors in Python.

+ +
+
+
+
+
Extensions
+

Add Dapr capabilities to other Python frameworks using the gRPC extension, the FastAPI extension, or the Flask extension.

+ +
+
+
+
+
Workflow
+

Create and manage workflows that work with other Dapr APIs in Python.

+ +
+
+
+ ## More information -- [Python Package Index (PyPI)](https://pypi.org/user/dapr.io/) -- [Dapr SDK serialization]({{< ref sdk-serialization.md >}}) +
+
+
+
Serialization
+

Learn more about serialization in Dapr SDKs.

+ +
+
+
+
+
PyPI
+

Python Package Index

+ +
+
+
\ No newline at end of file diff --git a/daprdocs/content/en/python-sdk-docs/python-client.md b/daprdocs/content/en/python-sdk-docs/python-client.md index 4fe18a4e..7edb4b23 100644 --- a/daprdocs/content/en/python-sdk-docs/python-client.md +++ b/daprdocs/content/en/python-sdk-docs/python-client.md @@ -8,12 +8,13 @@ description: How to get up and running with the Dapr Python SDK The Dapr client package allows you to interact with other Dapr applications from a Python application. -## Pre-requisites +## Prerequisites - [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed - Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}}) - [Python 3.7+](https://www.python.org/downloads/) installed -- [Dapr Python module]({{< ref "python#install-the0dapr-module" >}}) installed +- [Dapr Python module]({{< ref "python#installation" >}}) installed + ## Import the client package From c92b1473ae9eae7fff1bda2e8523b46ba57a9df8 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Thu, 6 Jul 2023 11:56:48 -0400 Subject: [PATCH 02/10] quick freshness pass on python client doc Signed-off-by: Hannah Hunter --- .../en/python-sdk-docs/python-client.md | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/daprdocs/content/en/python-sdk-docs/python-client.md b/daprdocs/content/en/python-sdk-docs/python-client.md index 7edb4b23..212bcc01 100644 --- a/daprdocs/content/en/python-sdk-docs/python-client.md +++ b/daprdocs/content/en/python-sdk-docs/python-client.md @@ -8,17 +8,18 @@ description: How to get up and running with the Dapr Python SDK The Dapr client package allows you to interact with other Dapr applications from a Python application. -## Prerequisites +{{% alert title="Note" color="primary" %}} + If you haven't already, [try out one of the quickstarts]({{< ref quickstarts >}}) for a quick walk-through on how to use the Dapr Python SDK with an API building block. + +{{% /alert %}} -- [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed -- Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}}) -- [Python 3.7+](https://www.python.org/downloads/) installed -- [Dapr Python module]({{< ref "python#installation" >}}) installed +## Prerequisites +[Install the Dapr Python module]({{< ref "python-sdk-docs/_index.md" >}}) before getting started. ## Import the client package -The dapr package contains the `DaprClient` which will be used to create and use a client. +The Dapr package contains the `DaprClient`, which is used to create and use a client. ```python from dapr.clients import DaprClient @@ -43,7 +44,7 @@ with DaprClient() as d: ``` - For a full guide on service invocation visit [How-To: Invoke a service]({{< ref howto-invoke-discover-services.md >}}). -- Visit [Python SDK examples](https://github.com/dapr/python-sdk/tree/master/examples/invoke-simple) for code samples and instructions to try out service invocation +- Visit [Python SDK examples](https://github.com/dapr/python-sdk/tree/master/examples/invoke-simple) for code samples and instructions to try out service invocation. ### Save & get application state @@ -62,7 +63,7 @@ with DaprClient() as d: ``` - For a full list of state operations visit [How-To: Get & save state]({{< ref howto-get-save-state.md >}}). -- Visit [Python SDK examples](https://github.com/dapr/python-sdk/tree/master/examples/state_store) for code samples and instructions to try out state management +- Visit [Python SDK examples](https://github.com/dapr/python-sdk/tree/master/examples/state_store) for code samples and instructions to try out state management. ### Query application state (Alpha) @@ -96,7 +97,7 @@ with DaprClient() as d: ### Publish & subscribe to messages -##### Publish messages +#### Publish messages ```python from dapr.clients import DaprClient @@ -105,7 +106,7 @@ with DaprClient() as d: resp = d.publish_event(pubsub_name='pubsub', topic_name='TOPIC_A', data='{"message":"Hello World"}') ``` -##### Subscribe to messages +#### Subscribe to messages ```python from cloudevents.sdk.event import v1 @@ -144,7 +145,7 @@ with DaprClient() as d: ``` - For a full guide on output bindings visit [How-To: Use bindings]({{< ref howto-bindings.md >}}). -- Visit [Python SDK examples](https://github.com/dapr/python-sdk/tree/master/examples/invoke-binding) for code samples and instructions to try out output bindings +- Visit [Python SDK examples](https://github.com/dapr/python-sdk/tree/master/examples/invoke-binding) for code samples and instructions to try out output bindings. ### Retrieve secrets @@ -158,7 +159,9 @@ with DaprClient() as d: - For a full guide on secrets visit [How-To: Retrieve secrets]({{< ref howto-secrets.md >}}). - Visit [Python SDK examples](https://github.com/dapr/python-sdk/tree/master/examples/secret_store) for code samples and instructions to try out retrieving secrets -### Get configuration +### Configuration + +#### Get configuration ```python from dapr.clients import DaprClient @@ -168,7 +171,7 @@ with DaprClient() as d: configuration = d.get_configuration(store_name='configurationstore', keys=['orderId'], config_metadata={}) ``` -### Subscribe to configuration +#### Subscribe to configuration ```python import asyncio @@ -199,7 +202,7 @@ asyncio.run(executeConfiguration()) ``` - Learn more about managing configurations via the [How-To: Manage configuration]({{< ref howto-manage-configuration.md >}}) guide. -- Visit [Python SDK examples](https://github.com/dapr/python-sdk/tree/master/examples/configuration) for code samples and instructions to try out configuration +- Visit [Python SDK examples](https://github.com/dapr/python-sdk/tree/master/examples/configuration) for code samples and instructions to try out configuration. ### Distributed Lock @@ -317,4 +320,4 @@ def main(): ## Related links -- [Python SDK examples](https://github.com/dapr/python-sdk/tree/master/examples) +[Python SDK examples](https://github.com/dapr/python-sdk/tree/master/examples) From fd8988261ba85a25d214db607dc3c8d298399b69 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Fri, 14 Jul 2023 15:21:03 -0400 Subject: [PATCH 03/10] edit based on bernd review Signed-off-by: Hannah Hunter --- daprdocs/content/en/python-sdk-docs/_index.md | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/daprdocs/content/en/python-sdk-docs/_index.md b/daprdocs/content/en/python-sdk-docs/_index.md index 0eaf63e6..b1e3ab62 100644 --- a/daprdocs/content/en/python-sdk-docs/_index.md +++ b/daprdocs/content/en/python-sdk-docs/_index.md @@ -66,11 +66,13 @@ Walk through the Python quickstarts, tutorials, and examples to see Dapr in acti ## Available packages +### Main SDK +
Client
-

Write Python applications to interact with a Dapr sidecar and other Dapr applications.

+

Write Python applications to interact with a Dapr sidecar and other Dapr applications, including stateful virtual actors in Python

@@ -81,10 +83,29 @@ Walk through the Python quickstarts, tutorials, and examples to see Dapr in acti
+ + +### SDK extensions + +
-
Extensions
-

Add Dapr capabilities to other Python frameworks using the gRPC extension, the FastAPI extension, or the Flask extension.

+
gRPC
+

Create Dapr services with the gRPC server extension module

+ +
+
+
+
+
FastAPI
+

Integrate with Dapr Python virtual actors and pub/sub using the Dapr FastAPI extension module.

+ +
+
+
+
+
Flask
+

Integrate with Dapr Python virtual actors using the Dapr Flask extension module.

@@ -97,6 +118,8 @@ Walk through the Python quickstarts, tutorials, and examples to see Dapr in acti
+ + ## More information
From 8da6942f4d6f822298357551cdc5c961db2eb964 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Mon, 17 Jul 2023 16:37:18 -0400 Subject: [PATCH 04/10] updates per bernd discussion Signed-off-by: Hannah Hunter --- daprdocs/content/en/python-sdk-docs/_index.md | 81 +++++++++++++------ 1 file changed, 58 insertions(+), 23 deletions(-) diff --git a/daprdocs/content/en/python-sdk-docs/_index.md b/daprdocs/content/en/python-sdk-docs/_index.md index b1e3ab62..32b1602c 100644 --- a/daprdocs/content/en/python-sdk-docs/_index.md +++ b/daprdocs/content/en/python-sdk-docs/_index.md @@ -17,7 +17,7 @@ Dapr offers a variety of packages to help with the development of Python applica ## Installation -To get started with the Python SDK, install the Dapr Python SDK package +To get started with the Python SDK, install the main Dapr Python SDK package. {{< tabs Stable Development>}} @@ -42,31 +42,15 @@ pip install dapr-dev {{< /tabs >}} -## Try it out - -Clone the Python SDK repo. - -```bash -git clone https://github.com/dapr/python-sdk.git -``` - -Walk through the Python quickstarts, tutorials, and examples to see Dapr in action: - -| SDK samples | Description | -| ----------- | ----------- | -| [Quickstarts]({{< ref quickstarts >}}) | Experience Dapr's API building blocks in just a few minutes using the Python SDK. | -| [SDK samples](https://github.com/dapr/python-sdk/tree/master/examples) | Clone the SDK repo to try out some examples and get started. | -| [Bindings tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/bindings) | See how Dapr Python SDK works alongside other Dapr SDKs to enable bindings. | -| [Distributed Calculator tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/distributed-calculator/python) | Use the Dapr Python SDK to handle method invocation and state persistent capabilities. | -| [Hello World tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/hello-world) | Learn how to get Dapr up and running locally on your machine with the Python SDK. | -| [Hello Kubernetes tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/hello-kubernetes) | Get up and running with the Dapr Python SDK in a Kubernetes cluster. | -| [Observability tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/observability) | Explore Dapr's metric collection, tracing, logging and health check capabilities using the Python SDK. | -| [Pub/sub tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/pub-sub) | See how Dapr Python SDK works alongside other Dapr SDKs to enable pub/sub applications. | +## Additional available packages +Once you've installed the main Python SDK, you can: +- Import additional packages as part of the main SDK package +- Install extensions on top of the main Python SDK -## Available packages +### SDK imports -### Main SDK +Python SDK imports are included with the main SDK install, but need to be imported when used. The Dapr Python SDK provides the following imports:
@@ -76,17 +60,48 @@ Walk through the Python quickstarts, tutorials, and examples to see Dapr in acti
+
+
+
Async clients
+

Create and interact with Dapr's Actor framework.

+ +
+
Actors
+

Create and interact with Dapr's Actor framework.

+ +
+
+
+
+
Configuration
+

Create and interact with stateful virtual actors in Python.

+ +
+
+
+
+
Serializer/Deserializer
+

Create and interact with stateful virtual actors in Python.

+ +
+
+
+
+
Autogenerated gRPC clients

Create and interact with stateful virtual actors in Python.

+
### SDK extensions +SDK extensions mainly work as utilities for receiving pub/sub events, programatically creating pub/sub subscriptions, and handling input binding events. While you can acheive all of these tasks without an extension, using a Python SDK extension proves convenient. +
@@ -118,6 +133,26 @@ Walk through the Python quickstarts, tutorials, and examples to see Dapr in acti
+## Try it out + +Clone the Python SDK repo. + +```bash +git clone https://github.com/dapr/python-sdk.git +``` + +Walk through the Python quickstarts, tutorials, and examples to see Dapr in action: + +| SDK samples | Description | +| ----------- | ----------- | +| [Quickstarts]({{< ref quickstarts >}}) | Experience Dapr's API building blocks in just a few minutes using the Python SDK. | +| [SDK samples](https://github.com/dapr/python-sdk/tree/master/examples) | Clone the SDK repo to try out some examples and get started. | +| [Bindings tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/bindings) | See how Dapr Python SDK works alongside other Dapr SDKs to enable bindings. | +| [Distributed Calculator tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/distributed-calculator/python) | Use the Dapr Python SDK to handle method invocation and state persistent capabilities. | +| [Hello World tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/hello-world) | Learn how to get Dapr up and running locally on your machine with the Python SDK. | +| [Hello Kubernetes tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/hello-kubernetes) | Get up and running with the Dapr Python SDK in a Kubernetes cluster. | +| [Observability tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/observability) | Explore Dapr's metric collection, tracing, logging and health check capabilities using the Python SDK. | +| [Pub/sub tutorial](https://github.com/dapr/quickstarts/tree/master/tutorials/pub-sub) | See how Dapr Python SDK works alongside other Dapr SDKs to enable pub/sub applications. | ## More information From 5fdbc4918bf693d588ac24428a9c82721bedcc5f Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Tue, 18 Jul 2023 13:47:22 -0400 Subject: [PATCH 05/10] revert a bit Signed-off-by: Hannah Hunter --- daprdocs/content/en/python-sdk-docs/_index.md | 37 +++---------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/daprdocs/content/en/python-sdk-docs/_index.md b/daprdocs/content/en/python-sdk-docs/_index.md index 32b1602c..ade5528f 100644 --- a/daprdocs/content/en/python-sdk-docs/_index.md +++ b/daprdocs/content/en/python-sdk-docs/_index.md @@ -42,7 +42,7 @@ pip install dapr-dev {{< /tabs >}} -## Additional available packages +## Available packages Once you've installed the main Python SDK, you can: - Import additional packages as part of the main SDK package @@ -50,7 +50,7 @@ Once you've installed the main Python SDK, you can: ### SDK imports -Python SDK imports are included with the main SDK install, but need to be imported when used. The Dapr Python SDK provides the following imports: +Python SDK imports are included with the main SDK install, but need to be imported when used. The most common imports provided by the Dapr Python SDK are:
@@ -60,13 +60,6 @@ Python SDK imports are included with the main SDK install, but need to be import
-
-
-
Async clients
-

Create and interact with Dapr's Actor framework.

- -
-
Actors
@@ -74,30 +67,10 @@ Python SDK imports are included with the main SDK install, but need to be import
-
-
-
Configuration
-

Create and interact with stateful virtual actors in Python.

- -
-
-
-
-
Serializer/Deserializer
-

Create and interact with stateful virtual actors in Python.

- -
-
-
-
-
Autogenerated gRPC clients
-

Create and interact with stateful virtual actors in Python.

- -
-
-
+Learn more about _all_ of the [available Dapr Python SDK imports](https://github.com/dapr/python-sdk/tree/master/dapr). + ### SDK extensions SDK extensions mainly work as utilities for receiving pub/sub events, programatically creating pub/sub subscriptions, and handling input binding events. While you can acheive all of these tasks without an extension, using a Python SDK extension proves convenient. @@ -133,6 +106,8 @@ SDK extensions mainly work as utilities for receiving pub/sub events, programati +Learn more about [the Dapr Python SDK extensions](https://github.com/dapr/python-sdk/tree/master/ext). + ## Try it out Clone the Python SDK repo. From 8ffd871ea9f3696b6148409ee3ef3f54052fff0e Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Tue, 18 Jul 2023 13:50:29 -0400 Subject: [PATCH 06/10] add note that workflow is in alpha Signed-off-by: Hannah Hunter --- daprdocs/content/en/python-sdk-docs/python-workflow.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/daprdocs/content/en/python-sdk-docs/python-workflow.md b/daprdocs/content/en/python-sdk-docs/python-workflow.md index 4fb4c0fc..6335933d 100644 --- a/daprdocs/content/en/python-sdk-docs/python-workflow.md +++ b/daprdocs/content/en/python-sdk-docs/python-workflow.md @@ -6,6 +6,10 @@ weight: 30000 description: How to get up and running with workflows using the Dapr Python SDK --- +{{% alert title="Note" color="primary" %}} +Dapr Workflow is currently in alpha. +{{% /alert %}} + Let’s create a Dapr workflow and invoke it using the console. With the [provided hello world workflow example](https://github.com/dapr/python-sdk/tree/master/examples/demo_workflow), you will: - Run a [Python console application using `DaprClient`](https://github.com/dapr/python-sdk/blob/master/examples/demo_workflow/app.py) From 8626c3784184f673c957331c585d16e16e50809f Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Tue, 18 Jul 2023 13:52:23 -0400 Subject: [PATCH 07/10] move workflow doc to extensions node Signed-off-by: Hannah Hunter --- daprdocs/content/en/python-sdk-docs/_index.md | 2 +- .../{ => python-sdk-extensions}/python-workflow.md | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename daprdocs/content/en/python-sdk-docs/{ => python-sdk-extensions}/python-workflow.md (100%) diff --git a/daprdocs/content/en/python-sdk-docs/_index.md b/daprdocs/content/en/python-sdk-docs/_index.md index ade5528f..7c8394c8 100644 --- a/daprdocs/content/en/python-sdk-docs/_index.md +++ b/daprdocs/content/en/python-sdk-docs/_index.md @@ -100,7 +100,7 @@ SDK extensions mainly work as utilities for receiving pub/sub events, programati
Workflow
-

Create and manage workflows that work with other Dapr APIs in Python.

+

Author workflows that work with other Dapr APIs in Python.

diff --git a/daprdocs/content/en/python-sdk-docs/python-workflow.md b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow.md similarity index 100% rename from daprdocs/content/en/python-sdk-docs/python-workflow.md rename to daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow.md From 8aca437af536c71898bc0439cad216b37a377e52 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Tue, 18 Jul 2023 14:21:47 -0400 Subject: [PATCH 08/10] bernd review Signed-off-by: Hannah Hunter --- daprdocs/content/en/python-sdk-docs/_index.md | 4 ---- daprdocs/content/en/python-sdk-docs/python-client.md | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/daprdocs/content/en/python-sdk-docs/_index.md b/daprdocs/content/en/python-sdk-docs/_index.md index 7c8394c8..7197f5f8 100644 --- a/daprdocs/content/en/python-sdk-docs/_index.md +++ b/daprdocs/content/en/python-sdk-docs/_index.md @@ -44,10 +44,6 @@ pip install dapr-dev ## Available packages -Once you've installed the main Python SDK, you can: -- Import additional packages as part of the main SDK package -- Install extensions on top of the main Python SDK - ### SDK imports Python SDK imports are included with the main SDK install, but need to be imported when used. The most common imports provided by the Dapr Python SDK are: diff --git a/daprdocs/content/en/python-sdk-docs/python-client.md b/daprdocs/content/en/python-sdk-docs/python-client.md index 212bcc01..a830cd6d 100644 --- a/daprdocs/content/en/python-sdk-docs/python-client.md +++ b/daprdocs/content/en/python-sdk-docs/python-client.md @@ -19,7 +19,7 @@ The Dapr client package allows you to interact with other Dapr applications from ## Import the client package -The Dapr package contains the `DaprClient`, which is used to create and use a client. +The `dapr` package contains the `DaprClient`, which is used to create and use a client. ```python from dapr.clients import DaprClient From c1d2b7bc93edfab63b4281b12755d2f2c0635f38 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Tue, 18 Jul 2023 15:00:16 -0400 Subject: [PATCH 09/10] update terminology, clean up docs org in toc Signed-off-by: Hannah Hunter --- daprdocs/content/en/python-sdk-docs/_index.md | 12 +++--- .../en/python-sdk-docs/python-actor.md | 2 +- .../en/python-sdk-docs/python-client.md | 2 +- .../python-sdk-extensions/_index.md | 2 +- .../python-sdk-extensions/python-fastapi.md | 6 +-- .../python-sdk-extensions/python-flask.md | 6 +-- .../python-sdk-extensions/python-grpc.md | 10 ++--- .../python-workflow/_index.md | 42 +++++++++++++++++++ .../{ => python-workflow}/python-workflow.md | 2 +- 9 files changed, 63 insertions(+), 21 deletions(-) create mode 100644 daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow/_index.md rename daprdocs/content/en/python-sdk-docs/python-sdk-extensions/{ => python-workflow}/python-workflow.md (97%) diff --git a/daprdocs/content/en/python-sdk-docs/_index.md b/daprdocs/content/en/python-sdk-docs/_index.md index 7197f5f8..b5a00151 100644 --- a/daprdocs/content/en/python-sdk-docs/_index.md +++ b/daprdocs/content/en/python-sdk-docs/_index.md @@ -7,7 +7,7 @@ description: Python SDK packages for developing Dapr applications no_list: true --- -Dapr offers a variety of packages to help with the development of Python applications. Using them you can create Python clients, servers, and virtual actors with Dapr. +Dapr offers a variety of subpackages to help with the development of Python applications. Using them you can create Python clients, servers, and virtual actors with Dapr. ## Prerequisites @@ -42,11 +42,11 @@ pip install dapr-dev {{< /tabs >}} -## Available packages +## Available subpackages ### SDK imports -Python SDK imports are included with the main SDK install, but need to be imported when used. The most common imports provided by the Dapr Python SDK are: +Python SDK imports are subpackages included with the main SDK install, but need to be imported when used. The most common imports provided by the Dapr Python SDK are:
@@ -75,21 +75,21 @@ SDK extensions mainly work as utilities for receiving pub/sub events, programati
gRPC
-

Create Dapr services with the gRPC server extension module

+

Create Dapr services with the gRPC server extension.

FastAPI
-

Integrate with Dapr Python virtual actors and pub/sub using the Dapr FastAPI extension module.

+

Integrate with Dapr Python virtual actors and pub/sub using the Dapr FastAPI extension.

Flask
-

Integrate with Dapr Python virtual actors using the Dapr Flask extension module.

+

Integrate with Dapr Python virtual actors using the Dapr Flask extension.

diff --git a/daprdocs/content/en/python-sdk-docs/python-actor.md b/daprdocs/content/en/python-sdk-docs/python-actor.md index 53297152..e44e0ce0 100644 --- a/daprdocs/content/en/python-sdk-docs/python-actor.md +++ b/daprdocs/content/en/python-sdk-docs/python-actor.md @@ -13,7 +13,7 @@ The Dapr actor package allows you to interact with Dapr virtual actors from a Py - [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed - Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}}) - [Python 3.7+](https://www.python.org/downloads/) installed -- [Dapr Python module]({{< ref "python#install-the0dapr-module" >}}) installed +- [Dapr Python package]({{< ref "python#installation" >}}) installed ## Actor interface diff --git a/daprdocs/content/en/python-sdk-docs/python-client.md b/daprdocs/content/en/python-sdk-docs/python-client.md index a830cd6d..a490dc6d 100644 --- a/daprdocs/content/en/python-sdk-docs/python-client.md +++ b/daprdocs/content/en/python-sdk-docs/python-client.md @@ -15,7 +15,7 @@ The Dapr client package allows you to interact with other Dapr applications from ## Prerequisites -[Install the Dapr Python module]({{< ref "python-sdk-docs/_index.md" >}}) before getting started. +[Install the Dapr Python package]({{< ref "python-sdk-docs/_index.md" >}}) before getting started. ## Import the client package diff --git a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/_index.md b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/_index.md index 1eb536b9..8b7bc9c5 100644 --- a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/_index.md +++ b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/_index.md @@ -2,6 +2,6 @@ type: docs title: "Dapr Python SDK extensions" linkTitle: "Extensions" -weight: 20000 +weight: 30000 description: Python SDK for developing Dapr applications --- diff --git a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-fastapi.md b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-fastapi.md index eee7a523..b9bf5b6b 100644 --- a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-fastapi.md +++ b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-fastapi.md @@ -6,11 +6,11 @@ weight: 200000 description: How to create Dapr Python virtual actors and pubsub with the FastAPI extension --- -The Dapr Python SDK provides integration with FastAPI using the `dapr-ext-fastapi` module +The Dapr Python SDK provides integration with FastAPI using the `dapr-ext-fastapi` extension. ## Installation -You can download and install the Dapr FastAPI extension module with: +You can download and install the Dapr FastAPI extension with: {{< tabs Stable Development>}} @@ -22,7 +22,7 @@ pip install dapr-ext-fastapi {{% codetab %}} {{% alert title="Note" color="warning" %}} -The development package will contain features and behavior that will be compatible with the pre-release version of the Dapr runtime. Make sure to uninstall any stable versions of the Python SDK extension before installing the dapr-dev package. +The development package will contain features and behavior that will be compatible with the pre-release version of the Dapr runtime. Make sure to uninstall any stable versions of the Python SDK extension before installing the `dapr-dev` package. {{% /alert %}} ```bash diff --git a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-flask.md b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-flask.md index e0e3f11c..e48948bc 100644 --- a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-flask.md +++ b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-flask.md @@ -6,11 +6,11 @@ weight: 300000 description: How to create Dapr Python virtual actors with the Flask extension --- -The Dapr Python SDK provides integration with Flask using the `flask-dapr` module +The Dapr Python SDK provides integration with Flask using the `flask-dapr` extension. ## Installation -You can download and install the Dapr Flask extension module with: +You can download and install the Dapr Flask extension with: {{< tabs Stable Development>}} @@ -22,7 +22,7 @@ pip install flask-dapr {{% codetab %}} {{% alert title="Note" color="warning" %}} -The development package will contain features and behavior that will be compatible with the pre-release version of the Dapr runtime. Make sure to uninstall any stable versions of the Python SDK extension before installing the dapr-dev package. +The development package will contain features and behavior that will be compatible with the pre-release version of the Dapr runtime. Make sure to uninstall any stable versions of the Python SDK extension before installing the `dapr-dev` package. {{% /alert %}} ```bash diff --git a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-grpc.md b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-grpc.md index 92150408..0e868238 100644 --- a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-grpc.md +++ b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-grpc.md @@ -2,15 +2,15 @@ type: docs title: "Getting started with the Dapr Python gRPC service extension" linkTitle: "gRPC" -weight: 20000 -description: How to get up and running with the Dapr Python gRPC extension package +weight: 100000 +description: How to get up and running with the Dapr Python gRPC extension --- -The Dapr Python SDK provides a built in gRPC server extension module, `dapr.ext.grpc`, for creating Dapr services. +The Dapr Python SDK provides a built in gRPC server extension, `dapr.ext.grpc`, for creating Dapr services. ## Installation -You can download and install the Dapr gRPC server extension module with: +You can download and install the Dapr gRPC server extension with: {{< tabs Stable Development>}} @@ -22,7 +22,7 @@ pip install dapr-ext-grpc {{% codetab %}} {{% alert title="Note" color="warning" %}} -The development package will contain features and behavior that will be compatible with the pre-release version of the Dapr runtime. Make sure to uninstall any stable versions of the Python SDK extension before installing the dapr-dev package. +The development package will contain features and behavior that will be compatible with the pre-release version of the Dapr runtime. Make sure to uninstall any stable versions of the Python SDK extension before installing the `dapr-dev` package. {{% /alert %}} ```bash diff --git a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow/_index.md b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow/_index.md new file mode 100644 index 00000000..e5fe5ce8 --- /dev/null +++ b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow/_index.md @@ -0,0 +1,42 @@ +--- +type: docs +title: "Dapr Python SDK integration with Dapr Workflow extension" +linkTitle: "Dapr Workflow" +weight: 400000 +description: How to get up and running with the Dapr Workflow extension +no_list: true +--- + +{{% alert title="Note" color="primary" %}} +Dapr Workflow is currently in alpha. +{{% /alert %}} + +The Dapr Python SDK provides a built in Dapr Workflow extension, `dapr.ext.workflow`, for creating Dapr services. + +## Installation + +You can download and install the Dapr Workflow extension with: + +{{< tabs Stable Development>}} + +{{% codetab %}} +```bash +pip install dapr-ext-workflow +``` +{{% /codetab %}} + +{{% codetab %}} +{{% alert title="Note" color="warning" %}} +The development package will contain features and behavior that will be compatible with the pre-release version of the Dapr runtime. Make sure to uninstall any stable versions of the Python SDK extension before installing the `dapr-dev` package. +{{% /alert %}} + +```bash +pip3 install dapr-ext-workflow-dev +``` +{{% /codetab %}} + +{{< /tabs >}} + +## Next steps + +{{< button text="Getting started with the Dapr Workflow Python SDK" page="python-workflow.md" >}} diff --git a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow.md b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow/python-workflow.md similarity index 97% rename from daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow.md rename to daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow/python-workflow.md index 6335933d..8ae7c872 100644 --- a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow.md +++ b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow/python-workflow.md @@ -26,7 +26,7 @@ In the Python example project, the `app.py` file contains the setup of the app, - [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed - Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}}) - [Python 3.7+](https://www.python.org/downloads/) installed -- [Dapr Python module]({{< ref "python#install-the0dapr-module" >}}) installed +- [Dapr Python package]({{< ref "python#installation" >}}) and the [workflow extension](https://github.com/dapr/python-sdk/tree/master/ext/dapr-ext-workflow#installation) installed - Verify you're using the latest proto bindings ## Set up the environment From fda48f99d9d92b510349e4744823498ee71ae622 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Tue, 18 Jul 2023 15:04:42 -0400 Subject: [PATCH 10/10] forgot one url ref Signed-off-by: Hannah Hunter --- .../python-sdk-extensions/python-workflow/python-workflow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow/python-workflow.md b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow/python-workflow.md index 8ae7c872..28b858fa 100644 --- a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow/python-workflow.md +++ b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow/python-workflow.md @@ -26,7 +26,7 @@ In the Python example project, the `app.py` file contains the setup of the app, - [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed - Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}}) - [Python 3.7+](https://www.python.org/downloads/) installed -- [Dapr Python package]({{< ref "python#installation" >}}) and the [workflow extension](https://github.com/dapr/python-sdk/tree/master/ext/dapr-ext-workflow#installation) installed +- [Dapr Python package]({{< ref "python#installation" >}}) and the [workflow extension]({{< ref "python-workflow/_index.md >}}) installed - Verify you're using the latest proto bindings ## Set up the environment