Wrappers for HyperThought® API
Project description
Modules that encapsulate HyperThought API calls and make operations like authentication and file transfer (upload or download) easier to accomplish.
Description
Example usage:
Here is the code needed to upload a file to a HyperThought project.
from getpass import getpass
import hyperthought as ht
auth_info = getpass("Enter encoded auth info from your HyperThought profile page: ")
auth = ht.auth.Authorization(auth_info)
files_api = ht.api.files.FilesAPI(auth)
# The space could also be 'group' or 'user'.
space = 'project'
# space_id could also be a group id or username, for group or user spaces, respectively.
space_id = input("Enter destination project id (in url of project): ")
# Create a folder.
# Use default (root) path and don't specify any metadata for the folder.
# (See method docstring for info on unused parameters.)
folder_id = files_api.create_folder(
name="Tests",
space=space,
space_id=space_id,
)
# Get a path for the file.
# Paths consist of comma-separated parent folder ids.
path = f",{folder_id},"
local_file_path = input("Enter path to local file: ")
files_api.upload(
local_path=local_file_path,
space=space,
space_id=space_id,
path=path,
)
# Look in the HyperThought UI to see the uploaded file.
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
hyperthought-0.9.12.tar.gz
(40.3 kB
view hashes)
Built Distribution
Close
Hashes for hyperthought-0.9.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 377512b3c4c41f8007904177d138b7e322017810b239f6c84ed5492d83a0e389 |
|
MD5 | e2d455d2d2ca8992ae74aef5c084832c |
|
BLAKE2b-256 | 9914a49570eff41a0b5b45a9cb473bb87ac8dfcef2212be33653810a30a2e47f |