EcohydroLib  1.29
Functions
ecohydrolib.hydroshare Namespace Reference

Utilities for interacting with HydroShare (http://www.hydroshare.org/) More...

Functions

def create_console_callback (size)
 Create progress callback suitable for displaying the progress of a requests_toolbelt.MultipartEncoderMonitor to a text console. More...
 
def get_password_authentication (username, password)
 Get HydroShare authentication object that can be used to authenticate using a username and password. More...
 
def create_hydroshare_resource
 Create HydroShare resource of an EcohydroLib project. More...
 

Detailed Description

Utilities for interacting with HydroShare (http://www.hydroshare.org/)

This software is provided free of charge under the New BSD License. Please see the following license information:

Copyright (c) 2015, University of North Carolina at Chapel Hill All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Author
Brian Miles brian.nosp@m._mil.nosp@m.es@un.nosp@m.c.ed.nosp@m.u

Function Documentation

def ecohydrolib.hydroshare.create_console_callback (   size)

Create progress callback suitable for displaying the progress of a requests_toolbelt.MultipartEncoderMonitor to a text console.

Parameters
sizeint representing the number of bytes to be read be the MultipartEncoderMonitor
def ecohydrolib.hydroshare.create_hydroshare_resource (   context,
  auth,
  title,
  hydroshare_host = 'www.hydroshare.org',
  hydroshare_port = None,
  use_https = False,
  resource_type = 'GenericResource',
  abstract = None,
  keywords = None,
  create_callback = None,
  verbose = False,
  outfp = sys.stderr 
)

Create HydroShare resource of an EcohydroLib project.

Parameters
contextecohydrolib.Context object
authhs_restclient.HydroShareAuth object
titlestring representing the title of the resource
hydroshare_hoststring representing DNS name of the HydroShare server in which to create the resource
hydroshare_portint representing the TCP port of the HydroShare server
use_httpsTrue if HTTPS should be used. Default: False
resource_typestring representing the HydroShare resource type that should be used to create the resource
abstractstring representing the abstract of the resource
keywordslist of strings representing the keywords to assign to the resource
create_callbackuser-defined callable that takes as input a file size in bytes, and generates a callable to provide feedback to the user about the progress of the upload of resource_file. For more information, see: http://toolbelt.readthedocs.org/en/latest/uploading-data.html#monitoring-your-streaming-multipart-upload
verboseBoolean True if detailed output information should be printed to outfp
outfpFile-like object to which verbose output should be printed
Returns
string representing the ID of the newly created resource
def ecohydrolib.hydroshare.get_password_authentication (   username,
  password 
)

Get HydroShare authentication object that can be used to authenticate using a username and password.

Parameters
usernamestring
passwordstring
Returns
HydroShareAuth object