Python client for the Digital Ocean API
Project description
Digital Ocean API Python Wrapper
Inspired by [dop](https://github.com/ahmontero/dop).
Installation
# pip install dopy
Getting Started
To interact with Digital Ocean, you first need .. a digital ocean account with valid API keys.
Keys can be set either as Env variables, or within the code.
For API v.2.
# export DO_API_VERSION='2'
# export DO_API_TOKEN='api_token'
>>> from dopy.manager import DoManager
>>> do = DoManager(None, 'api_token', api_version=2)
For API v.1.
# export DO_CLIENT_ID='client_id'
# export DO_API_KEY='long_api_key'
>>> from dopy.manager import DoManager
>>> do = DoManager('client_id', 'long_api_key')
Methods
The methods of the DoManager are self explanatory; ex.
>>> do.all_active_droplets()
>>> do.show_droplet('12345')
>>> do.destroy_droplet('12345')
>>> do.all_regions()
>>> do.all_images()
>>> do.all_ssh_keys()
>>> do.sizes()
>>> do.all_domains()
>>> do.new_droplet('new_droplet', 66, 1601, 1)
The methods for v.2 API are similar, the only difference is using names instead of IDs for domains and slugs for sizes, images and datacenters; ex.
>>> do.show_domain('exapmle.com')
>>> do.new_droplet('new_droplet', '512mb', 'lamp', 'ams2')
TODO
See github issue list - post if any needed
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dopy-0.3.7.tar.gz
(6.5 kB
view details)
File details
Details for the file dopy-0.3.7.tar.gz
.
File metadata
- Download URL: dopy-0.3.7.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d1a7a15ef5711220ee9fc3fd489e738bb365cdad042c4f791cd5c16f2dbf9fd |
|
MD5 | 26d044b9901f27e277dbcc173942d21c |
|
BLAKE2b-256 | 47fa2d46bbed54ac42c24fa48893cb0a4ae6771999830ee270e1d12631bcd743 |