Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dapr/python-sdk
Dapr SDK for Python
https://github.com/dapr/python-sdk
Last synced: 3 days ago
JSON representation
Dapr SDK for Python
- Host: GitHub
- URL: https://github.com/dapr/python-sdk
- Owner: dapr
- License: apache-2.0
- Created: 2019-06-21T15:51:20.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-21T05:17:39.000Z (4 months ago)
- Last Synced: 2024-10-21T08:13:52.942Z (4 months ago)
- Language: Python
- Homepage:
- Size: 8.01 MB
- Stars: 229
- Watchers: 25
- Forks: 125
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
- awesome-dapr - Dapr Python SDK - Dapr SDK for Python (Uncategorized / Uncategorized)
README
# Dapr SDK for Python
[](https://pypi.org/project/dapr/)
[](https://pypi.org/project/dapr/)
[](https://github.com/dapr/python-sdk/actions/workflows/build.yaml)
[](https://codecov.io/gh/dapr/python-sdk)
[](https://github.com/dapr/python-sdk/blob/main/LICENSE)
[](https://github.com/dapr/python-sdk/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
[](http://bit.ly/dapr-discord)
[](https://youtube.com/@daprdev)
[](https://twitter.com/daprdev)[Dapr](https://docs.dapr.io/concepts/overview/) is a portable, event-driven, serverless runtime for building distributed applications across cloud and edge.
Dapr SDK for Python allows you to implement the [Virtual Actor model](https://docs.dapr.io/developing-applications/building-blocks/actors/actors-overview/), based on the actor design pattern. This SDK can run locally, in a container and in any distributed systems environment.
This includes the following packages:
* [dapr.actor](./dapr/actor): Actor Framework
* [dapr.clients](./dapr/clients): Dapr clients for Dapr building blocks
* [dapr.conf](./dapr/conf): Configuration
* [dapr.serializers](./dapr/serializers): serializer/deserializer
* [dapr.proto](./dapr/proto): Dapr gRPC autogenerated gRPC clients
* [dapr.ext.grpc](./ext/dapr-ext-grpc): gRPC extension for Dapr
* [dapr.ext.fastapi](./ext/dapr-ext-fastapi): FastAPI extension (actor) for Dapr
* [flask.dapr](./ext/flask_dapr): Flask extension (actor) for Dapr## Getting started
### Prerequisites
* [Install Dapr standalone mode](https://github.com/dapr/cli#install-dapr-on-your-local-machine-self-hosted)
* [Install Python 3.9+](https://www.python.org/downloads/)### Install Dapr python sdk
* Official package
```sh
# Install Dapr client sdk
pip3 install dapr# Install Dapr gRPC AppCallback service extension
pip3 install dapr-ext-grpc# Install Dapr Fast Api extension for Actor
pip3 install dapr-ext-fastapi
```* Development package
```sh
# Install Dapr client sdk
pip3 install dapr-dev# Install Dapr gRPC AppCallback service extension
pip3 install dapr-ext-grpc-dev# Install Dapr Fast Api extension for Actor
pip3 install dapr-ext-fastapi-dev
```> Note: Do not install both packages.
### Try out examples
Go to [Examples](./examples)
## Developing
### Build and test
1. Clone python-sdk
```bash
git clone https://github.com/dapr/python-sdk.git
cd python-sdk
```2. Install a project in a editable mode
```bash
pip3 install -e .
pip3 install -e ./ext/dapr-ext-grpc/
pip3 install -e ./ext/dapr-ext-fastapi/
pip3 install -e ./ext/dapr-ext-workflow/
```3. Install required packages
```bash
pip3 install -r dev-requirements.txt
```4. Run linter
```bash
tox -e flake8
```5. Run autofix
```bash
tox -e ruff
```6. Run unit-test
```bash
tox -e py311
```7. Run type check
```bash
tox -e type
```8. Run examples
```bash
tox -e examples
```## Documentation
Documentation is generated using Sphinx. Extensions used are mainly Napoleon (To process the Google Comment Style) and Autodocs (For automatically generating documentation). The `.rst` files are generated using Sphinx-Apidocs.
To generate documentation:
```bash
tox -e doc
```The generated files will be found in `docs/_build`.
## Generate gRPC Protobuf client
```sh
pip3 install -r tools/requirements.txt
./tools/regen_grpcclient.sh
```## Help & Feedback
Need help or have feedback on the SDK? Please open a GitHub issue or come chat with us in the `#python-sdk` channel of our Discord server ([click here to join](https://discord.gg/MySdVxrH)).
## Code of Conduct
This project follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).