diff --git a/daprdocs/content/en/python-sdk-contributing/python-contributing.md b/daprdocs/content/en/python-sdk-contributing/python-contributing.md index 24ed10efe..fe22c10bd 100644 --- a/daprdocs/content/en/python-sdk-contributing/python-contributing.md +++ b/daprdocs/content/en/python-sdk-contributing/python-contributing.md @@ -12,14 +12,14 @@ When contributing to the [Python SDK](https://github.com/dapr/python-sdk) the fo The `examples` directory contains code samples for users to run to try out specific functionality of the various Python SDK packages and extensions. When writing new and updated samples keep in mind: -- All examples should be runnable on Windows, Linux, and MacOS. While Python code is consistent among operating systems, any pre/post example commands should provide options through [codetabs]({{< ref "contributing-docs.md#tabbed-content" >}}) +- All examples should be runnable on Windows, Linux, and MacOS. While Python code is consistent among operating systems, any pre/post example commands should provide options through [tabpane]({{% ref "contributing-docs.md#tabbed-content" %}}) - Contain steps to download/install any required pre-requisites. Someone coming in with a fresh OS install should be able to start on the example and complete it without an error. Links to external download pages are fine. ## Docs The `daprdocs` directory contains the markdown files that are rendered into the [Dapr Docs](https://docs.dapr.io) website. When the documentation website is built this repo is cloned and configured so that its contents are rendered with the docs content. When writing docs keep in mind: - - All rules in the [docs guide]({{< ref contributing-docs.md >}}) should be followed in addition to these. + - All rules in the [docs guide]({{% ref contributing-docs.md %}}) should be followed in addition to these. - All files and directories should be prefixed with `python-` to ensure all file/directory names are globally unique across all Dapr documentation. ## Github Dapr Bot Commands diff --git a/daprdocs/content/en/python-sdk-docs/_index.md b/daprdocs/content/en/python-sdk-docs/_index.md index a22d08434..454a5afb6 100644 --- a/daprdocs/content/en/python-sdk-docs/_index.md +++ b/daprdocs/content/en/python-sdk-docs/_index.md @@ -16,24 +16,24 @@ Dapr offers a variety of subpackages to help with the development of Python appl ## Prerequisites -- [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed -- Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}}) +- [Dapr CLI]({{% ref install-dapr-cli.md %}}) installed +- Initialized [Dapr environment]({{% ref install-dapr-selfhost.md %}}) - [Python 3.9+](https://www.python.org/downloads/) installed ## Installation To get started with the Python SDK, install the main Dapr Python SDK package. -{{< tabs Stable Development>}} +{{< tabpane text=true >}} -{{% codetab %}} +{{% tab header="Stable" %}} ```bash pip install dapr ``` -{{% /codetab %}} +{{% /tab %}} -{{% codetab %}} +{{% tab header="Development" %}} > **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. @@ -41,9 +41,9 @@ pip install dapr pip install dapr-dev ``` -{{% /codetab %}} +{{% /tab %}} -{{< /tabs >}} +{{< /tabpane >}} ## Available subpackages @@ -57,14 +57,14 @@ Python SDK imports are subpackages included with the main SDK install, but need
Client

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

- +
Actors

Create and interact with Dapr's Actor framework.

- +
@@ -80,28 +80,28 @@ SDK extensions mainly work as utilities for receiving pub/sub events, programati
gRPC

Create Dapr services with the gRPC server extension.

- +
FastAPI

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.

- +
Workflow

Author workflows that work with other Dapr APIs in Python.

- +
@@ -120,7 +120,7 @@ Walk through the Python quickstarts, tutorials, and examples to see Dapr in acti | SDK samples | Description | | ----------- | ----------- | -| [Quickstarts]({{< ref quickstarts >}}) | Experience Dapr's API building blocks in just a few minutes using the Python SDK. | +| [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. | @@ -137,7 +137,7 @@ Walk through the Python quickstarts, tutorials, and examples to see Dapr in acti
Serialization

Learn more about serialization in Dapr SDKs.

- +
diff --git a/daprdocs/content/en/python-sdk-docs/python-actor.md b/daprdocs/content/en/python-sdk-docs/python-actor.md index 9508dbfa4..22360afd0 100644 --- a/daprdocs/content/en/python-sdk-docs/python-actor.md +++ b/daprdocs/content/en/python-sdk-docs/python-actor.md @@ -10,10 +10,10 @@ The Dapr actor package allows you to interact with Dapr virtual actors from a Py ## Pre-requisites -- [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed -- Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}}) +- [Dapr CLI]({{% ref install-dapr-cli.md %}}) installed +- Initialized [Dapr environment]({{% ref install-dapr-selfhost.md %}}) - [Python 3.9+](https://www.python.org/downloads/) installed -- [Dapr Python package]({{< ref "python#installation" >}}) installed +- [Dapr Python package]({{% ref "python#installation" %}}) installed ## Actor interface @@ -33,8 +33,8 @@ class DemoActorInterface(ActorInterface): An actor service hosts the virtual actor. It is implemented a class that derives from the base type `Actor` and implements the interfaces defined in the actor interface. Actors can be created using one of the Dapr actor extensions: - - [FastAPI actor extension]({{< ref python-fastapi.md >}}) - - [Flask actor extension]({{< ref python-flask.md >}}) + - [FastAPI actor extension]({{% ref python-fastapi.md %}}) + - [Flask actor extension]({{% ref python-flask.md %}}) ## Actor client diff --git a/daprdocs/content/en/python-sdk-docs/python-client.md b/daprdocs/content/en/python-sdk-docs/python-client.md index 7024018ad..b26899714 100644 --- a/daprdocs/content/en/python-sdk-docs/python-client.md +++ b/daprdocs/content/en/python-sdk-docs/python-client.md @@ -9,13 +9,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. {{% 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. + 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 %}} ## Prerequisites -[Install the Dapr Python package]({{< ref "python#installation" >}}) before getting started. +[Install the Dapr Python package]({{% ref "python#installation" %}}) before getting started. ## Import the client package @@ -140,7 +140,7 @@ except DaprGrpcError as err: ## Building blocks -The Python SDK allows you to interface with all of the [Dapr building blocks]({{< ref building-blocks >}}). +The Python SDK allows you to interface with all of the [Dapr building blocks]({{% ref building-blocks %}}). ### Invoke a service @@ -164,7 +164,7 @@ If this variable is not set, the endpoint value is derived from the `DAPR_RUNTIM The base endpoint for gRPC calls is the one used for the client initialisation ([explained above](#initialising-the-client)). -- For a full guide on service invocation visit [How-To: Invoke a service]({{< ref howto-invoke-discover-services.md >}}). +- 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. ### Save & get application state @@ -183,7 +183,7 @@ with DaprClient() as d: d.delete_state(store_name="statestore", key="key1") ``` -- For a full list of state operations visit [How-To: Get & save state]({{< ref howto-get-save-state.md >}}). +- 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. ### Query application state (Alpha) @@ -213,7 +213,7 @@ with DaprClient() as d: ) ``` -- For a full list of state store query options visit [How-To: Query state]({{< ref howto-state-query-api.md >}}). +- For a full list of state store query options visit [How-To: Query state]({{% ref howto-state-query-api.md %}}). - Visit [Python SDK examples](https://github.com/dapr/python-sdk/tree/master/examples/state_store_query) for code samples and instructions to try out state store querying. ### Publish & subscribe @@ -302,7 +302,7 @@ def mytopic_important(event: v1.Event) -> None: ' content_type="{event.content_type}"',flush=True) ``` -- For more information about pub/sub, visit [How-To: Publish & subscribe]({{< ref howto-publish-subscribe.md >}}). +- For more information about pub/sub, visit [How-To: Publish & subscribe]({{% ref howto-publish-subscribe.md %}}). - Visit [Python SDK examples](https://github.com/dapr/python-sdk/tree/master/examples/pubsub-simple) for code samples and instructions to try out pub/sub. #### Streaming message subscription @@ -428,7 +428,7 @@ if __name__ == '__main__': main() ``` -- For more information about pub/sub, visit [How-To: Publish & subscribe]({{< ref howto-publish-subscribe.md >}}). +- For more information about pub/sub, visit [How-To: Publish & subscribe]({{% ref howto-publish-subscribe.md %}}). - Visit [Python SDK examples](https://github.com/dapr/python-sdk/tree/main/examples/pubsub-simple) for code samples and instructions to try out streaming pub/sub. ### Conversation (Alpha) @@ -437,7 +437,7 @@ if __name__ == '__main__': The Dapr Conversation API is currently in alpha. {{% /alert %}} -Since version 1.15 Dapr offers developers the capability to securely and reliably interact with Large Language Models (LLM) through the [Conversation API]({{< ref conversation-overview.md >}}). +Since version 1.15 Dapr offers developers the capability to securely and reliably interact with Large Language Models (LLM) through the [Conversation API]({{% ref conversation-overview.md %}}). ```python from dapr.clients import DaprClient @@ -472,7 +472,7 @@ with DaprClient() as d: resp = d.invoke_binding(binding_name='kafkaBinding', operation='create', data='{"message":"Hello World"}') ``` -- For a full guide on output bindings visit [How-To: Use bindings]({{< ref howto-bindings.md >}}). +- 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/main/examples/invoke-binding) for code samples and instructions to try out output bindings. ### Retrieve secrets @@ -484,7 +484,7 @@ with DaprClient() as d: resp = d.get_secret(store_name='localsecretstore', key='secretKey') ``` -- For a full guide on secrets visit [How-To: Retrieve secrets]({{< ref howto-secrets.md >}}). +- 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 ### Configuration @@ -529,7 +529,7 @@ async def executeConfiguration(): asyncio.run(executeConfiguration()) ``` -- Learn more about managing configurations via the [How-To: Manage configuration]({{< ref howto-manage-configuration.md >}}) guide. +- 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. ### Distributed Lock @@ -560,7 +560,7 @@ def main(): print('We tried to unlock it anyway and got back [%s]' % unlock_result.status) ``` -- Learn more about using a distributed lock: [How-To: Use a lock]({{< ref howto-use-distributed-lock.md >}}). +- Learn more about using a distributed lock: [How-To: Use a lock]({{% ref howto-use-distributed-lock.md %}}). - Visit [Python SDK examples](https://github.com/dapr/python-sdk/blob/master/examples/distributed_lock) for code samples and instructions to try out distributed lock. ### Cryptography @@ -594,7 +594,7 @@ def main(): print(decrypt_bytes.decode()) # The secret is "passw0rd" ``` -- For a full list of state operations visit [How-To: Use the cryptography APIs]({{< ref howto-cryptography.md >}}). +- For a full list of state operations visit [How-To: Use the cryptography APIs]({{% ref howto-cryptography.md %}}). - Visit [Python SDK examples](https://github.com/dapr/python-sdk/tree/master/examples/crypto) for code samples and instructions to try out cryptography ## Related links 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 4fe4bf7aa..13b6499b9 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 @@ -12,15 +12,15 @@ The Dapr Python SDK provides integration with FastAPI using the `dapr-ext-fastap You can download and install the Dapr FastAPI extension with: -{{< tabs Stable Development>}} +{{< tabpane text=true >}} -{{% codetab %}} +{{% tab header="Stable" %}} ```bash pip install dapr-ext-fastapi ``` -{{% /codetab %}} +{{% /tab %}} -{{% codetab %}} +{{% tab header="Development" %}} {{% 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 %}} @@ -28,9 +28,9 @@ The development package will contain features and behavior that will be compatib ```bash pip install dapr-ext-fastapi-dev ``` -{{% /codetab %}} +{{% /tab %}} -{{< /tabs >}} +{{< /tabpane >}} ## Example @@ -112,4 +112,4 @@ async def startup_event(): @app.get("/GetMyData") def get_my_data(): return "{'message': 'myData'}" -``` \ No newline at end of file +``` 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 e48948bce..b4ec58f9c 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 @@ -12,15 +12,15 @@ The Dapr Python SDK provides integration with Flask using the `flask-dapr` exten You can download and install the Dapr Flask extension with: -{{< tabs Stable Development>}} +{{< tabpane text=true >}} -{{% codetab %}} +{{% tab header="Stable" %}} ```bash pip install flask-dapr ``` -{{% /codetab %}} +{{% /tab %}} -{{% codetab %}} +{{% tab header="Development" %}} {{% 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 %}} @@ -28,9 +28,9 @@ The development package will contain features and behavior that will be compatib ```bash pip install flask-dapr-dev ``` -{{% /codetab %}} +{{% /tab %}} -{{< /tabs >}} +{{< /tabpane >}} ## Example @@ -57,4 +57,4 @@ def get_my_data(): # Run application if __name__ == '__main__': app.run(port=settings.HTTP_APP_PORT) -``` \ No newline at end of file +``` 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 0e868238a..e34c213b5 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 @@ -12,15 +12,15 @@ The Dapr Python SDK provides a built in gRPC server extension, `dapr.ext.grpc`, You can download and install the Dapr gRPC server extension with: -{{< tabs Stable Development>}} +{{< tabpane text=true >}} -{{% codetab %}} +{{% tab header="Stable" %}} ```bash pip install dapr-ext-grpc ``` -{{% /codetab %}} +{{% /tab %}} -{{% codetab %}} +{{% tab header="Development" %}} {{% 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 %}} @@ -28,9 +28,9 @@ The development package will contain features and behavior that will be compatib ```bash pip3 install dapr-ext-grpc-dev ``` -{{% /codetab %}} +{{% /tab %}} -{{< /tabs >}} +{{< /tabpane >}} ## Examples diff --git a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow-ext/_index.md b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow-ext/_index.md index ed75a1eea..12a63f8f6 100644 --- a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow-ext/_index.md +++ b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow-ext/_index.md @@ -13,15 +13,15 @@ The Dapr Python SDK provides a built-in Dapr Workflow extension, `dapr.ext.workf You can download and install the Dapr Workflow extension with: -{{< tabs Stable Development>}} +{{< tabpane text=true >}} -{{% codetab %}} +{{% tab header="Stable" %}} ```bash pip install dapr-ext-workflow ``` -{{% /codetab %}} +{{% /tab %}} -{{% codetab %}} +{{% tab header="Development" %}} {{% 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 %}} @@ -29,9 +29,9 @@ The development package will contain features and behavior that will be compatib ```bash pip install dapr-ext-workflow-dev ``` -{{% /codetab %}} +{{% /tab %}} -{{< /tabs >}} +{{< /tabpane >}} ## Example @@ -88,11 +88,11 @@ if __name__ == '__main__': ``` - Learn more about authoring and managing workflows: - - [How-To: Author a workflow]({{< ref howto-author-workflow.md >}}). - - [How-To: Manage a workflow]({{< ref howto-manage-workflow.md >}}). + - [How-To: Author a workflow]({{% ref howto-author-workflow.md %}}). + - [How-To: Manage a workflow]({{% ref howto-manage-workflow.md %}}). - - Visit [Python SDK examples](https://github.com/dapr/python-sdk/tree/main/examples/workflow) for code samples and instructions to try out Dapr Workflow: - - [Simple workflow example]({{< ref python-workflow.md >}}) + - [Simple workflow example]({{% ref python-workflow.md %}}) - [Task chaining example](https://github.com/dapr/python-sdk/blob/main/examples/workflow/task_chaining.py) - [Fan-out/Fan-in example](https://github.com/dapr/python-sdk/blob/main/examples/workflow/fan_out_fan_in.py) - [Child workflow example](https://github.com/dapr/python-sdk/blob/main/examples/workflow/child_workflow.py) diff --git a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow-ext/python-workflow.md b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow-ext/python-workflow.md index 6e8011f33..8c882ac72 100644 --- a/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow-ext/python-workflow.md +++ b/daprdocs/content/en/python-sdk-docs/python-sdk-extensions/python-workflow-ext/python-workflow.md @@ -20,10 +20,10 @@ In the Python example project, the `simple.py` file contains the setup of the ap - The registration of the workflow and workflow activities ## Prerequisites -- [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed -- Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}}) +- [Dapr CLI]({{% ref install-dapr-cli.md %}}) installed +- Initialized [Dapr environment]({{% ref install-dapr-selfhost.md %}}) - [Python 3.9+](https://www.python.org/downloads/) installed -- [Dapr Python package]({{< ref "python#installation" >}}) and the [workflow extension]({{< ref "python-workflow/_index.md" >}}) 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 @@ -161,6 +161,6 @@ When you run the application, several key workflow features are shown: wf_client.purge_workflow(instance_id=instance_id) ``` ## Next steps -- [Learn more about Dapr workflow]({{< ref workflow-overview.md >}}) -- [Workflow API reference]({{< ref workflow_api.md >}}) +- [Learn more about Dapr workflow]({{% ref workflow-overview.md %}}) +- [Workflow API reference]({{% ref workflow_api.md %}}) - [Try implementing more complex workflow patterns](https://github.com/dapr/python-sdk/tree/main/examples/workflow)