EcohydroLib
1.29
|
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... | |
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.
def ecohydrolib.hydroshare.create_console_callback | ( | size | ) |
Create progress callback suitable for displaying the progress of a requests_toolbelt.MultipartEncoderMonitor to a text console.
size | int 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.
context | ecohydrolib.Context object |
auth | hs_restclient.HydroShareAuth object |
title | string representing the title of the resource |
hydroshare_host | string representing DNS name of the HydroShare server in which to create the resource |
hydroshare_port | int representing the TCP port of the HydroShare server |
use_https | True if HTTPS should be used. Default: False |
resource_type | string representing the HydroShare resource type that should be used to create the resource |
abstract | string representing the abstract of the resource |
keywords | list of strings representing the keywords to assign to the resource |
create_callback | user-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 |
verbose | Boolean True if detailed output information should be printed to outfp |
outfp | File-like object to which verbose output should be printed |
def ecohydrolib.hydroshare.get_password_authentication | ( | username, | |
password | |||
) |
Get HydroShare authentication object that can be used to authenticate using a username and password.
username | string |
password | string |