Skip to content

Update daprdocs files to be compatible with latest Hugo version #816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 16 additions & 16 deletions daprdocs/content/en/python-sdk-docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,34 @@ 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" %}}
<!--stable-->
```bash
pip install dapr
```
{{% /codetab %}}
{{% /tab %}}

{{% codetab %}}
{{% tab header="Development" %}}
<!--dev-->
> **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.

```bash
pip install dapr-dev
```

{{% /codetab %}}
{{% /tab %}}

{{< /tabs >}}
{{< /tabpane >}}


## Available subpackages
Expand All @@ -57,14 +57,14 @@ Python SDK imports are subpackages included with the main SDK install, but need
<div class="card-body">
<h5 class="card-title"><b>Client</b></h5>
<p class="card-text">Write Python applications to interact with a Dapr sidecar and other Dapr applications, including stateful virtual actors in Python</p>
<a href="{{< ref python-client >}}" class="stretched-link"></a>
<a href="{{% ref python-client %}}" class="stretched-link"></a>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title"><b>Actors</b></h5>
<p class="card-text">Create and interact with Dapr's Actor framework.</p>
<a href="{{< ref python-actor >}}" class="stretched-link"></a>
<a href="{{% ref python-actor %}}" class="stretched-link"></a>
</div>
</div>
</div>
Expand All @@ -80,28 +80,28 @@ SDK extensions mainly work as utilities for receiving pub/sub events, programati
<div class="card-body">
<h5 class="card-title"><b>gRPC</b></h5>
<p class="card-text">Create Dapr services with the gRPC server extension.</p>
<a href="{{< ref python-grpc >}}" class="stretched-link"></a>
<a href="{{% ref python-grpc %}}" class="stretched-link"></a>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title"><b>FastAPI</b></h5>
<p class="card-text">Integrate with Dapr Python virtual actors and pub/sub using the Dapr FastAPI extension.</p>
<a href="{{< ref python-fastapi >}}" class="stretched-link"></a>
<a href="{{% ref python-fastapi %}}" class="stretched-link"></a>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title"><b>Flask</b></h5>
<p class="card-text">Integrate with Dapr Python virtual actors using the Dapr Flask extension.</p>
<a href="{{< ref python-sdk-extensions >}}" class="stretched-link"></a>
<a href="{{% ref python-sdk-extensions %}}" class="stretched-link"></a>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title"><b>Workflow</b></h5>
<p class="card-text">Author workflows that work with other Dapr APIs in Python.</p>
<a href="{{< ref python-workflow >}}" class="stretched-link"></a>
<a href="{{% ref python-workflow %}}" class="stretched-link"></a>
</div>
</div>
</div>
Expand All @@ -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. |
Expand All @@ -137,7 +137,7 @@ Walk through the Python quickstarts, tutorials, and examples to see Dapr in acti
<div class="card-body">
<h5 class="card-title"><b>Serialization</b></h5>
<p class="card-text">Learn more about serialization in Dapr SDKs.</p>
<a href="{{< ref sdk-serialization >}}" class="stretched-link"></a>
<a href="{{% ref sdk-serialization %}}" class="stretched-link"></a>
</div>
</div>
<div class="card">
Expand Down
10 changes: 5 additions & 5 deletions daprdocs/content/en/python-sdk-docs/python-actor.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
28 changes: 14 additions & 14 deletions daprdocs/content/en/python-sdk-docs/python-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ 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 %}}

```bash
pip install dapr-ext-fastapi-dev
```
{{% /codetab %}}
{{% /tab %}}

{{< /tabs >}}
{{< /tabpane >}}

## Example

Expand Down Expand Up @@ -112,4 +112,4 @@ async def startup_event():
@app.get("/GetMyData")
def get_my_data():
return "{'message': 'myData'}"
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ 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 %}}

```bash
pip install flask-dapr-dev
```
{{% /codetab %}}
{{% /tab %}}

{{< /tabs >}}
{{< /tabpane >}}

## Example

Expand All @@ -57,4 +57,4 @@ def get_my_data():
# Run application
if __name__ == '__main__':
app.run(port=settings.HTTP_APP_PORT)
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ 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 %}}

```bash
pip3 install dapr-ext-grpc-dev
```
{{% /codetab %}}
{{% /tab %}}

{{< /tabs >}}
{{< /tabpane >}}

## Examples

Expand Down
Loading