[Python-modules-commits] [python-digitalocean] 06/19: Readme changes (#164)
Andrew Starr-Bochicchio
asb at moszumanska.debian.org
Tue Jun 20 00:31:28 UTC 2017
This is an automated email from the git hooks/post-receive script.
asb pushed a commit to annotated tag 1.10.1
in repository python-digitalocean.
commit fd03c1553e9f22e4b806b84595a53744245ab061
Author: Szabolcs Dombi <cprogrammer1994 at gmail.com>
Date: Thu Oct 6 21:05:09 2016 +0300
Readme changes (#164)
* Update README.md
* fix missing iframes
* fix: cannot center badges
* converted README.md to rst with Pandoc
* Revert "Update README.md"
This reverts commit d10d6d4c39a440166124a124fef23f9bbc71829b.
* restore reverted example
---
DESCRIPTION.rst | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
README.md | 12 +---
setup.py | 4 +-
3 files changed, 195 insertions(+), 11 deletions(-)
diff --git a/DESCRIPTION.rst b/DESCRIPTION.rst
new file mode 100644
index 0000000..38f5a12
--- /dev/null
+++ b/DESCRIPTION.rst
@@ -0,0 +1,190 @@
+python-digitalocean
+===================
+
+This library provides easy access to Digital Ocean APIs to deploy
+droplets, images and more.
+
+|image0|
+
+| |image1|
+| |image2|
+| |image3|
+
+How to install
+--------------
+
+You can install python-digitalocean using **pip**
+
+::
+
+ pip install -U python-digitalocean
+
+or via sources:
+
+::
+
+ python setup.py install
+
+Features
+--------
+
+python-digitalocean support all the features provided via
+digitalocean.com APIs, such as:
+
+- Get user's Droplets
+- Get user's Images (Snapshot and Backups)
+- Get public Images
+- Get Droplet's event status
+- Create and Remove a Droplet
+- Resize a Droplet
+- Shutdown, restart and boot a Droplet
+- Power off, power on and "power cycle" a Droplet
+- Perform Snapshot
+- Enable/Disable automatic Backups
+- Restore root password of a Droplet
+
+ Examples
+---------
+
+Listing the droplets
+~~~~~~~~~~~~~~~~~~~~
+
+This example shows how to list all the active droplets:
+
+.. code:: python
+
+ import digitalocean
+ manager = digitalocean.Manager(token="secretspecialuniquesnowflake")
+ print(manager.get_all_droplets())
+
+Shutdown all droplets
+~~~~~~~~~~~~~~~~~~~~~
+
+This example shows how to shutdown all the active droplets:
+
+.. code:: python
+
+ import digitalocean
+ manager = digitalocean.Manager(token="secretspecialuniquesnowflake")
+ my_droplets = manager.get_all_droplets()
+ for droplet in my_droplets:
+ droplet.shutdown()
+
+Creating a Droplet and checking its status
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This example shows how to create a droplet and how to check its status
+
+.. code:: python
+
+ import digitalocean
+ droplet = digitalocean.Droplet(token="secretspecialuniquesnowflake",
+ name='Example',
+ region='nyc2', # New York 2
+ image='ubuntu-14-04-x64', # Ubuntu 14.04 x64
+ size_slug='512mb', # 512MB
+ backups=True)
+ droplet.create()
+
+Checking the status of the droplet
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code:: python
+
+ actions = droplet.get_actions()
+ for action in actions:
+ action.load()
+ # Once it shows complete, droplet is up and running
+ print action.status
+
+Add SSHKey into DigitalOcean Account
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code:: python
+
+ from digitalocean import SSHKey
+
+ user_ssh_key = open('/home/<$USER>/.ssh/id_rsa.pub').read()
+ key = SSHKey(token='secretspecialuniquesnowflake',
+ name='uniquehostname',
+ public_key=user_ssh_key)
+ key.create()
+
+Creating a new droplet with all your SSH keys
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code:: python
+
+ manager = digitalocean.Manager(token="secretspecialuniquesnowflake")
+ keys = manager.get_all_sshkeys()
+
+ droplet = digitalocean.Droplet(token="secretspecialuniquesnowflake",
+ name='DropletWithSSHKeys',
+ region='ams3', # Amster
+ image='ubuntu-14-04-x64', # Ubuntu 14.04 x64
+ size_slug='512mb', # 512MB
+ ssh_keys=keys, #Automatic conversion
+ backups=False)
+ droplet.create()
+
+Testing
+-------
+
+Test using Docker
+~~~~~~~~~~~~~~~~~
+
+To test this python-digitalocean you can use
+`docker <https://www.docker.com>`__ to have a **clean environment
+automatically**. First you have to build the container by running in
+your shell on the repository directory:
+
+::
+
+ docker build -t "pdo-tests" .
+
+Then you can run all the tests (for both python 2 and python 3)
+
+::
+
+ docker run pdo-tests
+
+**Note**: This will use Ubuntu 14.04 as base and use your repository to
+run tests. So every time you edit some files, please run these commands
+to perform tests on your changes.
+
+Testing using pytest manually
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Use `pytest <http://pytest.org/>`__ to perform testing. It is
+recommended to use a dedicated virtualenv to perform tests, using these
+commands:
+
+::
+
+ $ virtualenv /tmp/digitalocean_env
+ $ source /tmp/digitalocean_env/bin/activate
+ $ pip install -r requirements.txt
+
+To run all the tests manually use py.test command:
+
+::
+
+ $ python -m pytest
+
+Links
+-----
+
+- GitHub: https://github.com/koalalorenzo/python-digitalocean
+- PyPI page: https://pypi.python.org/pypi/python-digitalocean/
+- Author Website:
+ `http://who.is.lorenzo.setale.me/? <http://setale.me/>`__
+- Author Blog: http://blog.setale.me/
+
+.. |image0| image:: https://travis-ci.org/koalalorenzo/python-digitalocean.svg
+ :target: https://travis-ci.org/koalalorenzo/python-digitalocean
+.. |image1| image:: https://img.shields.io/github/forks/badges/shields.svg?style=social&label=Fork
+ :target: https://travis-ci.org/koalalorenzo/python-digitalocean
+.. |image2| image:: https://img.shields.io/github/stars/badges/shields.svg?style=social&label=Star
+ :target: https://travis-ci.org/koalalorenzo/python-digitalocean
+.. |image3| image:: https://img.shields.io/github/watchers/badges/shields.svg?style=social&label=Watch
+ :target: https://travis-ci.org/koalalorenzo/python-digitalocean
diff --git a/README.md b/README.md
index f9229a3..d751ac0 100644
--- a/README.md
+++ b/README.md
@@ -5,15 +5,9 @@ This library provides easy access to Digital Ocean APIs to deploy droplets, imag
[](https://travis-ci.org/koalalorenzo/python-digitalocean)
-<div align="center">
-
-<iframe src="http://ghbtns.com/github-btn.html?user=koalalorenzo&repo=python-digitalocean&type=follow&size=large&count=true"
- allowtransparency="true" frameborder="0" scrolling="0" width="220" height="30"></iframe>
-
-<iframe src="http://ghbtns.com/github-btn.html?user=koalalorenzo&repo=python-digitalocean&type=watch&size=large&count=true"
- allowtransparency="true" frameborder="0" scrolling="0" width="150" height="30"></iframe>
-
-</div>
+[](https://travis-ci.org/koalalorenzo/python-digitalocean)
+[](https://travis-ci.org/koalalorenzo/python-digitalocean)
+[](https://travis-ci.org/koalalorenzo/python-digitalocean)
## How to install
diff --git a/setup.py b/setup.py
index a1de1d2..85bd4c4 100644
--- a/setup.py
+++ b/setup.py
@@ -9,8 +9,8 @@ except ImportError:
long_description = """This library provides easy access to Digital Ocean APIs to deploy droplets, images and more."""
-if os.path.isfile("README.md"):
- with open('README.md') as file:
+if os.path.isfile("DESCRIPTION.rst"):
+ with open('DESCRIPTION.rst') as file:
long_description = file.read()
setup(
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-digitalocean.git
More information about the Python-modules-commits
mailing list