PyDo is DigitalOcean’s official Python client library based on DigitalOcean’s OpenAPIv3 specification.
To use PyDo, you need Python version 3.7.2 or higher.
You can install the latest stable release of PyDo from PyPi:
pip install pydo
You can alternatively install the most recent version of PyDo from the GitHub repository:
pip install git+https://github.com/digitalocean/pydo.git
You can also install from source by cloning the repository and using make install
.
You need to initialize PyDo with pydo.Client()
and pass it a DigitalOcean API token:
import os
from pydo import Client
client = Client(token=os.getenv("DIGITALOCEAN_TOKEN"))
Most endpoints in our API have a corresponding PyDo example, which you can view in the API spec and directly in the PyDo library reference.