IPython file upload widget
Project description
An IPython notebook widget to upload files, using FileReader.
Installation
Install using pip:
pip install fileupload
Install JavaScript:
jupyter nbextension install [--user] --py fileupload
Enable the extension:
jupyter nbextension enable [--user] --py fileupload
Usage
import io
from IPython.display import display
import fileupload
def _upload():
_upload_widget = fileupload.FileUploadWidget()
def _cb(change):
decoded = io.StringIO(change['owner'].data.decode('utf-8'))
filename = change['owner'].filename
print('Uploaded `{}` ({:.2f} kB)'.format(
filename, len(decoded.read()) / 2 **10))
_upload_widget.observe(_cb, names='data')
display(_upload_widget)
_upload()
Base64 data is synced to the data_base64 member, decoded data can be obtained from data. The name of the uploaded file is stored in filename.
Changelog
Refer to Changelog.
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for fileupload-0.1.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31d31c1e4f7c74632e66bc53b46c94a3691fc68e449bdcb54d7653be5d4139c5 |
|
MD5 | 48daa6665aca27476f512c1c67ba9f98 |
|
BLAKE2b-256 | 4319014a32d2f435d29a5fb43a487d42a9afa2c188df56d152306de11a112178 |