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.14.tar.gz
(41.5 kB
view details)
Built Distribution
File details
Details for the file hyperthought-0.9.14.tar.gz
.
File metadata
- Download URL: hyperthought-0.9.14.tar.gz
- Upload date:
- Size: 41.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4d5188cf3ee7b51e55b70827de36fe6d0720163b903bc47c391ca2880382edb |
|
MD5 | af44b1ccd6f5074d5b9f79ee882c4479 |
|
BLAKE2b-256 | 24933c01dc860b459f6da278c1152f2c852daa0436f796b1bbcfd5df95895479 |
File details
Details for the file hyperthought-0.9.14-py3-none-any.whl
.
File metadata
- Download URL: hyperthought-0.9.14-py3-none-any.whl
- Upload date:
- Size: 51.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98eeffe165c2a4735f229f048ccd687412ef3fe60eb12e711aa02e71157e0b88 |
|
MD5 | 600dcbfb58941e9515054afb9b497b8b |
|
BLAKE2b-256 | 4f999d0a668655b3ed2d676691235c354cb6992d8cbf13eaef7a4d7096bb448c |