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 workspace.
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)
# space_id can be found in the url for the workspace
# e.g. https://www.hyperthought.io/workspace/<space_id>/detail
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_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_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-1.2.0.tar.gz
(66.8 kB
view hashes)
Built Distribution
Close
Hashes for hyperthought-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d39b747975574e0560e037ca04f78e36e8635b13e44b37692a05ba65fae27206 |
|
MD5 | 2aa8a12e46a51ea643e5434567ec2d44 |
|
BLAKE2b-256 | 1096faf6acab9239656df3cd6ff53fbbac54b22c02f58c0880d2eeef1031b6a4 |