skip to navigation
skip to content

Not Logged In

OpenDevelop 0.2

Python wrapper for OpenDevelop

# OpenDevelop Python wrapper

## Installation Installation of the OpenDevelop Python wrapper can be done using pip.

pip install opendevelop

## Usage

### Initiate client Initiates the OpenDevelop client. It gets 3 optional parameters;

  • host = os.getenv('OPENDEVELOP_HOST')

  • client_id = os.getenv('OPENDEVELOP_CLIENT_ID')

  • client_secret = os.getenv('OPENDEVELOP_CLIENT_SECRET')

    from opendevelop import OpenDevelop client = OpenDevelop()

### Get available images Returns a Python list with the available images for the current OpenDevelop installation

images = client.images()
#### Example response
[u'base']

### Create a sandbox Creates a sandbox and executes the given commands inside it. It returns the slug of the sandbox is Python string format.

sandbox_slug = client.create_sandbox(image='base', cmd='ls -l ')
#### Example response
u'19cc2425738661a6'

### Create a sandbox with some files inside Creates a sandbox, uploads the files, that correspond to the given absolute file paths, to it and executes the given commands inside it. It returns the slug of the sandbox is Python string format.

sandbox_slug = client.create_sandbox(image='base', cmd='python hello.py', files=['/home/user/Desktop/hello.py'])
#### Example response
u'a4eb0e47e8e51724'

### Get status and logs of a sandbox Returns information about the sandbox identified by the given slug. Returns the data in Python dict format.

data = client.sandbox(sandbox_log)
#### Example response
{u'cmd': u'["python hello.py"]',
u'image': u'base', u'logs': u'Hello OpenDevelop!n', u'return_code': 0, u'status': u'terminated'}
 
File Type Py Version Uploaded on Size
OpenDevelop-0.2.tar.gz (md5) Source 2014-02-08 3KB
  • Downloads (All Versions):
  • 9 downloads in the last day
  • 50 downloads in the last week
  • 241 downloads in the last month
  • Author: Paris Kasidiaris
  • Home Page: http://opendevelop.sourcelair.com
  • License:
    The MIT License (MIT)
    
    Copyright (c) 2013 sourceLair Ltd.
    
    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:
    
    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.
    
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.
  • Package Index Owner: sourcelair
  • DOAP record: OpenDevelop-0.2.xml