Library for working with Skills Network
Project description
Skills Network Python Library
A python library for working with Skills Network.
Installation
JupyterLite Installation
pip install skillsnetwork
Regular Installation (JupyterLab, CLI, etc.)
pip install skillsnetwork[regular]
Usage
JupyterLab / JupyterLite on Skills Network Labs
The skillsnetwork
package provides a unified interface for reading/downloading
files in JupyterLab and JupyterLite.
Reading a file
content = await skillsnetwork.read("https://example.com/myfile")
Downloading a file
await skillsnetwork.download("https://example.com/myfile", filename=filename)
with open(filename, "r") as f:
content = f.read()
Preparing a dataset (downloading, unzipping, and unarchiving)
await skillsnetwork.prepare("https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBM-ML0187EN-SkillsNetwork/labs/module%203/images/images.tar.gz")
Example migration from old method
Old methods
Naively downloading and unzipping/untarring (runs very slowly on Skills Network Labs):
! wget https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBM-ML0187EN-SkillsNetwork/labs/module%203/images/images.tar.gz
print("Images dataset downloaded!")
!tar -xf images.tar.gz
print("Images dataset unzipped!")
Old workaround for better performance (this is confusing to users)
! wget https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBM-ML0187EN-SkillsNetwork/labs/module%203/images/images.tar.gz
print("Images dataset downloaded!")
!tar -xf images.tar.gz -C /tmp
!rm -rf images
!ln -sf /tmp/images/ .
print("Images dataset unzipped!")
New and improved method
await skillsnetwork.prepare("https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBM-ML0187EN-SkillsNetwork/labs/module%203/images/images.tar.gz")
CV Studio
Environment Variables
CV_STUDIO_TOKEN
CV_STUDIO_BASE_URL
IBMCLOUD_API_KEY
Python Code example
from datetime import datetime
import skillsnetwork.cvstudio
cvstudio = skillsnetwork.cvstudio.CVStudio('token')
cvstudio.report(started=datetime.now(), completed=datetime.now())
cvstudio.report(url="http://vision.skills.network")
CLI example
python -m 'skillsnetwork.cvstudio'
Contributing
Please see CONTRIBUTING.md
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
skillsnetwork-0.19.1.tar.gz
(10.8 kB
view hashes)
Built Distribution
Close
Hashes for skillsnetwork-0.19.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 719b3da05126dc564c16c03ae4f19e16a1ce8e99a0dfe02aa0b3f6bf4c218541 |
|
MD5 | f1f83bfc35989aaf8bcba4a5bc2ab061 |
|
BLAKE2b-256 | 4b497f0d0b1ddd517a1dc7ecf2eafd9fcbd5fccee7ccce56c60af0f383941ec2 |